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

Change page format dynamically

Former Member
0 Likes
857

Is there any way in SAP Script that we can specify/change the format of the page dynamically , like before calling the Script functions or something like that ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
731

I doubt if this can be done.

Alternatively, you can call different layouts based on some condition, using start_form and end_form function modules.

open_form.

if cond1.

start_form. " layout1

close_form.

endif.

if cond2.

start_form. "layout 2

close_form.

endif.

close_form.

Regards,

ravi

5 REPLIES 5
Read only

Former Member
0 Likes
732

I doubt if this can be done.

Alternatively, you can call different layouts based on some condition, using start_form and end_form function modules.

open_form.

if cond1.

start_form. " layout1

close_form.

endif.

if cond2.

start_form. "layout 2

close_form.

endif.

close_form.

Regards,

ravi

Read only

0 Likes
731

Just to add to Ravi's comments you can't change the page size / orientation of a SAPScript dynamically because it's part of the Forms attributes.

Ravi's solution is the only practical way forward for you, but it does require maintaining multiple forms.

What is the business requirement which has lead to this question?

Read only

0 Likes
731

Hi ,

Thank you all . The requirement is that : for two companies codes the page format is A4 and for others it has to be Letter . I cant do smartforms , because this is Correspondence type set up(FI) which as per my awareness doesnt support smartforms .

So , Is this the only soultion : to create new forms and correspondence types for the two company codes ???

Read only

Former Member
0 Likes
731

Hi,

Ravi and Rossie were straight to the point. You cannot the change page attributes of a SAPSCRIPT layout dynamically, bcoz you need to maintain the same page format for the entire form.

But you can do this functionality using SMARTFORMS which can address your need. If your business need is that, migrate your SAPSCRIPT layout to smartforms. You can do that from tcode SMARTFORMS.

Regards

Read only

Former Member
0 Likes
731

HI,

If thats the case, you have no choices left but to maintain different layouts : one on A4 and the other on Letter.

You can use function modules START_FORM and END_FORM to initiate the respective layouts.

If you find something better,let us know..

Cheers.