cancel
Showing results for 
Search instead for 
Did you mean: 

Page number - in program lines - smartforms

Former Member
0 Kudos

Hi ,

In my smartform, I am printing page numbers on my pages using &SFSY-PAGE& of &SFSY-FORMPAGES(3CZ)&. But I want to print some other data in my window depending on the page number. So I am using the following code in my program lines.


l_page = sfsy-page.
l_totpages = sfsy-formpages.

But the problem that I am facing here is that they both have same values in the program lines.

I am giving the following on the conditions tab of the 2 texts, that I am using.


First Text: l_page = totpages. "To be printed on the last page only
Second Text: l_page ne l_totpages "To be printed on other pages

The second text is never printed. But the page numbers are printed correctly.

Regards,

Abdullah

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

the window I was using was a secondary window. I changed it to final window.

Former Member
0 Kudos

Hi,

try using the system variables only instead of temporary variables

IF &SFSY-PAGE& NE &SFSY-FORMPAGES(3CZ)&.

Second text :

ENDIF.

Former Member
0 Kudos

I tried both the ways.

For the first page the values of sfsy-page and sfsy-formpages = 1.

For the second page the values of sfsy-page and sfsy-formpages = 2.

For the third page the values of sfsy-page and sfsy-formpages = 3.

This happens in the program lines. But if I write the same in the text editor, I am getting the correct values being output.