Saturday, December 19, 2009

Page Number Running In Background Code Example




REPORT zpage1 NO STANDARD PAGE HEADING LINE-SIZE 80
LINE-COUNT 55.

TABLES: SFLIGHT.

SELECT-OPTIONS: CARRIER FOR SFLIGHT-CARRID.

DATA: IVBAP TYPE STANDARD TABLE OF SFLIGHT WITH HEADER LINE,
TAB_ENTRIES TYPE I,
TOTAL_PAGES TYPE P DECIMALS 3,
TOTAL_NUMBER_OF_PAGES TYPE P DECIMALS 0,
HEADER_LINE_COUNT TYPE I VALUE 3.

SELECT * FROM SFLIGHT INTO TABLE IVBAP WHERE CARRID IN CARRIER.

DESCRIBE TABLE IVBAP LINES TAB_ENTRIES.

TOTAL_PAGES = ( TAB_ENTRIES / SY-LINCT ).
TOTAL_PAGES = ( ( ( TOTAL_PAGES * HEADER_LINE_COUNT )
+ TAB_ENTRIES ) / SY-LINCT ).
TOTAL_NUMBER_OF_PAGES = CEIL( TOTAL_PAGES ).

LOOP AT IVBAP.

WRITE:/ IVBAP-CARRID,
IVBAP-PLANETYPE.

ENDLOOP.

TOP-OF-PAGE.

WRITE:/ 'LIST OF SALES ORDERS',
45 'Page',
SY-PAGNO,
'of' NO-GAP,
TOTAL_NUMBER_OF_PAGES.
ULINE.
SKIP.

No comments:

Post a Comment