Skip to Content
author's profile photo Former Member
Former Member

Print Purchase Order Document

Hi,

is there a function, that lets you print a purchase order from the system, if not , what would the best way of doing this be?

I did try

Function 'ME_DISPLAY_PURCHASE_DOCUMENT'

which works , I belive , if the document has been printed before, but not if it has not, am I correct?

Once printed I need the spool no.

Thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Nov 28, 2005 at 05:17 PM

    Create a Z Function module using the code below.

    One import parameter for PO num say I_PO.

    You can have few exceptions.

    Declare NAST Table in the global data of the function group.

    Replace 'XXXX' with proper values.

    clear nast.

    • Raise exception if there is no delivery no.

    IF I_PO IS INITIAL.

    RAISE Exception.

    ENDIF.

    • Fill in the NAST header line for this label.

    CLEAR NAST.

    NAST-OBJKY = I_PO.

    NAST-LDEST = 'XXXX'.

    NAST-SPRAS = 'EN'.

    NAST-TDSPRAS = 'EN'.

    NAST-DIMME = 'X'. " Print Immediate' flag

    NAST-DELET = 'X'. " Release after print'

    NAST-ANZAL = 1. " Specify one copy

    NAST-NACHA = 1. " output to printer

    NAST-VSZTP = 4.

    NAST-KAPPL = 'XXXX'.

    NAST-KSCHL = 'XXXX'.

    NAST-EDIKEY = 0.

    NAST-MANUE = 'X'.

    NAST-VSTAT = '0'. " set status = not yet processed

    NAST-ERUHR = SY-UZEIT.

    NAST-ERDAT = SY-DATUM.

    NAST-USNAM = SY-UNAME.

    • Insert entry into NAST

    INSERT NAST.

    COMMIT WORK AND WAIT.

    • Call sap STANDARD routines to process the message request

    LW_SUBRC = 999.

    PERFORM EINZELNACHRICHT(RSNAST00)

    USING LW_SUBRC.

    IF LW_SUBRC <> 0.

    RAISE Exception.

    ENDIF.

    Thanks,

    Rajesh.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.