The form levels make up the main part of a form class. A form level represents an entity in the data model of the respective application, for example, account or business partner. The form levels are related to each other in a 1:n relationship. This means that for each entry belonging to a particular form level, there are n entries in the form level below it in the hierarchy. The form levels define the basic framework of a form class and data is added using the 1:1 levels.
In
application forms, form levels are used to select the data belonging to the
form level. The
data selected is placed in global data areas and can be accessed in
application forms, for example, in texts. Since
form levels represent a 1:n relationship between data, the execution of a data
loop is always connected to a form level.
Global data
areas are derived from the name of the form level (WA_<name of form
level>); the data is temporarily stored in these areas.
The attributes of a form level contain the following information:
· Name of the form level
· Assigned DDIC output structure or DDIC table
· Short name
· Name of the DDIC structure or table type generated if Smart Forms are active in the form class
For each form level there are exactly two ABAP subprograms in the form class library:
·
READ
subprogram
The READ subprogram procures the initial data and is called up once at the
start of form processing. The READ subprograms of a form class are called up
in the application form in the order in which the related form levels exist in
the hierarchy.
·
GET
subprogram
There is one GET subprogram for each form level. This GET subprogram procures
the n data records of the relevant form level dependent on the current data
record of the next highest form level so that this can also be processed. When
you use the subprogram types, you can choose between the following
strategies:
¡ All the data for a form level is procured in the relevant READ subprogram and defined in the global table. The GET subprogram extracts the n data records required for the current run from the global table.
¡ The affiliated READ subroutine is empty. In the GET subprogram you procure the current data for the form level from the database directly or from other filled data buffers.
When you are developing a form class, you have to decide which strategy to use based on the data constellation and program design. With regard to performance, you should make sure that GET subprograms can be called up more than once in an application form; this means that data buffering is strongly recommended.