cancel
Showing results for 
Search instead for 
Did you mean: 

smart forms

Former Member
0 Kudos

hi,

how to calculate page by total in smart form.

Accepted Solutions (1)

Accepted Solutions (1)

sharadendu_agrawal
Active Participant
0 Kudos

If u want to write somthing like page x 0f y then u can write as &sfsy-page& of &sfsy-formpages&. At the end of the smartform when its about to print the SAP system updates the value of sfsy-formpages field and u get the proper output.

Answers (3)

Answers (3)

sharadendu_agrawal
Active Participant
0 Kudos

There is no way to calculate the total number of pages in a smartform. There is a structure called as SFSY. This structure has two fields namely page and formpages.

Page by definition means the current page in the smartform and formpages by definition means the total number of pages to be printed in the smartform. But the problem occurs at runtime.

At runtime the value of the sfsy-page and sfsy-formpages is the same and is equal to the current page number of the smartform. Its only at the end when the SAP system is about to print the smartform that the values of the above two fields are updated.

So there is no way to know the number of pages in the smartform. At the max what u can do is check for the page where the main window printing gets over and u can get the number of pages from this value.

Reward if useful.

Cheers,

Sharadendu

Former Member
0 Kudos
Former Member
0 Kudos

I hope you want to dispaly total number of pages in samrt form.

In this case you can use systen fields as follows:

&SFSY-FORMPAGES& Displays the total number of pages for the currently processed form. This allows you to include texts such as

‘Page x of y’ into your output.

&SFSY-JOBPAGES& Contains the total page number of all forms in the currently processed print request.