cancel
Showing results for 
Search instead for 
Did you mean: 

Why the statement: "IF SFSY-PAGE EQ SFSY-FORMPAGES" do not work?

Former Member
0 Kudos

Hi gurus,

I want to check if the current page is the last page and use this statement in Code Node:

IF SFSY-PAGE EQ SFSY-FORMPAGES.

V_G_SHOW = 'X'.

ELSE.

But when I try to debug this part of code, I find SFSY-PAGE and SFSY-FORMPAGES always have same value.

Why?

thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Donghai Liang

Its not possible to handle IF SFSY-PAGE EQ SFSY-FORMPAGES. But if u want to do some thing at the end ( on the last page or after the last page) put your code after the loop in main window. So that it works after printing of all the table entries. That means on the last page. If u still want to trigger another page there u can trigger using command line for new page.

Reward if useful.

Venkat

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Check the window type if it is Secondary change to Final window

raymond_giuseppi
Active Contributor
0 Kudos

Smartforms evaluate &SFSY-FORMPAGES& during the execution of the form.

If you want to know the final number of pages, you have to execute the Windows at the end of the form. Look at OSS [Note 588352 - '*' when you output the total number of pages |https://service.sap.com/sap/support/notes/588352] so the window will be "late" executed and the data of &SFSY-FORMPAGES& and &SFSY-PAGE& may be different. (the note relates to "final" window)

Regards

Former Member
0 Kudos

Hi,

control commands will work only in SAP scripts. Even though they will not give any syntax errors in smart forms, They will not work. You write the code in the program lines node. Create the node program lines where ever you want and in that you have to write the code.

Reward.

Former Member
0 Kudos

Hi,

After processing all the elements inside the page,it will decide the page no.so it is not possible to use these system variables directly inside the page elements.Instead you can use the conditions ie. And Additional Events like only on first page etc..under conditions tab

Former Member
0 Kudos

But If I put this following code into TEXT NODE, It work well

Page: &SFSY-PAGE& / &SFSY-FORMPAGES&

For example it will output:

1, "Page 1 / 3"

2, "Page 2 / 3"

3, "Page 3 / 3"

Why?

Former Member
0 Kudos

After processing all the elements ,it will start printing the data from text node and only at the time of printing it will decide the exact values for the these system variables.

Reward points if helpful.

Former Member
0 Kudos

Dear Jm, thanks a lot,

But could you please help how can I get the two value in CODE NODE:

1, total pages

2, current page

Former Member
0 Kudos

Hi,

Getting total pages and current pages inside CODE is not possible using system variables like sfsy-page and sfsy-formpages,but this can be achieved using 'And Additional Events'.

First tell your requirement.then i will try to give a solution for that.

Former Member
0 Kudos

Thanks I am waiting fro your professional solution:)

Former Member
0 Kudos

Help?

Former Member
0 Kudos

Dear Jm, what is the 'And Additional Events'?