cancel
Showing results for 
Search instead for 
Did you mean: 

script

Former Member
0 Kudos

i need to draw based on this condition

in main window i had written this code

IF &PAGE& EQ 1.

IF &PAGE& = &SAPSCRIPT-FORMPAGES(C)&.

BOX XPOS '0'CM YPOS '0'CM HEIGHT '4'CM WIDTH '17.40'CM FRAME 10 TW

&ITAB-POSNR&,,&ITAB-MATNR&,,&ITAB-FKIMG&,,&ITAB-VRKME&,,&ITAB-NETWR&

ELSE

BOX XPOS '0' CM YPOS '0'CM HEIGHT '7.30'CM WIDTH '17.40'CM FRAME 10 TW

&ITAB-POSNR&,,&ITAB-MATNR&,,&ITAB-FKIMG&,,&ITAB-VRKME&,,&ITAB-NETWR&

ENDIF.

ENDIF.

IF &PAGE& NE 1.

IF &PAGE& = &SAPSCRIPT-FORMPAGES(C)&.

BOX XPOS '0' CM YPOS '0'CM HEIGHT '12'CM WIDTH '17.40' CM FRAME 10 TW.

&ITAB-POSNR&,,&ITAB-MATNR&,,&ITAB-FKIMG&,,&ITAB-VRKME&,,&ITAB-NETWR&

ELSE.

BOX XPOS '0' CM YPOS '0'CM HEIGHT '16.80'CM WIDTH '17.40'CM FRAME 10 TW

&ITAB-POSNR&,,&ITAB-MATNR&,,&ITAB-FKIMG&,,&ITAB-VRKME&,,&ITAB-NETWR&

ENDIF.

ENDIF

but when i debug

&sapscript-formpages& value always coming current page number that is value of &page&

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Answers (3)

Answers (3)

Former Member
0 Kudos

hi amit

i defined one dummy window header which is type variable in that

DEFINE &VAL& = &SAPSCRIPT-FORMPAGES(C)&

but when i debug it starting debugging from main window

val = ' '

moreover it giving same value even in variable window

val = 1 in first page var =2 in second page.

help me in this regard

Former Member
0 Kudos

i am checking this condition in main window

if cant check this condition then how to draw the box.

based on this condition

former_member181995
Active Contributor
0 Kudos

Sunil,

system always count total no of pages in final window type.

you must pick the total number of pages from final window type and store it in some variable and use this in main window.

you can use perform routine to store the total no of pages.

Amit.

former_member181995
Active Contributor
0 Kudos
but when i debug 
&sapscript-formpages& value always coming current page number that is value of &page&

What is the window type where you wnat to see total no of pages?

remember it should window type final.

check it.

Amit.