Ansicht
Dokumentation
ABAPMAPPING_FROM_ENTITY - MAPPING FROM ENTITY
CL_GUI_FRONTEND_SERVICES - Frontend Services Fill RESBD Structure from EBP Component StructureThis documentation is copyright by SAP AG.
Statements with MAPPING FROM ENTITY
${ INSERT insert_syntax $}
$| ${ MODIFY modify_syntax $}
$| ${ UPDATE update_syntax $}
$| ${ DELETE delete_syntax $} MAPPING FROM ENTITY.
Variants:
1. INSERT insert_syntax MAPPING FROM ENTITY.
2. MODIFY modify_syntax MAPPING FROM ENTITY.
3. UPDATE update_syntax MAPPING FROM ENTITY.
4. DELETE delete_syntax MAPPING FROM ENTITY.
Effect
The addition MAPPING FROM ENTITY to the modifying statements INSERT, UPDATE, MODIFY, and DELETE is used to handle structures and internal tables that are typed with BDEF derived types.
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.
Variant 1
INSERT insert_syntax MAPPING FROM ENTITY.
Effect
Used to insert one or more rows from a source into a target. See the detailed syntax options for insert_syntax 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.
Example
DATA: ins_tab TYPE TABLE FOR CREATE demo_managed_root_map,
ins_wa TYPE STRUCTURE FOR CREATE demo_managed_root_map.
...
INSERT demo_tab_root_3 FROM @ins_wa MAPPING FROM ENTITY.
INSERT demo_tab_root_3 FROM TABLE @ins_tab MAPPING FROM ENTITY.
Variant 2
MODIFY modify_syntax MAPPING FROM ENTITY.
Effect
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_syntax 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.
Example
DATA: mod_tab TYPE TABLE FOR CREATE demo_managed_root_map,
mod_wa TYPE STRUCTURE FOR CREATE demo_managed_root_map.
...
MODIFY demo_tab_root_3 FROM @mod_wa MAPPING FROM ENTITY.
MODIFY demo_tab_root_3 FROM TABLE @mod_tab MAPPING FROM ENTITY.
Variant 3
UPDATE update_syntax MAPPING FROM ENTITY.
Effect
Used to change one or more rows in a target based on specifications in a source. See the detailed syntax options for update_syntax 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.
Example
DATA: up_tab TYPE TABLE FOR UPDATE demo_managed_root_map,
up_wa TYPE STRUCTURE FOR UPDATE demo_managed_root_map.
...
UPDATE demo_tab_root_3 FROM @up_wa MAPPING FROM ENTITY.
UPDATE demo_tab_root_3 FROM TABLE @up_tab MAPPING FROM ENTITY.
UPDATE demo_tab_root_3 FROM @up_wa
INDICATORS SET STRUCTURE %control MAPPING FROM ENTITY.
UPDATE demo_tab_root_3 FROM TABLE @up_tab
INDICATORS SET STRUCTURE %control MAPPING FROM ENTITY.
Variant 4
DELETE delete_syntax MAPPING FROM ENTITY.
Effect
Used to delete one or more rows in a target based on the specification in a source. See the detailed syntax options for delete_syntax 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.
Example
DATA: del_tab TYPE TABLE FOR DELETE demo_managed_root_map,
del_wa TYPE STRUCTURE FOR DELETE demo_managed_root_map.
...
DELETE demo_tab_root_3 FROM @del_wa MAPPING FROM ENTITY.
DELETE demo_tab_root_3 FROM TABLE @del_tab MAPPING FROM ENTITY.
The example Statements with the addition MAPPING FROM ENTITY demonstrates the different variants.
ABAP Short Reference TXBHW - Original Tax Base Amount in Local Currency
This documentation is copyright by SAP AG.
Length: 8875 Date: 20240423 Time: 130645 sap01-206 ( 92 ms )