Get Example source ABAP code based on a different SAP table
• DEEP MAPPING FOR ABAP_BDL_ABSTRACT • SUB ABAP_BDL_ABSTRACT • CORRESPONDING ABAP_BDL_ABSTRACT
ABAP_RAP - Mapping, Abstract BDEF
ABAP_SYNTAX_FORMS
Type Mapping ... mapping for PartnerType> ...>
Deep Mapping ... deep mapping for NestedDeepDDICType $[corresponding$] { EntityComp1 = PartnerComp1 $[...$] $[sub _Compos1 = Partnersub1$]$[, sub _Compos2 = Partnersub2$] $[...$] } ...>
ABAP_ALTERNATIVES: 1 mapping for PartnerType ...> 2 deep mapping for NestedDeepDDICType ...>
What does it do? RAP type mapping> maps data types of the abstract BDEF to DDIC partner types. If the DDIC partner type is a flat structure> and only elementary data types are mapped, flat type mapping can be used. If the DDIC partner type is a nested or deep structure >, deep mapping can be used. It defines a mapping for nested table components or substructures.
ABAP Alternative 1 mapping for PartnerType ...>
What does it do? To map elements to flat DDIC structures, type mapping using the syntax mapping for PartnerType> can be used. The syntax is the same as for managed> and unmanaged RAP BOs> and it is described in topic RAP BDL - type mapping>.
ABAP Alternative 2 deep mapping for NestedDeepDDICType ...>
What does it do? In an abstract BDEF with hierarchy>, mappings can be defined between the generated hierarchical derived types and nested or deep DDIC types. Such a mapping must be introduced with the keyword deep>. The optional addition sub> can be used for sub> specifications. Child entities with a composition cardinality > 1 can be mapped to nested table components. If the composition cardinality is <= 1, a mapping to a substructure can be defined. Syntax for sub> specification: sub _Compos1 = Partnersub1> The left-hand side of a sub> equation sub _Compos1> contains the name of a composition association of the entity. The right-hand side contains the name of a component PartnerComp1> of the nested or deep partner type NestedDeepDDICType>. The components that are mapped onto each other must match, both must be either tables or structures. To cover the full hierarchical derived type, such a mapping must be defined for every entity in the abstract composition hierarchy and its corresponding partner type, with sub> specifications for child entities at each level.
ABAP_EXAMPLE_VX5 The following abstract BDEF defines the behavior for three nodes of a CDS composition tree. For each entity, a mapping to a partner type is defined. BDEF DEMO_CDS_ABSTRACT_ROOT ABAP_EXAMPLE_END