cancel
Showing results for 
Search instead for 
Did you mean: 

SAPScript - condition on pages for box.

Former Member
0 Kudos

hey guys,

I would like to ask on how to do i put a condition according to pages?

for example:

i would like to draw box on all pages but at the last page, i do not want to print the box.

the coding that i tried is this:


/:  IF &PAGES& NE &PAGE&
/:  BOX XPOS 0 MM YPOS 43 MM  FRAME 10 TW WIDTH 59 MM HEIGHT 216 MM
/:  ENDIF

but still, it print the box in all pages....

can anyone help me...!!!

thanks in advance!!!!

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

this statement is working


IF &NEXTPAGE& NE 0
BOX...
ENDIF.

but guys when i try to do for the lastpage i try to execute the dynamic box condition, (the coding below)


IF &NEXTPAGE& EQ 0
 BOX XPOS 0 MM WIDTH 0 MM HEIGHT 5 MM FRAME 20 TW
 BOX XPOS 59 MM WIDTH 0 MM HEIGHT 5 MM FRAME 20 TW
 BOX XPOS 84 MM WIDTH 0 MM HEIGHT 5 MM FRAME 20 TW
 BOX XPOS 107 MM WIDTH 0 MM HEIGHT 5 MM FRAME 20 TW
POSITION YORIGIN +5 MM
ENDIF.
,,&ilist-zname1&,,&ws1(R)&,,&ws2(R)&,,&ws3(R)&,,&ws4(R)&,,&ws5(R)&,,

it doesnt execute the box...

i also try this for the condition


IF &PAGE& EQ &SAPSCRIPT-FORMPAGES&
BOX
ENDIF

also doesn't working...

can u guys help me..

Thanks in advance.

Former Member
0 Kudos

Hi,

Try like below:

/: IF &PAGE(C)& EQ &SAPSCRIPT-FORMPAGES(C)& .

/: BOX.

/: ENDIF.

Hope it works!!

Rgds,

Pavan

Former Member
0 Kudos

Hi Bob,

The statement IF &nextpage& eq '0' doesnot work in the main window, this is because the main window will always have the next page number only variable window will contain the nextpage as '0' if there is no next page so this statement works in the variable window only.

The statement &PAGE& EQ &SAPSCRIPT-FORMPAGES& will also not work this is because the formpages will get generated only in the runtime for each page.

so take the box commands which you want to get printed in a seperate variable window and call the box commands like this

Ex: Variable window 3

IF &NEXTPAGE& EQ 0
 BOX XPOS 0 MM WIDTH 0 MM HEIGHT 5 MM FRAME 20 TW
 BOX XPOS 59 MM WIDTH 0 MM HEIGHT 5 MM FRAME 20 TW
 BOX XPOS 84 MM WIDTH 0 MM HEIGHT 5 MM FRAME 20 TW
 BOX XPOS 107 MM WIDTH 0 MM HEIGHT 5 MM FRAME 20 TW
POSITION YORIGIN +5 MM
ENDIF.

This will definitely work.

Thanks&Regards

Sarves

Former Member
0 Kudos

HI,

IF &NEXTPAGE& NE '0'.

BOX

ENDIF.

Former Member
0 Kudos

Hi,

try like below:

/: IF &NEXTPAGE& NE '0'

/: BOX....

/: ENDIF.

&NEXTPAGE& will always be 0 when it reaches to last page to print.

Hope it helps!!

Rgds,

Pavan

Former Member
0 Kudos

Hi!

You can try Writing the Condition as....

/: IF &PAGE& NE &SAPSCRIPT-FORMPAGES&

/: BOX XPOS 0 MM YPOS 43 MM FRAME 10 TW WIDTH 59 MM HEIGHT 216 MM

/: ENDIF

AND TRY...

Regards.

Former Member
0 Kudos

Hi,

Try with this if condition.

/: IF &SAPSCRIPT-FORMPAGES& NE &PAGE&
/: BOX XPOS 0 MM YPOS 43 MM  FRAME 10 TW WIDTH 59 MM HEIGHT 216 MM
/: ENDIF

or

when you want the box in all the pages then you might have taken it in the variable window.

so you can even give the condition

/: IF &NEXTPAGE& NE '0'
/: BOX XPOS 0 MM YPOS 43 MM  FRAME 10 TW WIDTH 59 MM HEIGHT 216 MM
/: ENDIF

Thanks&Regards

Sarves

Former Member
0 Kudos

Hi,

Try to debugg the code and check whether the value is getting passed to variable &Pages&

May there may not be any value in this variable.

Regards,

Prashant