Skip to Content
avatar image
Former Member

DISPLAY PAGENO/TOTAL NUMBER OF PAGES

hi

I want to display the page number/total number of pages in the report.footer

for eg : 1/10,2/10 etc.

Plz reply.

regards.

Kamal

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Aug 18, 2007 at 11:29 AM

    Hi Kamal

    first u will get data in the internal table then findout the toal number of records and then divide these number by the number of lines that u have defind in the starting of program.

    so u will get number of pages in a variable and use that one

    i hope u understand

    Rewad if helpful.

    kiran.M

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 18, 2007 at 11:30 AM

    Hi Kamal,

    For displaying page no you van use: SY-PAGNO.

    for total page no you have to do manual calculation:

    1. first get number of rows of the internal table that are used for showing in list

    2. diivide number of rows to SY-LINCT and it will help you to get number of rows.

    for showing you can write that piece of code in END-OF-PAGE event.

    Regards,

    Krishnendu

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 18, 2007 at 11:47 AM

    Hi kamal,

    Just go through this hope u can do .

    . Define looping process for internal table

    Pages and windows

    First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)

    Here, you can specify your title and page numbering

    &SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)

    Main windows -> TABLE -> DATA

    In the Loop section, tick Internal table and fill in

    ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2

    &SAPSCRIPT-FORMPAGES&:

    This field contains a number representing the total number of pages of the currently formatted form (any output between START_FORM and END_FORM). The page counter mode (START, INC, HOLD) of the individual pages is ignored. You can use this symbol to formulate information like

    ‘Page x of y’ for your output.

    &SAPSCRIPT-JOBPAGES&:

    This field contains a number representing the total number of pages of all forms contained in the currently formatted print request, in other words, of all forms created using the OPEN_FORM, START_FORM.. ENDFORM, START_FORM.. END_FORM,..., CLOSE_FORM function modules.

    When using the SAPSCRIPT-FORMPAGES or SAPSCRIPT-JOBPAGES symbols, SAPscript leads all output pages of the current form or current print request into main memory to replace the symbol by the appropriate value. For large output jobs, this can mean a very large amount of memory.

    reward points if helpful.

    Thanks

    Naveen khan

    Message was edited by:

    Pattan Naveen

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 18, 2007 at 01:31 PM

    Hi

    It depends on the number (X) you give in the field LINE-COUNT 35(<b>X)</b>

    by default footer will take 2 lines

    say for example you gave LINE-COUNT 65(1)

    then you can display the pagenumber by writing the small code like

    DATA: N TYPE P,M TYPE I.

    N = CEIL( SY-DBCNT / ( SY-LINCT - 3 ) ) .

    M = N.

    WRITE: / SY-PAGNO 'of' M.

    THIS WILL WRITE the required format as 1 of 10

    reward points

    Regards

    Anji

    Add comment
    10|10000 characters needed characters exceeded