Get Example source ABAP code based on a different SAP table
ID SET-FLAGS • SET FLAGS ABAP_STATEMENT_EML • FROM NAMES SET FLAGS • MAPPING TYPE SET FLAGS • MAPPING LIKE SET FLAGS
SET FLAGS>
ABAP_SYNTAX SET FLAGS src FROM NAMES fields ${ MAPPING ${ TYPE p_type $} $| ${ LIKE var $} $}.>
ABAP_VARIANTS: 1 ... MAPPING TYPE p_type.> 2 ... MAPPING LIKE var.>
What does it do? 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.
ABAP_VARIANT_1 ... MAPPING TYPE p_type.>
What does it do? 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 RAP BDL topic mapping for>>.
ABAP_VARIANT_2 ... MAPPING LIKE var.>
What does it do? 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 RAP BDL topic mapping for>>.
ABAP_EXAMPLE_VX5 The following source code section taken from CL_DEMO_RAP_EML_SET_NAMES>> shows the syntax of the SET NAMES > variants. ABEXA 01554 ABAP_EXAMPLE_END
ABAP_EXAMPLE_ABEXA The example ABAP_EML - Variants of SET FLAGS>> demonstrates the three different variants with a simple managed RAP BO. ABAP_EXAMPLE_END