Returning a Form as a Table in the Application Program


By default, at the end of the form processing, SAP Smart Forms sends the form to spool processing. However, you can use the standard parameters to send the form to different output media instead (for example, to the BCI to send the form by e-mail). At the interface of the generated function module, SAP Smart Forms provides standard parameters for the selection of transmission settings. In many cases, this selection may not be comprehensive enough (for example, if the sender wants to receive the document in their SAPoffice outbox when it is sent). In such a case, the application can request the form to be returned as a table and can then address the relevant BCI interface itself.

This section describes how OTF is returned as a table. This information can be found for XSF under Dynamically Activating XSF Output, for HTML under Output in HTML Format, and for XDF under Output in XDF Format.


If you want the form to be returned as a table in OTF format, proceed as follows:

  1. Define a structure of type SSFCTRLOP (control structure, standard parameter CONTROL_PARAMETERS) and another structure of type SSFCRESCL (to contain the output results, standard parameter JOB_OUTPUT_INFO):

    DATA: my_control_pars TYPE ssfctrlop.   "for CONTROL_PARAMETERS
    DATA: my_output_info TYPE ssfcrescl.    "for JOB_OUTPUT_INFO

  2. To deactivate the dialogs and to inform SAP Smart Forms that you only want the OTF table to be returned, set the parameters NO_DIALOG and GETOTF of the control structure:

    my_control_pars-no_dialog = 'X'.
    my_control_pars-getotf = 'X'.

  3. Pass both structures in the call of the generated function module.

You can now access the OTF table in the formal parameter JOB_OUTPUT_INFO using the OTFDATA parameter of your structure.

If the GETOTF parameter is set, SAP Smart Forms ignores the setting of the DEVICE parameter of the control structure. You cannot have the OTF table returned to you and send the form to an output device. Furthermore, you cannot have the form returned in both OTF and other output formats in one call of the generated function module.