Application Development and Automation 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: 
Read only

Report ALV

Former Member
0 Likes
1,124

Hi,

How can i specify end-of-page in ALV (like top-of-page)?

Thanks

Hi,

How can i specify end-of-page in ALV (like top-of-page)?

Thanks

9 REPLIES 9
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,105

Please see this example program.

http://www.sap-img.com/abap/sample-programs-on-alv-grid.htm

Regards,

RIch Heilman

Read only

Former Member
0 Likes
1,105

Hi,

Check this code

Perform following steps if you are using ALV FM.

<b>REPORT ZTEST LINE-COUNT 64(10). "reserve 10 lines for endof page</b>

Note: END OF PAGE can be found in Printout, you can't see it in Display.

check it in Print.

1. Build the events table

DATA: LS_EVENT TYPE SLIS_ALV_EVENT.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

I_LIST_TYPE = 0

IMPORTING

ET_EVENTS = RT_EVENTS.

IF SY-SUBRC <> 0.

ENDIF.

READ TABLE RT_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE

INTO LS_EVENT.

IF SY-SUBRC = 0.

MOVE ALV_TOP_OF_PAGE TO LS_EVENT-FORM.

APPEND LS_EVENT TO RT_EVENTS.

ENDIF.

2. Write a subroutine END_OF_PAGE

FORM END_OF_PAGE. "#EC CALLED

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

I_LOGO = SPACE

IT_LIST_COMMENTARY = ALV_LIST_TOP_OF_PAGE.

IF SY-SUBRC NE 0.

ENDIF.

ENDFORM.

3. Build the comments you want to write at the End of Page.

4. Now call the ALV FM

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = SY-REPID

IS_LAYOUT = ALV_LAYOUT

IT_FIELDCAT = ALV_FCAT[]

I_SAVE = 'X'

IT_EVENTS = ALV_EVENTS[]

TABLES

T_OUTTAB = ITAB1

EXCEPTIONS

PROGRAM_ERROR = 0

OTHERS = 0.

Thanks,

Vinay

Read only

Former Member
0 Likes
1,105

Hi,

Check the following link

http://www.sapbrain.com

regards,

bhaskar

Read only

Former Member
0 Likes
1,105

check the below link ... u will get lot of alv examples....

http://www.geocities.com/mpioud/Abap_programs.html

~~Guduri

Read only

Former Member
0 Likes
1,105

Hi..,

yes u can !!

we have the event END_OF_PAGE in ALV...

give a form name to the it_event table along with this event name..

and in the form write whatever u want ..

this will be appeared a End-of-page in the Output display , if u have multiple number of pages !!

regards,

sai ramesh

Read only

0 Likes
1,105

i am using function 'REUSE_ALV_GRID_DISPALY'. i display top_of_page (title, date, etc) but not end_of_page. I went write sy-uname in end_of_page.

please help

Read only

0 Likes
1,105

Hi,

Data: it_events type slis_t_event.

Data: w_events type slis_alv_event.

w_events-name = 'END_OF_LIST'.

w_events-form = 'SUB_END_LIST'.

append w_events to it_events.

Form sub_end_list.

write: sy-uname,sy-pagno.

endform.

pass the it_events to the it_event parametrers in ur FM

santhosh

Read only

0 Likes
1,105

its fine. thanks for all your answers

Read only

0 Likes
1,105

thanks santhosh but this code is for end of list me i went end of page. I replaced end_of_list by end_of_page but its not ok.

Data: it_events type slis_t_event.

Data: w_events type slis_alv_event.

w_events-name = 'END_OF_LIST'.

w_events-form = 'SUB_END_LIST'.

append w_events to it_events.

Form sub_end_list.

write: sy-uname,sy-pagno.

endform.

pass the it_events to the it_event parametrers in ur FM