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

Skipping pages on SAPSCRIPT

Former Member
0 Likes
1,280

Greetings all,

I have the following situation:

I have a SAPSCRIPT with the following page flow:

HEADER1->HEADER2

HEADER2->HEADER3

HEADER3->FIRST

FIRST->NEXT

NEXT->NEXT

Header1, Header2 and Header3 Pages are Terms and Condition, however they can't be shown when a certain variable has value '5', so i want to skip then, if condition is true.

What i was trying to do was:

(Inside HEADER1)

IF &variable& = '5'.

&NEXTPAGE& = 4 (4 = FIRST PAGE)

NEW-PAGE

ENDIF.

But that didn't give me any results,

PS: The printing program is Standard, so all i can change is inside the ZSAPSCRIPT.

Thank you all for your attention,

Best Regards,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,118

Hi Jonathan.

When filling the output_parameters, try to set the tdpageslct = '4-'. It will begin the print from page 4.

Greetings all,

I have the following situation:

I have a SAPSCRIPT with the following page flow:

HEADER1->HEADER2

HEADER2->HEADER3

HEADER3->FIRST

FIRST->NEXT

NEXT->NEXT

Header1, Header2 and Header3 Pages are Terms and Condition, however they can't be shown when a certain variable has value '5', so i want to skip then, if condition is true.

What i was trying to do was:

(Inside HEADER1)

IF &variable& = '5'.

&NEXTPAGE& = 4 (4 = FIRST PAGE)

NEW-PAGE

ENDIF.

But that didn't give me any results,

PS: The printing program is Standard, so all i can change is inside the ZSAPSCRIPT.

Thank you all for your attention,

Best Regards,

4 REPLIES 4
Read only

Former Member
0 Likes
1,119

Hi Jonathan.

When filling the output_parameters, try to set the tdpageslct = '4-'. It will begin the print from page 4.

Read only

0 Likes
1,118

Hello Heber,

Thank you for your answer, however i believe i can only change this output_parameters when calling the Sapscript  from the Printing Program... But as i already mentioned, the printing program is Standard, so i can not do any changes to it. Am i right ?

Best Regards,

Read only

0 Likes
1,118

Jonathan, you're right, except if you can implement an enhancement in the standard caller code.

Before that, check the link below and try to specify your next page directly in the NEW-PAGE statement.

http://help.sap.com/saphelp_40b/helpdata/pt/d1/8031a9454211d189710000e8322d00/content.htm

[]'s,

Heber

Read only

0 Likes
1,118

Thank you very much Fabiano,

I was able to implement an enhancement point on the printing program, that would allow me to change the initial page if my condition was true,

For the record: To call a SAPSCRIPT Form, you must call function OPEN_FORM which has a parameter called OPTIONS  of Structure ITCPO, so all i had to do was an enhancement to change the field TDPAGESLCT to 4, if my condition was true.

Thank you for your attention,

Best regards,