ABAP_VARIANTS: 1 INSERT ... MAPPING FROM ENTITY. > 2 MODIFY ... MAPPING FROM ENTITY. > 3 UPDATE ... $[INDICATORS SET STRUCTURE %control$] MAPPING FROM ENTITY. > 4 DELETE ... MAPPING FROM ENTITY. >
What does it do? The addition MAPPING FROM ENTITY> of the modifying AB-SQL statements INSERT> >, UPDATE>>, MODIFY >>, and DELETE>> is used to handle structures and internal tables that are typed with BDEF derived types>.
Latest notes:
In case of a problematic type conversion when using these statements, for example INT4> to NUMC>, a ... CORRESPONDING #( ... MAPPING FROM ENTITY ) ...>> is automatically carried out without an explicit programming.
The catchable exception CX_SY_CONVERSION_ERROR>> occurs in case of type conversion errors. NON_V5_HINTS ABAP_HINT_END
ABAP_VARIANT_1 INSERT ... MAPPING FROM ENTITY. >
What does it do? Used to insert one or more rows from a source> into a target>. See the detailed syntax options for INSERT> in the INSERT> topic>. The sources, i. e. a structure or an internal table, must be typed with the BDEF derived type> TYPE STRUCTURE FOR>> and TYPE TABLE FOR>> respectively. In this case, the types ... FOR UPDATE ...>, ... FOR CREATE ...>, ... FOR DELETE ...>, and ... FOR CHANGE ...> are possible.
ABAP_EXAMPLE_VX5 ABEXA 01679 ABAP_EXAMPLE_END
ABAP_VARIANT_2 MODIFY ... MAPPING FROM ENTITY. >
What does it do? Used to insert one or more rows into a target> or update existing rows based on the specification in a source> . See the detailed syntax options for MODIFY> in the MODIFY> topic>. The sources, i. e. a structure or an internal table, must be typed with the BDEF derived type> TYPE STRUCTURE FOR>> and TYPE TABLE FOR>> respectively. In this case, the types ... FOR UPDATE ...>, ... FOR CREATE ...>, ... FOR DELETE ...>, and ... FOR CHANGE ...> are possible.
ABAP_EXAMPLE_VX5 ABEXA 01680 ABAP_EXAMPLE_END
ABAP_VARIANT_3 UPDATE ... $[INDICATORS SET STRUCTURE %control$] MAPPING FROM ENTITY.>
What does it do? Used to change one or more rows in a target> based on specifications in a source> . See the detailed syntax options for ...> in the UPDATE> topic>. The sources, i. e. a structure or an internal table, must be typed with the BDEF derived type> TYPE STRUCTURE FOR>> and TYPE TABLE FOR>> respectively. In this case, the types ... FOR UPDATE ...>, ... FOR CREATE ...>, ... FOR DELETE ...>, and ... FOR CHANGE ...> are possible. The UPDATE> statement can also be used with the addition INDICATORS SET STRUCTURE>> that includes the %control>> structure to determine which fields are to be changed. Currently, this variant is only possible in a context in which the related RAP behavior definition (BDEF) > includes the notation persistent table >>.
ABAP_EXAMPLE_VX5 ABEXA 01681 ABAP_EXAMPLE_END
ABAP_VARIANT_4 DELETE ... MAPPING FROM ENTITY. >
What does it do? Used to delete one or more rows in a target> based on the specification in a source> . See the detailed syntax options for DELETE> in the DELETE> topic>. The sources, i. e. a structure or an internal table, must be typed with the BDEF derived type> TYPE STRUCTURE FOR>> and TYPE TABLE FOR>> respectively. In this case, the type ... FOR DELETE ...> is possible.
ABAP_EXAMPLE_VX5 ABEXA 01682 ABAP_EXAMPLE_END
ABAP_EXAMPLE_ABEXA The example AB_SQL Statements with the Addition MAPPING FROM ENTITY>> demonstrates the different variants. ABAP_EXAMPLE_END