Welcome To My BLOG

This site is to give a brief idea for the abap learners who are looking for some real time programs .It consists of collection of programs from my side . I hope these programs are very much used for all of the learners. Please check the links for any information in ABAP.
Please vote for my Blog. And please input me on this mail addrssess.Email me

Share this link with your friends

http://www.rebtel.com/u/15163104576

For every friend who signs up using this link and makes a payment, we'll give you 8 €!


Thursday, September 23, 2010

Lightsusing alv

REPORT ALV_LIGHTS.

COMTYPES: BEGIN OF ty_alv,
lights(1) TYPE c, "Exception, Holding the value of the lights
text(20) TYPE c, "some text
END OF ty_alv.

DATA: gs_alv TYPE ty_alv,
gt_alv TYPE TABLE OF ty_alv,
gr_alv TYPE REF TO cl_salv_table,
gr_columns TYPE REF TO cl_salv_columns_table.

START-OF-SELECTION.

gs_alv-lights = '1'. "Color red
gs_alv-text = 'RED SIGNAL'.
APPEND gs_alv TO gt_alv.

gs_alv-lights = '2'. "Color yellow
gs_alv-text = 'YELLOW SIGNAL'.
APPEND gs_alv TO gt_alv.

gs_alv-lights = '3'. "Color green
gs_alv-text = 'GREEN SIGNAL'.
APPEND gs_alv TO gt_alv.

CALL METHOD cl_salv_table=>factory
IMPORTING r_salv_table = gr_alv
CHANGING t_table = gt_alv.

gr_columns = gr_alv->get_columns( ).
gr_columns->set_exception_column( value = 'LIGHTS' ).

CALL METHOD gr_alv->display.

No comments: