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: 

To Shashank Deshpande

Former Member
0 Kudos

Can u give me a exactly example about how to use 'END_OF_PAGE' event . thanks !

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

Hi,

try that , But it will be visible only at the time of Printing the Report, if you still have a doubt then just put a break point in END_OF_PAGE and click on Print it will trigger. in print out you can see the content what ever you are trying .

Regards

vijay

9 REPLIES 9

Former Member
0 Kudos

Hi,

Look at this ex: DEMO_LIST_END_OF_PAGE

Regards,

GSR.

former_member188685
Active Contributor
0 Kudos

Hi Mao,

this event will trigger when ever it encounters the end of page. this can be done via line-count attribute.

REPORT ZREPORT line-size 180
               <b>line-count 20(3)</b>.

here for every 2o lines the end-of-page will trigger.and also 3 lines are reserved for writing some thing in the footer of the page (this is depends on your application)

Regards

vijay

vinod_gunaware2
Active Contributor
0 Kudos

REPORT demo_list_new_page_line_c_1 LINE-SIZE 40 LINE-COUNT 0(1).

END-OF-PAGE.

ULINE.

START-OF-SELECTION.

NEW-PAGE LINE-COUNT 5.

DO 4 TIMES.

WRITE / sy-index.

ENDDO.

WRITE: / 'Next Loop:'.

NEW-PAGE LINE-COUNT 6.

DO 6 TIMES.

WRITE / sy-index.

ENDDO.

The REPORT statement reserves one line of each page for the page footer. The page footer is defined in the END-OF-PAGE event as a horizontal line.

regards

vinod

Former Member
0 Kudos

thanks for your kindness.

but what i want to know is 'END_OF_PAGE',one events of ALV ,not 'end-of-page'.lol

Message was edited by: amao

0 Kudos

Hi,

Is your problem solved?

>>> but to see the example 'DEMO_LIST_END_OF_PAGE'?lol

What does this mean???

Please keep your subject descriptive.

Also see before starting a new topic...

Thanks

Paul.

0 Kudos

HI mao,

first of all one important thing you should know...

<b>end-of-page event in ALV triggers only at the time of printing.</b>

for this check this small example...

REPORT  Z_TEST_ALV_EVENTS  line-count 10(3).

type-pools: slis.
data: x_fieldcat type slis_fieldcat_Alv,
      it_fieldcat type slis_t_fieldcat_alv,
      x_events type slis_alv_event,
      it_events type SLIS_T_EVENT.
data: v_lines type i.
data: begin of itab occurs 0,
       vbeln like vbak-vbeln,
       posnr like vbap-posnr,
      end of itab.

select vbeln
       posnr
       from vbap
       up to 100 rows
       into table itab.

 x_events-name =  'END_OF_PAGE'.
 x_events-form =  'END_OF_PAGE'.
 append x_events to it_events.
 clear x_events.


* call function 'REUSE_ALV_EVENTS_GET'
*  EXPORTING
*    I_LIST_TYPE           = 0
*  IMPORTING
*    ET_EVENTS             = IT_EVENTS
*  EXCEPTIONS
*    LIST_TYPE_WRONG       = 1
*    OTHERS                = 2
*           .
* if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* endif.
*
* read table it_events into x_events with key name = 'TOP_OF_PAGE'.
*      if sy-subrc = 0.
*      x_events-form = 'TOP_OF_PAGE'.
*      modify it_events from x_events index sy-tabix transporting form .
*      endif.
*

call function 'REUSE_ALV_FIELDCATALOG_MERGE'
 EXPORTING
   I_PROGRAM_NAME               = sy-repid
   I_INTERNAL_TABNAME           = 'ITAB'
   I_INCLNAME                   = sy-repid
  changing
    ct_fieldcat                  = IT_FIELDCAT
 EXCEPTIONS
   INCONSISTENT_INTERFACE       = 1
   PROGRAM_ERROR                = 2
   OTHERS                       = 3
          .
if sy-subrc <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.

describe table itab lines v_lines.
 call function 'REUSE_ALV_LIST_DISPLAY'
  EXPORTING
    I_CALLBACK_PROGRAM                = sy-repid
    I_CALLBACK_PF_STATUS_SET          = 'STATUS'
    I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
    IT_FIELDCAT                       = IT_FIELDCAT
    IT_EVENTS                         = IT_EVENTS
    tables
     t_outtab                         = ITAB[]
  EXCEPTIONS
    PROGRAM_ERROR                     = 1
    OTHERS                            = 2
           .
 if sy-subrc <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
 endif.

 FORM END_OF_PAGE.
 BREAK-POINT.
 write 😕 'You are in end-of-page'.

 ENDFORM.

end-of-page will come only in printing...

Regards

vijay

Former Member
0 Kudos

thanks,

in my progame:

FORM TOP_OF_PAGE.

REFRESH GT_LIST_TOP_OF_PAGE.

DATA: LS_LINE TYPE SLIS_LISTHEADER.

CLEAR LS_LINE.

LS_LINE-TYP = 'H'.

LS_LINE-INFO = 'The first title'.

APPEND LS_LINE TO GT_LIST_TOP_OF_PAGE.

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-INFO = ''The second title'' .

APPEND LS_LINE TO GT_LIST_TOP_OF_PAGE.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.

ENDFORM.

can i do 'END_OF_PAGE' like this ?

former_member188685
Active Contributor
0 Kudos

Hi,

try that , But it will be visible only at the time of Printing the Report, if you still have a doubt then just put a break point in END_OF_PAGE and click on Print it will trigger. in print out you can see the content what ever you are trying .

Regards

vijay

Former Member
0 Kudos

<i>thank you !!</i>problem solved.