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

Page sequence in SapScript form

fisher_li
Participant
0 Likes
1,875

Our customized PO SapScript form was a copy of SAP standard form MEDRUCK.

The page sequence is First -> Next, Next -> Next.

The sequences of next->next is necessary because of the possibility of multiple pages per PO.

I tried to add a new page and want to print this new page at the end of "Next" loop. It seemed to me that SapScript won't recognize my new page and the new page won't print.

How can I tell "Next" page to go to my new page at the end of its looping?

Your advise is appreciated!

1 ACCEPTED SOLUTION
Read only

former_member182371
Active Contributor
0 Likes
1,445

Hi,

if you declare a MAIN window in pages FIRST and NEXT when the line items printed overflow page FIRST it will automatically continue in page NEXT.

Best regards.

11 REPLIES 11
Read only

former_member182371
Active Contributor
0 Likes
1,446

Hi,

if you declare a MAIN window in pages FIRST and NEXT when the line items printed overflow page FIRST it will automatically continue in page NEXT.

Best regards.

Read only

former_member182371
Active Contributor
0 Likes
1,445

Hi,

just make sure that when you declare page <u>FIRST</u> in tab "<b>Standard Attributes</b>" you have the following values:

page = INIT

next page = NEXT

and for page <u>NEXT</u>:

page = NEXT

next page = NEXT

Regards.

Read only

former_member182371
Active Contributor
0 Likes
1,445

Hi,

if you want to force a page-break you have to declare the following FM in the right place of your print program:

CALL FUNCTION 'CONTROL_FORM'

EXPORTING

COMMAND = 'NEW-PAGE'

EXCEPTIONS

UNOPENED = 1

UNSTARTED = 2

OTHERS = 3.

Regards.

Read only

Former Member
0 Likes
1,445

Hi ,

Use FM START_FORM & END_FORM to trigger that page after the next page.

Read only

fisher_li
Participant
0 Likes
1,445

Big thanks to everyone for answering my question!

I may not make myself clear, so let me reframe my question and condition:

I would like to define a new page in our customized PO form and print this new page after a looping page whose name is “Next”. It seemed to me that the SapScript form will not print the new page after a looping page without changing the print program which is a standard SAP program.

Is there any way to print the new page after a looping page without changing the print program? Is that possible to add a new page to a SapScript form which is a copy of MEDRUCK, which has “First” page and “Next” page, and print this new page after page “Next”? Can I achieve this from just modifying SapScript form but no change the print program?

Besr regards,

Fisher Li

Read only

Former Member
0 Likes
1,445

I feel it is not possible without making any changes in print program. If you need to just add this code to print last page, better to copy in a Z program. Make the settings in Customizing and add the change.

Read only

Former Member
0 Likes
1,445

Hi Fisher,

In the layout page 'NEXT'.You can put a condition

/: IF &PAGE& EQ &SAPSCRIPT-FORMPAGES(C)&

/: NEW-PAGE LAST

/: ENDIF.

LAST is your last page to be printed after NEXT page.

Read only

Former Member
0 Likes
1,445

create a page NPAGE and then make the settings,ie,

for page NEXT : next page - > NPAGE.

for page NPAGE: next page - > NPAGE.

Hope it helps,

Regards,

Bikash

Read only

Former Member
0 Likes
1,445

Hi Fisher

If you want to print another page after NEXT page, you have to use NEW-PAGE statament.

You have only two way to do that:

- In program (but you don't want to change it)

- In Sapscript

In the last way you can only insert the NEW-PAGE statament in the MAIN windows of the NEXT PAGE.

So you should insert that statament in the last text element you have to print.

Infact NEW-PAGE command should be the last command you have to do in the NEXT-PAGE.

This can be a problem for you because if all text elements of MAIN are printed several times.

Anyway insert in the main

NEW-PAGE <PAGE>.

Where <PAGE> is the name of the new page you've created.

You can try to check the system symbol &NEXTPAGE& to know when it's on last page

Max

Read only

former_member182371
Active Contributor
0 Likes
1,445

Hi Fisher,

the only solution i see for your problem is to copy your print program to a Z and then within this Z add the necessary code to print an additional page.

someone in the former posts has indicated the use of variable LASTPAGE which is very useful in this case.

Best Regards.

Read only

fisher_li
Participant
0 Likes
1,445

Thanks again for everyone's help on this topic!

I made a quick trial on the ideas from Phani Kiran Nudurupati and Max Bianchi. Even it didn't work but I really like the recommendation and will try it later with some twist. Thanks again!