Skip to Content
May 09, 2013 at 06:31 AM

SAP Script: Print total number of pages while printing multiple documents.


Hi All,

We have a requirement to print multiple shipment documents using SAP Script. In print output, page count should come like ' Page 1 of Page n'.

Where n is the total number of form pages.

Lets take an example, we have two shipment document and both of them are having total page count as 2 and 3. When we take a print preview, we get the print output for total page count as 5.

So for first shipment document page count is displayed as 'Page 1 of Page 5, Page 2 of Page5. And second shipment document page count is coming as 'Page 1 of Page 5' , 'Page 2 of Page 5' and 'Page 3 of Page 5'.

here total page count is coming as grand total pages of sap script while we only want to print document wise page count. Out output should be like 'Page 1 of Page 2' , 'Page 2 of Page 2' for first shipment document and for second shipment document it should be like 'Page 1 of Page 3', 'Page 2 of Page 3' and 'Page 3 of Page 3'.

For printing page count i am doing as &PAGE& of &SAPSCRIPT-FORMPAGES&.

Please suggest, how to achieve total number of pages as per this requirement.

your suggestion will be highly appreciated.