Skip to Content
avatar image
Former Member

Printing Terms and Conditions on last page of PO

Hello SAP Gurus,

I need to print Terms and Conditions on the last page of my script (Purchase Order) form.

Here i am using a Z Script (ZMM_PURCH_ORD) to print PO. 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 gone through this forum searching for solutions to a similar issue and have implemented the following with limited success:

In the existing form, I created a new page called TNC and inserted the text of TNC in a window element of this page. I then tried calling this new page form the existing pages using the command NEW-PAGE TNC. But this does not work.

I also created a separate form altogether called ZMM_PO_TNC which just has the TNC page. I called this form after printing the the original form. This solution is working fine while the PO is being printed, but we have an additional requirement here that when the PO is selected for external send i.e. medium = 5 then the PO goes to the vendor in an PDF format. When I use 2 forms, 2 such mails are sent with a PDF each for the actual PO and the TnC. This is not acceptable. Ideally in one PDF only the entire PO as well as the terms and conditions should be sent in one mail.

Pl note that the terms and conditions extend upto 2-3 pages so I cannot insert them in the existing pages of the PO i.e. FIRST page and NEXT page due to space shortage. (if any of you know how this can be done pl let me know)

Please help me find a solution for this.

Thanks in advance..

Regards,

Huzefa Vasi

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Feb 06, 2008 at 05:47 AM

    Hi ,

    You can do it by this way. Before printing conditions check the condition IF &NEXTPAGE& = '0'. This condition checks if no next page is there it will print conditions on last page automatically.

    IF &NEXTPAGE& = '0'.

    print your data.

    ENDIF.

    Note this does not work in Main window

    For main window you have other option, set flag suppose

    Flag = 'Y'. after all your data has been printed and then

    put in main window

    if FLAG = 'Y'.

    conditions printinng logic

    endif.

    Hope this helps you,

    Reward if useful,

    Madhura

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Madhura,

      Thanks for your inputs.

      I have already tried the option of NEXTPAGE. This would have worked fine when the Terms and Conditions were of 2-3 lines. The issue is that TnC spans across 2-3 pages so I have to insert the text in a new page and within that in a new window.

      I cannot fit it in an existing page due to lack of space.

      So is there any way I can explicitly called the new page from one of the existing windows.

      I did try the command NEW-PAGE TNC but this works only in main window. I need to call from some other window.

      After trying out all such options of fitting the TnC on the same form, I opted for a second form. But with this, there is the problem of 2 PDF files being generated and like-wise 2 e-mails also being sent .. one for the PO and other for the TnC.

      Please help.

      Thank you,

      Regards,

      Huzefa Vasi

  • avatar image
    Former Member
    Feb 06, 2008 at 11:33 AM

    Hi,

    1.create a standard text in so10. In that you write all the terms and conditions.

    2. In the sap script text editor the syntax is

    /: if &page& = &sapscript-formpages&

    /: include <standard text name> object 'TEXT' id 'ST' language 'EN'

    /: endif.

    Hope it will be useful.

    kamala.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 06, 2008 at 11:45 AM

    Hi,

    In main window &next-page& eq 0. condition does not work .

    even &page& eq &formpages& may not work out not sure.So what you need to do is.

    In the print program

    just describe your internal table say lines v_lines

    and in the loop put one count varaible say v_count

    then in the script put condition as below.

    if v_count eq v_lines.

    /:NEW-PAGE pagename ( say last)

    endif.

    Reward points if useful.

    Regards,

    Nageswar

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 11, 2008 at 10:41 PM

    Hi

    I am also working on adding Terms and conditions page in the last page.

    added Last page created one window, but my last page is not ever triggring.

    Can you tell me what to do.

    Add comment
    10|10000 characters needed characters exceeded