Skip to Content
avatar image
Former Member

SAPScript Page number, problem

Hi All,

In my form i have defined 3 pages, First Second and Annex. Next page of First is Second and for Second is Second. Next page for Annex is Annex.

Suppose my transaction prints 8 pages out of which last 3 pages are Annex. I have to give page numbers for first 5 pages as 1/5 2/5 ....5/5 while the last 3 pages wont have any page nos.

How do i do it??

Regards,

Nikhil

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • avatar image
    Former Member
    Mar 22, 2009 at 07:15 AM

    Se71 ->First page >Windows--->Text Editor

    Write it in Command line :

    :/  &page& of &SAPSCRIPT-FORMPAGES&

    &Page&--->Current Page number

    &SAPSCRIPT-FORMPAGES& -->total pages

    Reagrds,

    Gurpreet

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 22, 2009 at 07:24 AM

    hi,

    the pages of annex, are they dynamically determined or they fixed?

    @gurpreet.

    sapscript-Formpages will include pages of annex too, which needs to be subtracted from total pages.

    кu03B1ятu03B9к

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 22, 2009 at 11:02 AM

    You can do this programitically do this...

    1) Say you have 500 records to print:
      You set to print 100 records in a page.
     Total pages will be 500 DIV 100  = Five total pages.
    
    2) Yo can set counter in you Form Using :
    If &Counter& > 100
    &page& / &Total Pages&                   "  Write this in the windows you want to print before new page.
    New-Page
    Initialize counter
    endif.
    

    Regards,

    Gurpreet

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 23, 2009 at 09:51 AM

    hi Nikil,

    you can do one thing, Create that Annexure as a separate form. Now call the both forms in

    in one spool request.I guess this will solve the problem.

    Regards,

    jayaram

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 23, 2009 at 11:33 AM

    why cant design annexure as a separate form and create a single spool for both?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 23, 2009 at 12:31 PM

    Hi,

    In PAGE you have a setting page counter

    this has 3 settings: Iniitalize coubter

    Increase counter (default)

    Leave counter unchanged.

    I never tried it your way. Maybe it works.

    Gr., Frank

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 25, 2009 at 08:56 AM

    Hi Nikhil..

    You can do the following..

    I think you are printing Page Numbers in a separate window.. If thats the case, then you can define this window as a late window by writing the following peice of code in a dummy window:

    a. Create a dummy window "CALL_LATEWINDOW" and in the program lines write below piece of code:

    data: l_subrc type sy-subrc.

    perform set_late_window in program saplstxbc using 'PAGE_NUMBER'

    changing l_subrc.

    Here PAGE_NUMBER is the window where u print the page numbers.

    The advantage of using the late window is that it will be processed at the end.

    b. Now in the main window of Pages "First" "Second" you can write a code to get the number of pages when ever there is a page break into a variable. Now use this variable in the PAGE_NUMBER window.

    Hope this solves your issue.

    Best Regards,

    Pradeep.

    Add comment
    10|10000 characters needed characters exceeded