SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software
Development resources, articles, tutorials, code samples, tools and downloads for SAP HANA and ABAP, HANA Database, SQLScript, SAP UI5, Screen Personas, Web Dynpro, Workflow

SAP Smartform Current Page Number using SFSY-PAGE and Page Numbering using Page Counter

SAP Smartform developers frequently require to place page numbers on the Smartform document.
But as far as I follow SAP Smartforms and ABAP forums, I see that many ABAP developers fail to display page numbers correctly.
You can find many ABAP forum posts complaining the SFSY-PAGE does not show the correct page number or does not work in SAP Smart Form.
There are many suggested solutions like using Final Window type, Secondary Windows type, using a global variable as a custom page counter method, etc. But the solution is not so difficult.

In a SAP Smart Forms document page numbering is managed by page counters.
Page counter are responsible from updating the SFSY system fields SFSY-PAGE, SFSY-FORMPAGES, SFSY-JOBPAGE which are related with page numbers.

System field SFSY-PAGE is used for page numbering of current page. This is the system field that keeps page number of current page.

System field SFSY-FORMPAGES shows the total number of pages in a SAP Smartform document.

System field SFSY-JOBPAGE shows the total number of pages in all SAP Smartform documents within the same print job.

Although using SFSY-PAGE system field for current page number on a Smartform is not false but it is not sufficient.
In fact, page numbers in Smartform are handled by Page Counter property of a page window.
Many SAP Smartforms developers fail to realize Page Counter mode property of pages defined within Smartform document.

If you double click on a page window from the left side of the SAP Smartform document design layout, the page properties screen will be displayed.
SAP Smartforms developers will see the General Attributes of the page by default.
You can easily realize the Page Counter section which is especially related with page numbering in Smartform and display format of page numbers in Smartform.


The Page Counter format is not very critical in our case. But if you are looking for a solution for Smartforms page numbering problem, then probably you have not adjusted the SAP Smartforms Page Counter Mode attribute option.

SAP Smartform Page Counter Mode has four options :

Initialize Counter mode which is set by default and causing complaining of SFSY-PAGE does not show correct page number on Smartform document. Initialize counter mode resets the Smartform page counter everytime causing the SFSY-PAGE equal to 1.

Increase Counter mode which gives the solution Smartform developers are seeking for. This option will increase the SFSY-PAGE parameter by 1 with each new page in SAP Smartforms documents.

Leave Counter Unchanged mode will not increase page counter in Smartform document,

Page and Overall Page Unchanged mode keeps all page counter data unchanged like current page SFSY-PAGE and total pages SFSY-FORMPAGES values.

So in order to display page number in Smartform SAP output documents correctly, adjust the Page Counter mode to Increase Counter in the page window General Attributes properties screen.

If your Smart Form page numbering problem is with displaying total number of pages like "*" in SFSY-FORMPAGES, please refer to Smartforms System Field &SFSY-JOBPAGES& - Total Number of Pages on a SmartForm document for more information on solution.


Install SAP Free
CRM Companies List
Web Based CRM Software

Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.