cancel
Showing results for 
Search instead for 
Did you mean: 

PDF to application server

Former Member
0 Kudos

After converting a Smartform to PDF, how do I create the PDF in application server? Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

please have look at the link

[;

I am sure that it shall help in resolving the issue ....

Best of Luck !!!

thanks

Ravi

Former Member
0 Kudos

Hi Ravi,

The thread you've directed me to uses function module GUI_UPLOAD to get a PDF from presentation server first. In my case, I want the PDF to be generated directly into application server once the conversion from Smartform to PDF occurs using CONVERT_OTF.

Thanks.

Regards,

WS

Former Member
0 Kudos

hi,

I dont think you can generate the PDF on application server directly.

What you can do is generate the PDF on the presentation server and then download it on the application server.

Regards,

manish

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Can u plz tell hw was the problem solved?

Thanks,

Manish

Former Member
0 Kudos

Hi Manish,

This is the code I use. Variables for:-

gv_filename is a file path in the application server.

gt_lines is the internal table populated by function module CONVERT_OTF.

After the function module CONVERT_OTF, use code as below and the PDF will be generated directly into the application server.


        OPEN DATASET gv_filename FOR OUTPUT IN BINARY MODE.
          IF sy-subrc <> 0.
            WRITE: 'File cannot be opened.'.
          ENDIF.

          LOOP AT gt_lines INTO gw_lines.
            TRANSFER gw_lines TO gv_filename.
          ENDLOOP.

        CLOSE DATASET gv_filename.

Former Member
0 Kudos

Thanks everyone for the advice. This problem has been solved. It is possible to generate PDF directly to the application server.

venkat_o
Active Contributor
0 Kudos

Hi, <li> Once you got smartform output as PDF into internal table lets say it_pdf, you need do like this way.


 REPORT ztest_notepad.
 DATA :app_file TYPE char120 VALUE '/usr/sap/put/data.PDF'.
 OPEN DATASET app_file FOR OUTPUT IN BINARY MODE.
 LOOP AT it_pdf.
   TRANSFER it_pdf-data TO dsn.
 ENDLOOP.
 CLOSE DATASET app_file.
Thanks Venkat.O

Former Member
0 Kudos

Hi,

First use GUI_DOWNLOAD to download file into internal table and then use OPEN DATASET and CLOSED DATASET statement to download it on the application server.

U can follow the following links as well

Regards,

Manish