Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

how to upload pdf file format in unix file directory?

Former Member
0 Kudos

how to upload pdf file format in unix file directory?

1 ACCEPTED SOLUTION

anusurbab
Explorer
0 Kudos

Hi,

You can use OPEN DATASET, TRANSFER statements to write the file contents to application server. Use hexadecimal string variables.

2 REPLIES 2

venkat_o
Active Contributor
0 Kudos

Hi Karthikeyan, If you have PDF internal table with you, You can follow the below method to upload into Unix directory.


    DATA:file_path TYPE char100 VALUE '/usr/sap/tmp/rep_out.PDF'.
    OPEN DATASET file_path FOR OUTPUT IN BINARY MODE.
    IF sy-subrc EQ 0.
      LOOP AT it_pdf.
        TRANSFER it_pdf TO file_path.
      ENDLOOP.
    ENDIF.
    CLOSE DATASET file_path.
Thanks Venkat.O

anusurbab
Explorer
0 Kudos

Hi,

You can use OPEN DATASET, TRANSFER statements to write the file contents to application server. Use hexadecimal string variables.