cancel
Showing results for 
Search instead for 
Did you mean: 

P.O to PDF.

Former Member
0 Kudos

Dear All,

I am trying to convert PO output to PDF.

I am using the SAP stanadrd program "RSTXPDFT4" and executing the program with the spool request as the input.

This works fine.

But my client does not want this process as they have to find the spool request in SP02 which is always a tedious process.

Can anybody suggest me a workaround wherein the user just inputs the P.O number and the output can be downloaded in PDF.

If not can anybody suggest the table in which the spool request can be found for a particular purchasing document.

Best regards,

Prateksha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try using this both the function modules in ur program u can get pdf output

CONVERT_ABAPSPOOLJOB_2_PDF

CONVERT_OTFSPOOLJOB_2_PDF

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Vaid,

USE 2 FM

1. FM: CLOSE_FORM and 2. FM:SX_OBJECT_CONVERT_OTF_PDF

before Existing CLOSE_FORM.

1. CALL FUNCTION 'CLOSE_FORM'

IMPORTING

RESULT = RESULT

  • RDI_RESULT =

TABLES

OTFDATA = it_otf

  • EXCEPTIONS

  • UNOPENED = 1

  • BAD_PAGEFORMAT_FOR_PRINT = 2

  • SEND_ERROR = 3

  • SPOOL_ERROR = 4

  • CODEPAGE = 5

  • OTHERS = 6

.

2. CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'

EXPORTING

FORMAT_SRC = 'OTF'

FORMAT_DST = 'PDF'

DEVTYPE = 'ASCIIPRI'

  • FUNCPARA =

LEN_IN = L_LEN

IMPORTING

LEN_OUT = L_OUT

TABLES

CONTENT_IN = IT_PDF1

CONTENT_OUT = IT_PDF2

  • EXCEPTIONS

  • ERR_CONV_FAILED = 1

  • OTHERS = 2

Hope this will help u.

Regards,

KK

KalC
Active Participant
0 Kudos

Hi Prateksha,

In your PO print program you can capture the spool id from the close_form function module result parameter. Create a Ztable and update that with your PO number and spool ID got from close_form. So that when ever user wants to download the PO to pdf he will go to that ztable can find the spool ID which he can use to download to pdf.

reward if helpful.

Regards,

Kalyan.