‎2006 Aug 04 1:27 PM
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 ?
‎2006 Aug 04 1:33 PM
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
‎2006 Aug 04 1:33 PM
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
‎2006 Aug 04 1:37 PM
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?
‎2006 Aug 04 1:55 PM
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 ???
‎2006 Aug 04 1:47 PM
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
‎2006 Aug 04 4:00 PM
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.