cancel
Showing results for 
Search instead for 
Did you mean: 

Scripts: Terms and conditions in last page

Former Member
0 Kudos

Hi SDN's,

I need to print Terms and Conditions in lasp page of my script(Purchase Order) form.

Here i am using Standard print program and Z_Medruck script form. Please tell me how to get print Terms and Conditions in Last page of the form.

If form contains only one page, then T&C should print in 2nd page. If form contains two pages, then T&C should print in 3rd page. etc..

In my script form i have FIRST and NEXT Page only.

I have created last page. and put the following logic at the last in main window:

/: IF &NEXTPAGE(C)& = '0'

/: NEW-PAGE LAST

/: ENDIF

In LAST page i have created one page window, in that i mentioned some text like T&C.

But the form is not printing T&C.

How to get it print. Is there anything i left here. Please let me know.

Can anyone help me...

Thanks in advance..

Regards,

Rahul

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hiii

create one footer on 2nd page

there u can create ur T&C

reward points if useful

regards

Jaipal

Former Member
0 Kudos

Hi Rahul,

It seems that in Main Window the value in &NEXTPAGE& is not 0.

This is in SAP help of SAP Scripts...

Page Number of the Next Page

&NEXTPAGE&

This symbol is used to print the number of the following page. The output format is the same as with &PAGE& .

Note that on the last page of the output, in each window that is not of type MAIN, &NEXTPAGE& has the value 0.

http://help.sap.com/saphelp_nw04/helpdata/en/d1/803382454211d189710000e8322d00/frameset.htm

Add a new window of type 'VAR' in the first page itself and specify your IF control command over there

/: IF &NEXTPAGE(C)& = '0'

/: NEW-PAGE LAST

/: ENDIF

Regards,

Bharat.

Former Member
0 Kudos

Hi Bharat,

I tried like that, but it is not displaying... Any thing else i have to do apart from that? Or any other method we have to use to get it printed?

thanks

Rahul

Former Member
0 Kudos

Hi Rahul,

I am sorry that somehow I missed the main issue i.e. printing terms and conditions on a fresh page after all the items have been printed This fresh page should be the last page of your print request.

The problem with what we are trying to do is... if &NEXT-PAGE& is ZERO then this means that it is the LAST page of this output. We are already on the last page(as per the system) and trying to print an extra page which is not logically right. This might be the reason why we are unable to print the extra page.

One way to get the output as you mentioned is by chaning the print program. I am not sure whether you like it or not...But it is as follows...

You should have two SAP Scripts.

1) Z_Medruck which will print the PO. then

2) Z_XXXXXXX which will contain Terms and Conditions in the MAIN window.

Then your print program should look like this...

Starts current output

CALL FUNCTION 'OPEN_FORM'.

Opens form Z_MEDRUCK

CALL FUNCTION 'START_FORM'

EXPORTING

FORM = 'Z_MEDRUCK'.

PRINT PO

LOOP AT IT_ITEMS.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

WINDOW = 'MAIN'.

ENDLOOP.

End Z_MEDRUCK

CALL FUNCTION 'END_FORM'.

Opens form Z_XXXXXXX

CALL FUNCTION 'START_FORM'

EXPORTING

FORM = 'Z_XXXXXXX'.

Print TERMS AND CONDITIONS

CALL FUNCTION 'WRITE_FORM'

EXPORTING

WINDOW = 'MAIN'.

End Z_XXXXXXX

CALL FUNCTION 'END_FORM'.

Closes Current Output

CALL FUNCTION 'CLOSE_FORM'.

Regards,

Bharat.