cancel
Showing results for 
Search instead for 
Did you mean: 

SAPScript Insert New Page in between standard pages based on condition

Former Member
0 Kudos

Hi,

I need to implement Purchase Order(PO) Sapscript with pages that can be inserted between other pages depending on condition.

Standard PO:

PAGE1 (next page:NEXT)

NEXT: (MAIN window is found in NEXT page to print PO items)

New Requirement:

Insert PAGE2 between PAGE1 and NEXT if EKKO-EKORG='0002'

PAGE2 contains only some texts for buyer and vendor information, No item data(no MAIN window).

**

I tried using NEW-PAGE but it only seems to trigger at the page where the MAIN window is found.

I also used Function Module CONTROL_FORM at the Print Program to trigger 'NEW-PAGE PAGE2', but the result is the same, it triggers only at the page where the MAIN window is found, which resulted to an extra blank page before NEXT page is printed.

I will need some logic to insert PAGE2 if EKKO-EKORG='0002', whether in print program or in SAPScript.

Output should be: PAGE1->PAGE2->NEXT, else, it remains PAGE1->NEXT

Any help would be appreciated.

Thank You.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Another way would be to dynamically point PAGE1 either to NEXT or PAGE2(whose nextpage is NEXT).

Example:

PAGE1->dynamically point to:

->NEXT->NEXT

OR

->PAGE2->NEXT->NEXT (IF EKKO-EKORG='0002')

But still I have no clue where and how to implement this logic. Please suggest if you have any ideas.

Thanks!

aidaj_hilton
Participant
0 Kudos

What about creating the MAINwindow on the new page. You would have to create Elements (: /E) on the MAIN window to control what you want printed on the various pages.

Former Member
0 Kudos

Thanks Jill.

The MAIN window, which prints the Bill of material, has many vertical lines in it that aligns the different fields (eg. Qty, amount, etc). And these lines will just get in the way if we include the Vendor Agreement (which is 8 pages long of texts) in the MAIN window. What Im trying to do now is just to create a copy of the SAPScript and on the new copy, I inserted the vendor agreement texts. Then in the print program, I just added a condition to select the appropriate form.

Former Member
0 Kudos

Hi,

Kindly go through these links hope they will be helpful.

<<irrelevant link-farm removed by moderator>>

Edited by: kishan P on Dec 28, 2010 2:41 PM

Former Member
0 Kudos

Thanks vikash.

I have gone through these threads, but unfortunately I cannot relate these to my requirement.

Two of these are just putting condtions in the Page and the other triggering the last page using the MAIN window.

What I need is to insert a new page in between 2 existing pages already in sequence(PAGE1->NEXT), with no MAIN window to use for the NEW-PAGE command.