ABAPINSERT_FG - INSERT FG
PERFORM Short Reference Addresses (Business Address Services)This documentation is copyright by SAP AG.
INSERT - field_group
Syntax
INSERT dobj1 dobj2 ... INTO { header | field_group }.
Effect
This statement is used to build a structure of a field group defined by FIELD-GROUPS of the program'sextract dataset. A list of globalflatdata objects dobj can be inserted after INSERT. The specification of local data objectscauses an exception. The list defines the components of the field group header or field_group.Any name can be specified directly for field_group, whereas header is a predefined nameof a special field group whose components are automatically a part and a key of all other field groups.The components of a field group have the function of a pointer to data objects whose contents can beattached as a line to the extract dataset when executing the statement EXTRACT.
The statement INSERT can be used in any processing block of a program and is executed at the given time during the program execution. Afield group can have different INSERT statements. A field group can be extended with additionalcomponents till the first corresponding line with EXTRACT is attached to the extract dataset.The field group header can only be extended till a field group of the program is extracted becauseit is a part of all field groups. An INSERT statement for an already extracted field group causes an exception that cannot be handled.
You can specify field symbols but not dereferenced data references for dobj. A field symbol isignored if no data object is assigned to it. The specification of a data reference causes an exception that cannot be handled.
Notes
A field group field_group to which no fields are explicitly added still contains the field of the special field group header.
- In global classes, field groups can not be defined and edited. In methods of local classes of programs other than class pools, the statement INSERT is possible for globally defined field groups.
Example
In this example, three field groups are declared in the global declaration part of anexecutableprogram and its components are specified in the event block START-OF-SELECTION. The fieldgroup flight_info contains five components of the field group header and its own. The field group flight_date contains only the components of the field group header.
REPORT demo_extract.
NODES: spfli, sflight.
FIELD-GROUPS: header, flight_info, flight_date.
START-OF-SELECTION.
INSERT: spfli-carrid spfli-connid sflight-fldate
INTO header,
spfli-cityfrom spfli-cityto
INTO flight_info.
Exceptions
Non-Catchable Exceptions
- Cause: Local data objects should be inserted into a field group.
Runtime Error: EXTRACT_INSERT_LOCAL_DATA - Cause: Field group contains INSERT after sets of this set type have been extracted using EXTRACT.
Runtime Error: INSERT_INTO_LOCKED_FIELD_GROUP
SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up Vendor Master (General Section)
This documentation is copyright by SAP AG.
Length: 4667 Date: 20120522 Time: 233136 triton ( 205 ms )






