To call an Adobe Form in SAP ABAP, you use a sequence of specific function modules: FP_JOB_OPEN to initialize the print/output job, FP_FUNCTION_MODULE_NAME to retrieve the name of the generated function module for your form, the generated function module itself to pass data and generate the PDF, and FP_JOB_CLOSE to close the job.
Key Function Modules Sequence
FP_JOB_OPEN- Purpose: Opens the print or output job and configures output parameters (such as preview, no dialog, or printer destination).
- Key Parameter:
IE_OUTPUTPARAMS(Type:SFPOUTPUTPARAMS/SFP_OUTPARAMS).
FP_FUNCTION_MODULE_NAME- Purpose: Looks up the runtime name of the generated function module associated with your Adobe Form name.
- Key Parameters:
I_NAME(Passing your Adobe Form name)E_FUNCNAME(Importing the resulting generated function module name)
- Generated Function Module (Dynamic Name)
- Purpose: Executes the form routine, processes the interface data, and returns the PDF output.
- Key Parameters:
- Exporting:
/1BCDWB/DOCPARAMS(Type:SFP_DOCPARAMSfor language, country, etc.) - Importing:
/1BCDWB/FORM_OUTPUT(Type:FPFORM_OUTPUTcontaining the generated PDFXSTRING) - Plus any custom importing parameters defined in your Adobe Form interface.
- Exporting:
FP_JOB_CLOSE- Purpose: Closes the print job and finalizes the spool request or output generation.
- Purpose: Closes the print job and finalizes the spool request or output generation.
Example ABAP Code Structure
DATA: lv_fm_name TYPE funcname,
ls_outputparams TYPE sfpoutputparams,
ls_docparams TYPE sfpdocparams,
ls_form_output TYPE fpform_output.
* 1. Set output parameters (e.g., no dialog, enable preview or PDF get)
ls_outputparams-nodialog = 'X'.
ls_outputparams-getpdf = 'X'. " Use if you want XSTRING PDF back in ABAP
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = ls_outputparams
EXCEPTIONS
cancel = 1
usage_error = 2
system_error = 3
internal_error = 4
OTHERS = 5.
IF sy-subrc <> 0.
" Handle error
ENDIF.
* 2. Get the generated function module name for the Adobe Form
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name = 'ZYOUR_ADOBE_FORM_NAME' " Replace with your Adobe Form name
IMPORTING
e_funcname = lv_fm_name.
IF sy-subrc <> 0.
" Handle error
ENDIF.
* 3. Set document parameters (language, country)
ls_docparams-langu = sy-langu.
* 4. Call the generated function module
CALL FUNCTION lv_fm_name
EXPORTING
/1bcdwb/docparams = ls_docparams
" <your_custom_interface_parameters> = ...
IMPORTING
/1bcdwb/form_output = ls_form_output
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
" Handle error
ENDIF.
* 5. Close the job
CALL FUNCTION 'FP_JOB_CLOSE'
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
Helpful Resources- You can read more implementation details and code patterns via the
SAP Community Guide on Previewing and Downloading Adobe Forms. - Step-by-step UI configuration details can be found on Sapcodes Blog on
Displaying and Calling Adobe Forms.