cancel
Showing results for 
Search instead for 
Did you mean: 

SAPScript Page number, problem

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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к

Former Member
0 Kudos

The pages for annex are dynamic, not fixed. Hence subtraction from SAPScript-formpages wont help.

Regards,

Nikhil

Former Member
0 Kudos

Not sure how this going to be achieved in scripts.

In smartforms this can be done using a final window.

Former Member
0 Kudos

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