Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP Scripts - Page number Error !!!

deepan_v_s
Active Participant
0 Likes
1,695


Hi All,

I have a script in which Windows are displayed dynmically based on the Page number. i.e; if the page number ( &PAGE& ) is Less than 3 one widdow should be displayed and if the Page number ( &PAGE& ) is greater 3 another window should be displayed.

It is working fine if the output of the script is Less than or Equal to 9. If the output is more than 10 pages wrong window is displayed (say First window is displayed instead of second). I have tried,

if &PAGE& (2ZC) < 3 , i even a perform which takes Page as the parameter and changes it to type I and passed it to a local variable and checking the condition based on the local variable that too didn't work.

Is it a standarf error ???

Can anyone Plz help me with a hint or solution to this problem.

Thanx....

11 REPLIES 11
Read only

custodio_deoliveira
Active Contributor
0 Likes
1,626

Hi Deepan,

I'm a bit rusty on SAPscript stuff, but I think you should try:

&PAGE(C)& < 3


Cheers,


Custodio

Read only

0 Likes
1,626

I tried all possible combinations wit &PAGE& .. i did not help

Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
1,626

Hi Deepan

When you check in debugging are you getting correct page number?

Nabheet

Read only

0 Likes
1,626

Yeah while checking in Debugging i am getting the exact page number .. i.e,. 10

Read only

Former Member
0 Likes
1,626

Hi,

First just check what value &PAGE& prints on the Script.Try putting [Page &PAGE& from &SAPSCRIPT-FORMPAGES(3ZC)&]. See the what value is displayed as current page number.

Regards

Abhi

Read only

0 Likes
1,626

My page contains displaying the page number on it.. It displays the correct page number as 10 .. But if 10 > 3 should be true , but it returns false


Read only

0 Likes
1,626

I would suggest you to switch on Script debugging and check

Nabheet

Read only

0 Likes
1,626

I have debugged it, but in debugging mode its showing the correct value

Read only

0 Likes
1,626

Can you please attach your SAP script code screen shot. Secondly when you use perform subroutine call you can set back the flag if FLag eq 'X' then do 1 else 2.  Was the flag value flowing back to the script

Nabheet

Read only

0 Likes
1,626

Actually i tried checking the page number in the script , but it did not work so i created a flag if a condition is true and checked the flag in the program.

I did get the exact output which i wanted but i did not follw the guidelines ....

Read only

dibyajeeban_jena
Active Participant
0 Likes
1,626

Do the following...

  PERFORM convert_no   IN PROGRAM   (any Z-Prog)

   USING          &SAPSCRIPT-FORMPAGES&

   CHANGING  &SET_FLAG&

   ENDPERFORM.

IN  Z-PROG  program set the  FLAG if its GT 3 .

Then , put the condition for the windows .

Regards