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: 

Getting Page Number in Print Pages. Output is in ALV

Former Member
0 Kudos

Hi All,

I have a requirement to get Page Number in the print output of a Report Program. The output is displayed in a Grid ALV using <b>'REUSE_ALV_GRID_DISPLAY'</b> . I want to know whether we can make use of any parameters in the above Function Module like <b>IS_PRINT</b> or any other parameter.

if anyone has come across such a requirement please suggest what to be done to get page number in the printed pages.

Thanks in Advance,

Shyam.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Shyam,

Look at the below thread, the same question was asked and that has been answerd

mark all the helpful answers

Regards

Sudheer

3 REPLIES 3

Former Member
0 Kudos

Use print_top_of_list event.

CLASS lcl_event_receiver DEFINITION.

PUBLIC SECTION.

METHODS:

handle_top_of_list

FOR EVENT print_top_of_list OF cl_gui_alv_grid,

handle_end_of_list

FOR EVENT print_end_of_list OF cl_gui_alv_grid.

ENDCLASS. "lcl_event_receiver DEFINITION

CLASS lcl_event_receiver IMPLEMENTATION.

METHOD handle_top_of_list.

write: 'Page', sy-pagno.

ENDMETHOD. "handle_top_of_list

The same concept should be in REUSE_ALV_GRID_DISPLAY

In the <b>IT_EVENTS TYPE SLIS_T_EVENT OPTIONAL</b>

Pass that event.

FORM f4000_events_init CHANGING i_events TYPE slis_t_event.

DATA: line_event TYPE slis_alv_event.

CLEAR line_event.

line_event-name = 'TOP_OF_LIST'.

line_event-form = 'F4100_TOP_OF_LIST'.

APPEND line_event TO i_events.

ENDFORM. " f4000_events_init

Form F4100_TOP_OF_LIST.

write: 'PAGE', sy-pagno.

enform.

Check the below links too:

http://www.sap-img.com/abap/an-interactive-alv-report.htm

http://www.sap-img.com/abap/example-of-a-simple-alv-grid-report.htm

http://www.sap-basis-abap.com/abap/alv-example-contract-renewal-details.htm

http://www.sapfans.com/forums/viewtopic.php?t=44477

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/37c5db90-0201-0010-3a9b-d0a...

Regards,

Prakash.

Former Member
0 Kudos

Hi Shyam,

Look at the below thread, the same question was asked and that has been answerd

mark all the helpful answers

Regards

Sudheer

0 Kudos

The Link which you given was good one..

But as END-OF-PAGE event is not a parameter in REUSE_ALV_GRID_DISPLAY,how to pass this information into the same FM . How the control will be coming to <b>Form end-of-page</b>