Procedure documentationDynamically Activating XSF Output

 

Independent of the static settings on XSF output, you may want to print a form in XSF format or select a different output mode or output device for the form output.

Prerequisites

If you want to use spool processing for XSF output, in the system at least one printer of type 'XSF' must be set up. SAP Smart Forms stores XSF in the spool in binary format to prevent information from being lost in conversions (see also: Output of XML Documents).

Procedure

  1. Define a structure for the Output Options (type SSFCOMPOP) and - provided you want the form to be returned as table - a structure of type SSFCRESCL (to contain the output results):

    Syntax Syntax

    1. data:	output_options	type SSFCOMPOP, 
      	job_output_info	type SSFCRESCL.
    End of the code.
  2. If in the form the output format XDF is set, you must overwrite this setting. In addition, set XSFCMODE to activate the XSF settings of the standard parameters:

    Syntax Syntax

    1. output_options-xdfcmode = 'X'.
      output_options-xdf = SPACE.
      
      output_options-xsfcmode = 'X'.
    End of the code.
  3. Use the parameters XSF, XSFOUTMODE, and XSFOUTDEV to determine the XSF settings. The parameters correspond to the static form attributes (the possible values are described under Output Options)

    Syntax Syntax

    1. output_options-XSF = 'X'.
      output_options-XSFOUTMODE = 'S'.
      output_options-XSFOUTDEV = 'P863'.
    End of the code.

    Caution Caution

    If the TDDEST parameter of the output options contains a value, SAP Smart Forms ignores XSFOUTDEV.

    End of the caution.
  4. Call the generated function module and pass the structures output_options and job_output_info to the standard parameters of the same names.

Result

Since the XSFCMODE field is set, the value of field XSF determines whether OTF or XSF is generated (you cannot have both in the same call):

  • If XSF is set, the form output is in XSF format

  • If XSF is not set, the form output is in OTF format

    Note Note

    If XSFCMODE is set, the value of GETOTF in the control structure has no effect.

    End of the note.

With output mode 'A' SAP Smart Forms returns the form as table. The table is returned using the XSFDATA parameter of the formal parameter JOB_OUTPUT_INFO of the generated function module.

With output mode 'S' SAP Smart Forms sends the form to spool processing.