cancel
Showing results for 
Search instead for 
Did you mean: 

saving Purchase order as PDF

Former Member
0 Kudos

Hello all,

we would like to save our purchase orders as pdf file on the pc. We use SAPscript to create the POs.

I have already searched the forums, but I didn't find a solution for me so far.

I don't wanna use the way over the spool requests and the program RSTXPDFT4, because the end users don't have access to that.

My question is, do I have to create a new output type for that? How does that work? Or what else do I have to do (step by step)?

Thank you,

Anne

Message was edited by:

Anne Jannasch

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Anne,


*PO to PDF to string
************************************

  CALL FUNCTION 'ECP_PDF_DISPLAY'
    EXPORTING
      purchase_order       = p_ebeln
   IMPORTING
*   PDF_BYTECOUNT        =
     pdf                  = file
            .
************************************
*Converting Xstring to binary_tab
************************************
  CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
    EXPORTING
      buffer                = file
*   APPEND_TO_TABLE       = ' '
* IMPORTING
*   OUTPUT_LENGTH         =
    TABLES
      binary_tab            = int_tab1
            .
****************************************
**Downloading into PDF file
****************************************
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
*   BIN_FILESIZE                    =
      filename                        = 'D:RDsample1.pdf'
      filetype                        = 'BIN'
     TABLES
      data_tab                        = int_tab1

With the help of above code and triggering user exit while saving PO , you are able to get PO PDF into PC.

Just try it.

Regards,

Madhu

Former Member
0 Kudos

Hi Madhu,

thanks for your answer.

One more question: How can I trigger user exit while saving PO?

Thank you

Anne

former_member196280
Active Contributor
0 Kudos

Check this programs, it will help you in closing your issue

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/49e15474-0e01-0010-9cba-e62df8244556">Example 1</a>

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/90165b39-306b-2910-04b1-e3271ff1642f">EXAMPLE 2</a>

Regards,

SaiRam