What does it do? Mapping rule for the component operator CORRESPONDING>>. The optional mapping rule overrides the default assignment of identically named components only. The additions MAPPING> and EXCEPT> can be used individually or together. EXCEPT> must always be specified behind MAPPING>.
Latest notes: BEGIN_SECTION HIDDEN
When using the basic form> with a mapping rule, assignments can currently only be made to the same structure or internal table specified as an argument if this is known statically. The information need to create the necessary temporary copy of the target object is missing at runtime and a runtime error occurs. END_SECTION HIDDEN
The system class CL_ABAP_CORRESPONDING>> is used for assignments between structures or internal tables with a dynamic mapping rule.
It is best to use the component operator for mapping tasks that can be solved using either the component operator or table comprehensions>. NON_V5_HINTS
For the latter, see the executable example>. ABAP_HINT_END
ABAP Addition $[duplicates$] ...>
What does it do? Behind MAPPING>, the components s1>, s2>,... of a source structure or source table are assigned to the components of a target structure or target table t1>, t2>, .... in mapping relationships. If the components specified on the left and right of an equal sign of a mapping relationship are themselves structured or tabular with a structured line type, a separate mapping rule can be nested for them. Here, the mapping relationship is set in parentheses ( ... )> and a further mapping rule MAPPING ...> and/or EXCEPT ...> is specified behind the mapping relationship in accordance with the same rules as on the top level. The parentheses are not allowed if a nested mapping rule is not used. If the components specified to the left and right of an equal sign of a mapping relationship are tabular, the addition duplicates>> can be used to control the behavior used when duplicate lines appear in target tables with unique table keys. A component of a target object cannot occur more than once in a list behind MAPPING> and the structure component selector cannot be used to access subcomponents. This is allowed for components of the source object. If MAPPING> is used, the table types involved must also have structured line types in the basic form> and the addition DEEP> is set implicitly.
In the basic form>, t1>, t2>, ... are components of the target type and s1>, s2 >, ... are components of the parameter struct> or itab>.
In the variant with lookup table>, t1>, t2>, ... are columns of the parameter itab> and s1>, s2>, ... are columns of the parameter lookup_tab >. The content of the component specified on the right side of an equal sign in a mapping relationship is assigned to each component specified on the left side. If there is an identically named component in the target structure for a component specified on the right side, it is also assigned content, unless it is listed on the left side of a mapping relationship itself. In elementary components, the assignment is made in accordance with the associated assignment rules>. In structured and tabular components, the assignment is made in accordance with the rules of MOVE-CORRESPONDING>> with the addition EXPANDING NESTED TABLES>. Identically named components can also be listed on the right and left side of the equal sign of a mapping relationship. This is a good idea in the following cases:
If the variant with lookup table> are used, identically named components in a mapping relationship override the rule that the components s1>, s2>, ... and t1>, t2>, ... used for searches are not assigned by default.
Identically named components must be listed in a mapping relationship if a nested mapping rule is to be specified for these components.
Identically named tabular components can be listed in a mapping relationship to control the behavior of duplicate lines using duplicates>>. If the line type of a source table is elementary, the pseudo component> table_line> can be specified as a component on the right of an equal sign of a mapping relationship and the entire table line is mapped to the target component. In all other cases, the behavior is undefined when the pseudo component table_line> is specified. BEGIN_SECTION SAP_INTERNAL_HINT The implementation of table_line> handling was started with release <(>7.69/7.52<)> but is not yet finished. END_SECTION SAP_INTERNAL_HINT
ABAP_EXAMPLE_VX5 Assignment of the components of the structure struct1> to the components of the structure struct2> using mapping rules for the components at the top level and the components of the substructure. ABEXA 00970 ABAP_EXAMPLE_END
ABAP_EXAMPLE_VX5 Specification of the pseudo component > table_line> as the right side of a mapping rule. The content of the table lines of an internal table of type itab1> is copied to column col1> of an internal table of type itab2>. ABEXA 00971 ABAP_EXAMPLE_END
What does it do? The addition DEFAULT> allows the assignment of values for a target component based on an expression> expr >. The expression is evaluated before the CORRESPONDING> expression. ... MAPPING a1 = a2 b1 = DEFAULT expr1 c1 = DEFAULT expr2 ...> On the right-hand side of the assignment, DEFAULT> can be preceded by the source component. In this case, the source component's value is assigned to the left-hand side only if the source component is not initial. If it is initial, the value of the expression expr> following the DEFAULT> addition is assigned. ... MAPPING a1 = a2 b1 = b2 DEFAULT expr1 c1 = c2 DEFAULT expr2 ...>
ABAP_EXAMPLE_ABEXA CORRESPONDING> Operator Using the Additions MAPPING> and DEFAULT>> ABAP_EXAMPLE_END
ABAP Addition
What does it do? Behind EXCEPT>, components t1>, t2>, ... of the target structure or target table that are not listed in a preceding mapping relationship or an asterisk, *>, can be specified:
If explicit components t1>, t2>, ... are listed, these components of the result are not assigned content and remain initial.
If an asterisk, *>, is specified, all components of the result remain initial that are not specified explicitly in a preceding mapping relationship. Access to subcomponents of components of the target object using the structure component selector is also not allowed in the list behind EXCEPT> either. If components of the target structure are included using