Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

how to add top of page

Former Member
0 Kudos

how to add top of page to grid display using alv classes

4 REPLIES 4

abdul_hakim
Active Contributor
0 Kudos

Hi,

Check the demo program BCALV_GRID_01

Abdul

Former Member
0 Kudos

HI,

Check the Program BCALV_TEST_GRID_EVENTS.

Hope it helps...

Lokesh

Pls. reward appropriate points

former_member188685
Active Contributor
0 Kudos

hi using alv classes top of page

you have to do so many things...

just refer this thread..

you need to use set handler and splitter container for that...

Former Member
0 Kudos

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