cancel
Showing results for 
Search instead for 
Did you mean: 

To save the PDF of adobe form onto Desktop

Former Member
0 Kudos

My requirement goes this way.

We have a custom Tcode where there is only print option. We cant view the print preview of the adobe form which gets triggered from the tcode. Now the requirement says we need to save the PDF form onto desktop. Using the CALL FUNCTION module, I am able to get the PDF data from the   fpformoutput  structure.

Then, I have converted this data into binary format using the function module-   'SCMS_XSTRING_TO_BINARY'

Now, i am not knowing how to convert this data into either OTF or PDF in order use the function module-"GUI_DOWNLOAD"?

Is there any other way to do this?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Mamatha,

you've done 99%. You don't need to convert the binary string any more. Just save the binary string to local file using  cl_gui_frontend_services=>gui_download, then it's done!

Best regards.

Tao

Former Member
0 Kudos

Hi Mamatha,

  • A PDF binary has to be saved as any other binary: If the file is to be saved on the frontend, it can only be done in dialog interactive mode (it is impossible to connect to the frontend from background execution), use either GUI_DOWNLOAD function module or method GUI_DOWNLOAD from class CL_GUI_FRONTEND_SERVICES. If the file is to be saved on the server, use OPEN DATASET, TRANSFER and CLOSE DATASET ABAP statements. 
  • As for any other binary, be careful to save the exact number of bytes that the binary contains (use the "binary length" returned by CONVERT_OTF or CONVERT_OTFSPOOLJOB_2_PDF), otherwise you might have problems when opening the PDF.

https://wiki.sdn.sap.com/wiki/display/ABAP/PDF+Downlaod+By+Creating+Spool+Request