cancel
Showing results for 
Search instead for 
Did you mean: 

Convert Script output into PDF and save into Unix Directory

Former Member
0 Kudos

Hi,

I had Sales Order Acknowledgement Output and wants to converted to PDFs and then these PDFs to be placed in Unix Directory

on their way to Docs Library.

I am using the following code

CALL FUNCTION 'CLOSE_FORM'

IMPORTING

RESULT = itcpp

TABLES

otfdata = lt_otf " OTF Data

EXCEPTIONS

unopened = 1

OTHERS = 2.

After this form , table ltf_otf is empty, So i am not converting into PDF .

So i need the logic to convert to PDF , and most importantly logic to save into UNIX Directory.

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

If you are using the Function Module "OPEN_FORM" to open the form for printing then in this function module there is an IMPORTING parameter OPTIONS which is of type ITCPO to this parameter "OPTIONS-TDGETOTF" needs to be passed as 'X' which will give you the OTF output in the FM "CLOSE_FORM".

After this call the FM "CONVERT_OTF" and pass the FORMAT as "PDF" which will give you the PDF output in LINES table Parameter. Most important please pass some dummy variable to BIN_FILESIZE variable.

Now by using OPEN DATASET file name FOR OUTPUT IN BINARY MODE and the LOOP the PDF table and use the TRANSFER statement to place the data in the UNIX File and then Finally use the CLOSE DATASET file name.

Hope will help to address your issue.

Regards,

SRinivas

brad_bohn
Active Contributor
0 Kudos

OTF to PDF conversion and saving the data to the application server have been discussed many, many times here. For the OTF retrieval, did you set TDGETOTF = 'X' in your itcpp structure?