Output in XDF Format


An XSF schema uses XML to describe the contents of a form. All the data you pass to the form from the form interface and include in the form is visible in the XSF data stream as the body of the <sym> tag, for example, the value 1349,00 in:

<sym name="WA_BOOKING-FORCURAM">1349,00</sym>

The XSF schema does not contain information on the type of WA_BOOKING, since this format only describes the form output. The symbol values have already been formatted according to the specified currency and language.

Applications that call forms in the SAP System actually 'know' which data they passed to the form at the form interface. However, if you want to process this data outside the SAP System, the XSF schema is not sufficient.

In this case, you can use the XDF format. This enables you to transfer the data of a form call to spool processing or to return it as a table.

See also: Output Example.


To output XDF using spool processing, at least one printer of type 'PLAIN' must be set up in the system. SAP Smart Forms stores XDF in the spool in binary format to ensure that no information is lost during a conversion (see also: Output of XML Documents).


An XDF document contains both the import and table parameters passed by the application and the defined standard parameters. Even if the application did not pass any parameters, there is a tag that contains the following information for each parameter defined in the form interface:

  • The name of the tag corresponds to the name of the interface parameter
  • The TYPE attribute specifies the ABAP Dictionary data type for the parameter
  • The OBJECT attribute specifies the ABAP Dictionary object type (for example, "TABL")
  • The TIMESTAMP attribute contains the date and time that the Dictionary was last changed

The values of these attributes are determined at the time of the call. The body of each tag contains the values passed by the application. To present the values, SAP Smart Forms uses the same XML representation as the Interface Repository. For more information on mapping ABAP data types to this representation, see http://ifr.sap.com/home/Documents/ABAP_Serialization.htm.

Numeric values for which it is undecided whether the value is 0 or initial are included in the output.


Statically Activating XDF Output in the Form

  1. In the Form Builder, choose the Form Attributes node and then the Output Options tab page.
  2. In the Output box, set XDF Output as the Output Format. You can choose either Spool or Application.
  3. If you choose Spool, you can optionally specify an output device of type PLAIN (alternatively, you can specify this device in the spool dialog).
  4. Activate your form.

Dynamically Activating XDF Output in the Function Module Call

  1. Define a structure for the output options (type: SSFCOMPOP):

    data: output_options    type SSFCOMPOP.

  2. Set the XDFCMODE field to overwrite the static settings:

    output_options-xdfcmode = 'X'.

  3. Use the parameters XDF, XDFOUTMODE, and XDFOUTDEV to determine the XDF settings, as in static activation. Activate XDF output using the XSF parameter. The Output Mode corresponds to the XSFOUTMODE parameter ('S' for Spool and 'A' for Application) and the Output Device to the XSFOUTDEV parameter, for example:

    output_options-XDF = 'X'.
    output_options-XDFOUTMODE = 'S'.
    output_options-XDFOUTDEV = 'P863'.

    If the TDDEST parameter of the Output Options is filled with a value, SAP Smart Forms ignores XSFOUTDEV.

  4. Call the generic function module and pass the structure output_options to the standard parameter with the same name.

Returning XDF as a Table (XSFOUTMODE='A')

The XDF table is passed with the same parameters as with XSF output, that is, with the XML/HTML output structure (XMLOUTPUT) of the standard export parameter JOB_OUTPUT_INFO.