Skip to Content

Merge Multiple Adobe Forms into 1 PDF Content

Sometimes we get requirements from clients to combine multiple PDF output documents into 1 document similar to PDF Merge functionality provided by 3rd party tools. This blogs talks about the steps to achieve the same without storing the files on Application server and running UNIX commands to run a script to merge them.


Call the FP_JOB_OPEN function module with below parameters

*   Call abode with structure gs_frm_interface and  get the PDF
fp_outputparamsdevice     ‘PRINTER’.
fp_outputparamsdest         ‘PDF’.
fp_outputparamsnodialog  abap_true.

fp_outputparamspreview   abap_false.
fp_outputparamsgetpdf     abap_true.
fp_outputparamsreqnew   abap_true.

fp_outputparamspreview    ‘ ‘.

fp_outputparamsassemble  ‘X’.
fp_outputparamsbumode   ‘M’.       ” This is Bundle Mode
fp_outputparamsgetpdf      ‘M’.       ” This should be set to M, compare to regular value X being                                                                     ” passed

* Sets the output parameters and opens the spool job
CALL FUNCTION ‘FP_JOB_OPEN’                   “& Form Processing: Call Form
ie_outputparams fp_outputparams
cancel          1
usage_error     2
system_error    3
internal_error  4
OTHERS          5.
IF sysubrc <> 0.
*            <error handling>



Get the Adobe Form function Module using FP_FUNCTION_MODULE_NAME and Call the function module for your 1st Adobe Form.



Get the Adobe Form function Module using FP_FUNCTION_MODULE_NAME and Call the function module for your 2nd Adobe Form.

Make sure you call all the Adobe form Function module, as many as you want here.



Call the FP_JOB_OPEN as you would do normally


Step 5:

Use the Function module ‘FP_GET_PDF_TABLE’   to get the Merged PDF content, as shown below

    DATA pdf_table TYPE              tfpcontent.
DATA la_pdf     LIKE LINE OF pdf_table.

e_pdf_table pdf_table.

READ TABLE pdf_table INTO la_pdf INDEX 1.
IF sysubrc EQ 0.
e_pdf_content la_pdf.
* Raise Appropriate Error


The PDF content will now have all the Adobe forms PDF content merged into 1 PDF content, and this can used to display in Webdynpro or downloaded to you desktop.

You must be Logged on to comment or reply to a post.
  • Hi Isil,


    e_pdf_content is of table type RAWSTRING . It contains the PDF Content in RAWSTRING format. You can use this PDF content in function like a) Download b) Display PDF in Webdynpro by assigning the data source for an Adobe UI element.