Show TOC

Preparing Form Template Call in Application ProgramLocate this document in the navigation structure

Prerequisites

  • You have defined and activated a form template.

    More information: Defining Form Templates

  • You have experience of programming with ABAP and handling function modules.

Context

An application program outputs a form, with integrated business data, to a printer or for archiving . You use function modules to call the form template in the application program. You use a function module to first determine the name of the generated function module that describes the form, then you call it. Two further function modules control the output of the form, and specify whether it is to be printed or archived. The form is then called in the application program after the necessary data has been selected.

If you want to send the form as an e-mail or fax, you must forward it to Business Communication Services . You use the function module FP_JOB_OPEN to control how the form is sent back to the application program. You get the returned form from the generated function module.

The following procedure describes how a form template is called if the interface is not compatible with Smart Forms.

Note

If you migrated the 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.

More information in the Smart Forms documentation:

Integrating the Smart Form into the Application

Migrating Smart Forms (under Switching Runtime )

Procedure

  1. In the application program, define a variable of the type RS38L_FNAM for the name of the generated function module.
  2. Call the function module FP_JOB_OPEN.

    Use the parameters ( IE_OUTPUTPARAMS) of the structure SFPOUTPUTPARAMS to make settings for the form output. For example, specify whether you want the form to be printed, archived, or returned to the application program.

    Special feature for interactive offline forms: To have the created form returned to you to be forwarded to Business Communication Services for sending by e-mail, set the parameter GETPDF.

    More information: Form Interface Parameters of the Application Program

  3. To determine the name of the generated function module, call the function module FP_FUNCTION_MODULE_NAME.
    Caution

    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 template.

  4. Call the generated function module and send the parameters to the form interface. For example, set the language of the form in the import parameters.

    Special feature for interactive offline forms: Set the parameter FILLABLE to F .

    Caution

    If you have changed the form interface you must adapt the call, otherwise the program may terminate during execution.

    More information: Interface Parameters of Form Templates

  5. To cancel form processing, call function module FP_JOB_CLOSE.

Results

The system creates the form with the integrated business data in PDL (Printer Definition Language) format and forwards the output to the spool processing tools. A PDF form is created only if the appropriate parameters are sent to the function module FP_JOB_OPEN when archiving, returning a PDF, or using print preview.