Entering content frame

Function documentation Structure Logic of the Hierarchy Locate the document in its SAP Library structure

Use

The hierarchy of the form class is the tool used to model the dependencies of the data areas and the structure logic for the print transaction. The structure logic cannot be used in the form class itself. There must always be an application form for this.

Features

The system processes the form level according to the following principle:

...

       1.      The current form level entry is imported

       2.      Data from the appropriate 1:1 levels is imported

       3.      The complex data type is filled for Smart Forms.

       4.      The hierarchically subordinate form levels are processed.

Using this process definition, the hierarchy tree is processed recursively from top to bottom. In the application form, you can, for example, insert additional events (for example, printing a text or calling a user exit) between events 2) and 3) and between 3) and 4).
In each run, the relevant data for the levels is placed in the global work areas (WA_<name of form level>) of the form class; these can then be accessed in texts or user exists in the application forms.
The highest form level (also called document level) is very important; each entry for this level equates to a document.

Example

The process logic is described in more detail using the example PWB_FLIGHT_NOTIFICATION.

This graphic is explained in the accompanying text

The customer (CUSTOMER, table SCUSTOM) and his postings (BOOKING, table SBOOK) represent two form levels. They have a 1:n relationship since one customer can have several postings.  There is a 1:1 level posting (FLIGHT, table SPFLI) for a posting that contains additional information about the unique flight of the posting. This hierarchy is processed as follows:

...

       1.      All customers fulfilling the initial selection criteria are imported and placed in an internal table (T_CUSTOMER). The number of entries in this table is identical to the number of documents created later.

       2.      A customer is read from the internal table and archived in the global work area of the form level (WA_CUSTOMER). At the same time, a new document is opened.

       3.      Since the form level CUSTOMER has no 1:1 levels, the processing of the relevant form levels continues. Processing of the form level BOOKING begins. All bookings for the current customer are imported and placed in an internal table.

       4.      The flight belonging to the current flight booking is read and placed in the work area WA_FLIGHT.

       5.      Since the form level has no further dependent form levels or 1:1 levels, the processing of the next posting continues.

       6.      If all postings have been processed for the current customer, the processing of the form level BOOKING for the current customer is completed. The document is completed and the processing returns to processing step 2.

This flow logic can be expanded to any number of form levels. You can also process the same form levels several times running in application forms. This means the same form levels can appear several times running in the hierarchy. This is necessary, for example, if you want to access the same data in different sections of the form.
In application forms, further events (for example, printing a text or calling a user exit) are added to this hierarchy.

 

Leaving content frame