Ansicht
Dokumentation

ABAPSET_FLAGS - SET FLAGS

ABAPSET_FLAGS - SET FLAGS

ROGBILLS - Synchronize billing plans   General Material Data  
This documentation is copyright by SAP AG.
SAP E-Book

SET FLAGS

SET FLAGS src FROM NAMES fields ${ 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.

src represents a variable typed with a BDEF derived type that contains %control or %element. 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.

As a result of the ABAP statement, the field names contained in the table get identified as component names in the %control or %element structure and their value is set to 01. If field names do not exist in fields, the value in the structures is set to 00. The ABAP statement SET NAMES does the conversion the other way round.

The following short dumps result from an operation that cannot be executed at runtime using the SET FLAGS 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. fields must contain the field names of the 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. fields must contain the field names of the 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.

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 FLAGS demonstrates the three different variants with a simple managed RAP BO.






Addresses (Business Address Services)   ABAP Short Reference  
This documentation is copyright by SAP AG.

Length: 5864 Date: 20240329 Time: 001352     sap01-206 ( 107 ms )