12-20-2005 9:22 AM
12-20-2005 9:33 AM
12-20-2005 9:36 AM
HI,
Check the Program BCALV_TEST_GRID_EVENTS.
Hope it helps...
Lokesh
Pls. reward appropriate points
12-20-2005 9:41 AM
12-20-2005 9:53 AM
Hi avinash,
this is the sample code..
Hope this would help u..
Declare structures for ALV events
tb_events type slis_t_event,
and work area
x_events type slis_alv_event,
1 )
write a get events form with the following code
refresh : tb_events.
clear : tb_events.
data : l_tabix type sy-tabix.
To get the events from this function module
for ALV display
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = tb_events
exceptions
list_type_wrong = 1
others = 2.
if sy-subrc <> 0.
message i999 with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
Modifing Top of Page event
read table tb_events with key name = slis_ev_top_of_page
into x_events.
clear l_tabix.
l_tabix = sy-tabix.
if sy-subrc = 0.
x_events-form = 'TOP_OF_PAGE'.
modify tb_events from x_events index l_tabix.
clear x_events.
endif.
2) and pass tb_events to the fM as ...
call function 'REUSE_ALV_GRID_DISPLAY'
it_events = tb_events.
3) 'TOP_OF_PAGE' is the form name.
form top_of_page.
u can use the
write statements in this form directly.....
( OR ) using ALV specific top_of_page
Top-of-page for the ALV format
refresh tb_comments.
clear x_comments.
x_comments-typ = c_s.
x_comments-key = 'Pass the label here'.
x_comments-info = 'Pass the value here'.
append x_comments to tb_comments.
and repeat the above 5 stmts for number of items to be displayed. and customize the x_comments type, key and info as per the requirement.
and call the following function module for printing the top of page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = tb_comments.
any of the two works fine....
endform. " TOP_OF_PAGE
Regards
Hari