Documentation View

We are hiring and constantly growing! Have a look through our vacancies to find the right role for you!

ABAPSET_NAMES - SET NAMES

ABAPSET_NAMES - SET NAMES

CPI1466 during Backup   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.
SAP E-Book

SET NAMES

SET NAMES fields FROM FLAGS src ${ MAPPING ${ TYPE p_type $}
                                        $| ${ LIKE var $}
                                $}.


Variants:

1. ... MAPPING TYPE p_type.

2. ... MAPPING LIKE var.

Effect

Used for the conversion of fields that have the technical type x and field name lists in the context of RAP. The statement deals with BDEF derived types that include the components %control and %element. The components of %control and %element have the technical type x.

The ABAP statement is targeted at applications that include, on the one hand, RAP BOs that use BDEF derived types and, on the other hand, implementations of the RAP BO behavior that use other data types. Mapping of field names is required if types are involved that have different field names than those in the underlying CDS entities of the RAP BO.

fields represents a general expression. A variable in the position of fields must be a table containing one or more field names. It is of type ABP_FIELD_NAME_TAB, the line type is ABP_FIELD_NAME. src represents a general expression. A variable in the position of src must be typed with a BDEF derived type that contains %control or %element.

As a result of the ABAP statement, the field name list fields contains those fields that have non-initial values in the %control or %element structure of src. The ABAP statement SET FLAGS does the conversion the other way round.

The following short dumps result from an operation that cannot be executed at runtime using the SET NAMES statements:

  • TCHK_TYPE_LOAD: Inappropriate type for field names.
  • BEHAVIOR_FLAGS_NAMES_ERROR: Inappropriate type on the BDEF derived type side or a missing mapping, which is true for the variants of the statement.

Variant 1

... MAPPING TYPE p_type.


Effect

Used in case type mapping is required for a structured DDIC type, for example, a legacy type. As a prerequisite, the BDEF contains a mapping specification for the mapped type. See more information in the CDS BDL topic mapping for.

Variant 2

... MAPPING LIKE var.


Effect

Used in case type mapping is required for a structured DDIC type, for example, a legacy type. This variant is relevant if the type is not available and is a variable of the required type instead. As a prerequisite, the BDEF contains a mapping specification for the mapped type. See more information in the CDS BDL topic mapping for.

Note

%element contains the names of all associations of the RAP BO. However, type mapping cannot be defined for associations. Hence, if the ABAP statement is used with mapping and a BDEF derived typed with %element, information from %element that relates to associations is lost. In this case, only the mapped component name is available in fields.

Example

The following source code section taken from DEMO_RAP_EML_SET_NAMES shows the syntax of the SET NAMES variants.

The example - Variants of SET NAMES demonstrates the three different variants with a simple managed RAP BO.






BAL Application Log Documentation   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.

Length: 6150 Date: 20230207 Time: 084838     sap01-206 ( 89 ms )