Skip to Content
Former Member
Mar 11, 2009 at 09:06 PM

PDF to Zip conversion


Quick overview of requirement:

Create dynamic variants and submit background job which in turns call Samarforms to create OTF spools. Once all the jobs are completed, read spool file(s) and convert them to PDF. The next step is to add these PDF files to a zip file and the last step is to download the zip file.


Created dynamic variants using: RS_VARIANT* function modules. Created jobs using JOB_* function modules. Read the spool file from TBTCP table. Converted to PDF using u201CCONVERT_OTFSPOOLJOB_2_PDFu201D (Online conversion).

Now this is where I am stucku2026 If I download the PDF file to my local PC and then upload it back again then it worksu2026 Once I upload the downloaded PDF file I use function module u201CSCMS_BINARY_TO_XSTRINGu201D and add it to zip file using ABAP class cl_abap_zip. Then I use FM SCMS_XSTRING_TO_BINARY to get the data in table format which I can download using gui_download.


Once I call the FM u201CCONVERT_OTFSPOOLJOB_2_PDFu201D, how do I covert the contents of the PDF output to something that can be sent to cl_abap_zip for zipping? Since this program will be running in background and will have lots of data I cannot use the UPLOAD - DOWNLOAD. I am stuck now... any help is greatly appriciated.