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: 

Query on SAP Script

Former Member
0 Kudos
292

Hi All,

I have a requirement to print certain number of pages in a SAP script based on some conditions? The script has total of four pages. Based on certain conditions i want to print only two of them.

I had put a check in the text elements for the script but it prints blank pages.

Any pointers to this will be highly appreciated?

Thanks and Regards,

Nilesh.

5 REPLIES 5

Former Member
0 Kudos
258

Nilesh,

Please remove the check statement and try this:

/: IF &SAPSCRIPT-FORMPAGES(C)& = 1 or 2 or 3 or 4 etc (the pages you do not want to print)

/* *** Statement

/: ELSEIF

/* ****

/: ENDIF

Blacky.

Former Member
0 Kudos
258

hi,

Use the START_FORM function module in your report program, to call a certain page of a script.

Secondly, while using this start form don't forget to use the counter function module i.e END_FORM while you call the next start_form based on the condition else it results in unwanted behavior.

Regards

Sharath

former_member585060
Active Contributor
0 Kudos
258

Hi,

Create only 2 pages,

Assign First page next page Second

Second page next page Second

All the remaining contents of the 3 and 4 page on second page only

Just use the Text elements of the 3 and 4 page in the IF and ENDIF, means to get printed only when condition satisfied.

Just review any standard sapscript MEDRUCK which uses one sapscript to print PO, RFQ, etc

how the IF and ENDIF conditions are used for the Text elements.

Regards

Bala Krishna

Former Member

Former Member
0 Kudos
258

first u fecth all data in OTF then in otf loop u can put conditon and then print