Show TOC

Generating Program-Driven Adode Form LayoutLocate this document in the navigation structure

Prerequisites

You are familiar with the XFA specification.

More information: Adobe home page, Adobe XML Forms Architecture (XFA) page (using search.adobe.com )

Note

Adobe refers to the form layout saved in XFA format as a form template. In the SAP system, a form template contains data collection information as well as the layout.

Context

Instead of creating form layouts manually in Adobe LiveCycle Designer , you can use a program interface (API) to have them generated by the program. The program-driven form layout can be displayed in Adobe LiveCycle Designer .

Recommendation

Since the program interface only provides a selection of XML tags and attributes from the XFA specification, and not the full range of functions of Adobe LiveCycle Designer, we recommend that you only use this method to generate simple forms.

Procedure

  1. To define a form layout, use the interfaces from package SAXFT.
    Note

    Each interface corresponds to precisely one tag in the XFA specification.

  2. To generate the root node, use CREATE_OBJECT to instantiate an object from the class CL_SXFT_TEMPLATE.

    For this object, you can call the method GET_FACTORY() to get a factory object.

  3. To generate the subsequent XFA elements, use a create method of the factory object to instantiate the corresponding object.
    • Structure the XFA document as follows:

      • Use set methods to set simple attributes and send the attribute value to the VALUE parameter in quotation marks.

      • Use set methods to set attributes that are themselves elements, and send an object to the VALUE parameter that represents the attribute (and the new element).

        Note

        Exception: You do not need to generate attributes that are themselves elements but only have a few of their own attributes. You can set the values directly by using the corresponding set method (for example < margin > and < color >).

      • Set child elements by using the method IF_SXFT_NODE~APPEND_CHILD(NEW_CHILD). The interface IF_SXFT_NODE is included in all interfaces that represent XFA elements.

    • Use grouping interfaces for attributes that are set often:

      • The interface IF_SXFT_ALIGNMENT groups the set methods for the attributes VALIGN and HALIGN. This interface is included in all interfaces that represent elements with these attributes.

      • The interface IF_SXFT_MEASUREMENT groups the set methods for attributes X, Y, W, H, and layout. This interface is included in all interfaces that represent elements with these attributes.

Example

For an example implementation, see the program RSXFT_XFT_API_DEMOII.

This program generates a form template (XFA file) that includes the following: header and footer, a static text, a selection list, option fields, a text input field, and a pushbutton. The generation of the form layout does not include any data binding (no form template context).