Ansicht
Dokumentation

ABENBDL_TYPE_MAPPING - BDL TYPE MAPPING

ABENBDL_TYPE_MAPPING - BDL TYPE MAPPING

TXBHW - Original Tax Base Amount in Local Currency   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.
SAP E-Book

- Type Mapping

... mapping for PartnerType           $[control ControlType$]
                                      ${$[corresponding $[extensible$]$[except Comp1,Comp2, ...$]$]$}
    {
      EntityComp1      = PartnerComp1 $[control ControlComp$];
     $[EntityComp2      = PartnerComp2 $[control ControlComp$];$]
     $[parameter Param1 = PartnerComp;$]
     $[... ;$]
    }
  $| mapping for PartnerType           $[control ControlComp$]
                                       corresponding $[extensible$]$[except Comp1,Comp2, ...$];
...


Additions

1. ... control

2. ... corresponding $[except$]

3. ... corresponding extensible

Effect

RAP type mapping maps data types of the data model that is defined in CDS for a RAP BO to other data types that do not the match BDEF derived type component pattern. Type mapping is useful for applications whose business object implements existing types or existing functions. The mapping connects a BDEF derived type to an existing DDIC type in the behavior definition of a business object.

PartnerType is the name of a DDIC structure. Within curly brackets, components that correspond to each other but don't have the same name are mapped to each other.

It is also possible to map the input parameters of actions and functions to existing types. Within the curly brackets, the keyword parameter must be used. Param1 is the name of an input parameter of an action or function.

If the names of the fields of the DDIC structure and in the current data model are exactly the same, no mapping is required. Otherwise, it is mandatory (syntax check warning).

No implementation in an ABAP behavior pool is required.

Availability

  • Development guide for the ABAP RESTful Application Programming Model, topic Using Type and Control Mapping.

Example

The following example shows a managed BDEF based on the CDS root view entity DEMO_RAP_MANAGED_ASSOC_ROOT. A type mapping from the fields of the database table to the fields of the BO entities is defined. This is required since the fields of the CDS view entities have alias names and therefore differ from the field names of the database table.

Addition 1

... control

Effect

control maps a type of the RAP business object to a control structure. A control structure has the same components as PartnerType with the difference that all components have the built-in ABAP type c(1) or x(1). Its function is to indicate which of the fields are accessed by an operation. The control structure works analogous to the %control structure in derived types. A mapping can be done simultaneously for a main type PartnerType and for a control type ControlType.

In a standard use case, the field names of the main and the control types should be identical. If this is not the case, fields can be mapped to each other using the addition control.

If a component of the main structure is missing in the control structure, this is tolerated and leads to two independently executable mappings.

Addition 2

... corresponding $[except$]

Effect

The optional addition corresponding defines that components with the same name are automatically mapped to each other. The addition except can be specified together with corresponding to exclude components with identical names from the automatic mapping.

Example: mapping for PartnerType corresponding;.

Addition 3

... corresponding extensible

Effect

The optional addition extensible enables BDEF extensions for the type mapping in question. That means that RAP BO consumers are allowed to add extension fields to that particular type mapping. extensible can only be used in combination with corresponding, so that components with the same name are automatically mapped to each other.

Example: mapping for PartnerType corresponding extensible;.

For details on extensibility enabling, see topic Extensibility Enabling.






rdisp/max_wprun_time - Maximum work process run time   General Material Data  
This documentation is copyright by SAP AG.

Length: 9185 Date: 20240419 Time: 073535     sap01-206 ( 94 ms )