cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Script : Dynamic Page

Former Member
0 Kudos

Hi Experts,

I have a SAP Script which is having 2 page layout.This SAP Script is linked with one purchase order output type.

And those two pages will be printed always whenever we will print the SAP Script through that output type.

Now i have requirement that, i have to print some additional information based upon the type of the material in the PO. Now instead of disturbing the already set 2 page layout, i want to add a new ( thrid ) page in the output which will have the addtional information.

But as i want that third page to come only when the material is of some particular type, so i want to know whether we can put some dynamic check/condition on page of the script in order to get it printed only when my material type is coming in the PO ( otherwise only two page output ). If it is possible, please let me know how to do the same.

Thanks.

Regards

Charitha Kolla

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks

Former Member
0 Kudos

Hi,

U can use the CONTROL_FORM Function Module in the driver program to call the thrid page based on Material type.

IF itab-mtart = 'FERT'.

CALL FUNCTION 'CONTROL_FORM'

command = 'NEW-PAGE PAGE3'.

ENDFUNCTION.

Hope it helps!!

Rgds,

Pavan

Former Member
0 Kudos

hi

There are several ways to build this functionality.

You can add an item in your main

with

/E START_PAGE3

/: NEW-PAGE PAGE3

in your print program you can call then the usual write_form with item START_PAGE3.

after that you can print the items you want to print on page 3.

Another way is to call page3 directly in yout print program

with

CALL FUNCTION 'CONTROL_FORM'

command = 'NEW-PAGE PAGE3'.

I normally use solution 1 because i look first in the sapscript with problems.

but solution 2 is also a very good one.

The decision is yours.

Gr., frank

Former Member
0 Kudos

Hi,

Based on the condtion you can trigger a new page in the script itself with keyword NEW-PAGE.

If your condition satisfies then call this statement.

/: NEW-PAGE

Former Member
0 Kudos

Hi,

Yes, You can check the condition in SAP SCRIPT by passing the delivery type to it, at the end of the second page just give the condition and add the third page with the required information

Example

/: IF &DELIVERYTYPE& = 'LF'
/: NEW-PAGE THIRD
/: ENDIF

or you can use CONTROL_FORM function module in the driver program to trigger the new third page by checking the delivery type in the SAP Program itself page

Regards

Sarves

Edited by: Sarves Sombhatla on Jul 20, 2009 3:33 PM