Calling Forms in an Application
Program
To print or archive a form, you use function modules to call it in an application program. An initial function module determines the name of the generated function module that describes the PDF-based form. Two further function modules control the output of the form, and specify whether it is printed or archived.
The form is then called in the application program after the necessary data has been selected.
If you want
to send your form as a fax or
e-mail, you must forward the PDF to the
Business Communication
Services after the form has been called. You use the function module
FP_JOB_OPEN to control how the form is sent back to the application program as
a PDF. You get the PDF itself from the generated function module.
The following process describes how a PDF-based form with a non-Smart Forms-compatible interface is called.

If you migrated the PDF-based form from a Smart Form, or if the interface is Smart Forms-compatible, the form is called in the application program in the same way as a Smart Form.
For more information, see the following Smart Forms documentation:
Integrating
the Smart Form into the Application
Migrating
Smart Forms (under Switching
Runtime)
You have created and activated a PDF-based form. You have experience of programming with ABAP and handling function modules.
1. In the application program, you define a variable of the type RS38L_FNAM for the name of the generated function module:
2. You call the function module FP_JOB_OPEN. You use this function module to specify settings for the form output. You specify whether you want the form to be printed, archived, or sent back to the application program as a PDF. The form output is controlled using the parameters (IE_OUTPUTPARAMS) with the type SFPOUTPUTPARAMS.

For the individual fields of the structure SFPOUTPUTPARAMS and their meaning, see the ABAP Dictionary (transaction SE11).
3. You determine the name of the generated function module by calling FP_FUNCTION_MODULE_NAME.

The name of the generated function module is unique only in one system. This is why you must first call the function module that gets the current name of the generated function module from the name of the form.
4. You call the generated function module and send the parameters to the form interface.

The structure SFPDOCPARAMS exists as an additional import parameter for the generated function module (for example, for setting the language); the structure FPFORMOUTPUT exists as an export parameter. For more information, see Parameters of the Generated Function Module.
5. You call the function module FP_JOB_CLOSE to complete the processing of the form.
The system creates the form with the integrated application data in PDL (Printer Definition Language) form and forwards it to the spool processing tools. A PDF is created only if the appropriate parameters are sent to FP_JOB_OPEN when archiving, returning a PDF, or using print preview.
As long as you do not modify the form interface, you can continue to edit the form without modifying the application program. However, if you modify the form interface, you must also modify the interface in the application program accordingly.
See also:
Example: Calling Forms in an Application Program
