Two relevant formal parameters are necessary in the form creation process They are based on the ABAP Dictionary structures: /1bcdwb/docparams and /1bcdwb/formoutput.
In the above example, these formal parameters belong to the actual parameters GS_DOCPARAMS and GS_FORMOUTPUT.
The variable GS_DOCPARAMS holds parameters to influence the form creation process:
- Fillable determines whether a form can have interactive features. By default, it cannot. If you set fillable to 'X,' interactive features are enabled and Adobe Reader grants reader rights (in particular, the user can enter data and save the form together with the data). If fillable equals 'N,' the user can make entries in the form, but cannot save the form together with the entries.
- Dynamic determines, for example, if table rows can be added to tables inside the form or if colors can be set dynamically using scripting.
If you do not set this parameter to 'X,' you can change field values but many other interactive features would fail.
The variable GS_FORMOUTPUT holds the results of the function call:
- PDF: Contains the PDF data in hexadecimal form if parameter GETPDF of function module FP_JOB_OPEN is set to 'X.'
This is required if your program has a download functionality or if you want to pass on your PDF to Business Communication Service to fax or e-mail it.
- PDL: Contains the PDF data in hexadecimal form if parameter GETPDL of function module FP_JOB_OPEN is set to X.
RequestFP_JOB_CLOSE will tell you whether the output was produced successfully. You can also query the spool IDs.
If you are familiar with SAPscript, FP_JOB_OPEN and FP_JOB_CLOSE are roughly equivalent to function modules OPEN_FORM and CLOSE_FORM.
After the form creation process, further processing steps can be coded like downloading the form.
Sending the form via e-mail is another possibility. See useful SAP examples in the package SBCOMS.
You can find download utilities in the FP_UTILITIES include.