Ansicht
Dokumentation

ABENBDL_NEW_ELEM_EXT - BDL NEW ELEM EXT

ABENBDL_NEW_ELEM_EXT - BDL NEW ELEM EXT

General Data in Customer Master   CPI1466 during Backup  
This documentation is copyright by SAP AG.
SAP E-Book

- Adding Elements

...
  $[determination$]
  $[validation$]
  $[field characteristics$]
  $[action$]
  $[function$]
  $[determine action$]
  $[association$]
  $[type mapping$]
  ...


Variants:

1. ... determination ...

2. ... validation ...

3. ... field characteristics ...

4. ... action ...

5. ... function ...

6. ... determine action ...

7. ... association ...

8. ... type mapping ...

Effect

The elements listed in this topic can be added to the body of an existing RAP BO entity. All of them are optional, and multiple or all of them can be specified together.

Executable examples:

  • A RAP BO with four nodes is extended with one further node on the level of the great-grandchild.

  • Ancestor associations are defined, while lock master and authorization master entities are not explicitly defined.

  • An ABAP EML call creates instances of all five nodes.

  • The original BO consists of one root node.

  • The root node is extended with extension fields. These extension fields are created on database level and added to the CDS data model via a CDS data model extension.

  • Field attributes are added to the extension fields.

  • Dynamic feature control for the extension fields is implemented in the extension ABP.

  • The original BO consists of one root node.

  • One extension node is added to the original BO.

  • The extended RAP BO implements authorization control, feature control, a validation, a determination and two actions. These implementations are distributed between original ABP and extension ABP.

  • An ABAP EML call performs multiple operations and logs the execution order of the handler methods.

Variant 1

... determination ...


Effect

  • Adds a RAP determination to the entity behavior body of an existing RAP BO entity via a BDEF extension.
  • As a prerequisite, the extended BDEF must explicitly allow the particular kind of determination (see topic about extensibility enabling).
  • Syntax: exactly the same as for RAP BOs, see topic about determinations.
  • Implementation in the extension ABAP behavior pool must obey the rules for extension ABPs.

Notes

  • The execution order of determinations and validations is arbitrary, also between original and extension components.

Example

The BDEF extension DEMO_RAP_EXT_DET_VAL extends the CDS behavior definition DEMO_RAP_BASE_DET_VAL. It adds a determination on save setStatus, which is triggered whenever a new entity instance is created.

Original BDEF: explicitly allows determinations on save in the BDEF extension header:

Extension BDEF: Defines a determination on save.

This determination is implemented in the extension ABP. It sets the field char_field automatically to status A whenever a new entity instance is created.

An executable example for a BDEF extension adding a new determination is provided in topic CDS BDL - extend determine action.

Variant 2

... validation ...


Effect

  • Adds a RAP validation to the entity behavior body of an existing RAP BO entity via a BDEF extension.
  • As a prerequisite, the extended BDEF must explicitly allow the particular kind of validation (see topic about extensibility enabling).
  • Syntax: exactly the same as for RAP BOs, see topic about validations.
  • Implementation in the extension ABAP behavior pool must obey the rules for extension ABPs.

Notes

  • The execution order of determinations and validations is arbitrary, also between original and extension components.

Example

The BDEF extension DEMO_RAP_EXT_VALIDATION extends the CDS behavior definition DEMO_RAP_BASE_DET_VAL. It adds a validation on save Limit, which is triggered when field dec_field is updated.

Original BDEF: explicitly allows validation on save in the BDEF extension header:

Extension BDEF: Defines a validation on save.

This validation is implemented in the extension ABP. It checks that the value inserted into field dec_field does not exceed 500. If it does, the validation fails and an error message is returned.

Variant 3

... field characteristics ...


Effect

  • Field attributes can be added only for extension fields. Extension fields are fields which are not part of the original BO, but are added via RAP data model extension.
  • The following field attributes are available in BDEF extensions for extension fields:
  • readonly

  • mandatory

  • suppress

  • readonly:update

  • features:instance

When implementing instance feature control for fields, the rules for extension ABPs apply.
Internal field numbering is not available in BDEF extensions.
The field characteristic mandatory:create is not available in BDEF extensions.

Example

The BDEF extension DEMO_EXTENSION_RAP_BO extends the CDS behavior definition DEMO_RAP_FIELD_EXT. It behavior-enables multiple extension fields.

The example above is described in detail in topic CDS BDL - Field Extension.

Variant 4

... action ...


Effect

  • Adds a RAP action to the entity behavior body of an existing RAP BO entity.
  • Implementation in the extension ABAP behavior pool must obey the rules for extension ABPs.

Example

The BDEF extension DEMO_RAP_BEH_EXT_CH extends the CDS behavior definition DEMO_RAP_BEH_EXT. It adds action setValue to the behavior definition body.

The example above is described in detail in topic CDS BDL - Behavior Extension.

Variant 5

... function ...


Effect

  • Adds a RAP function to the entity behavior body of an existing RAP BO entity.
  • Implementation in the extension ABAP behavior pool must obey the rules for extension ABPs.

Variant 6

... determine action ...


Effect

  • Only determinations and validations from the same BDEF extension can be assigned. Determinations and validations from the original BDEF must not be assigned.

Variant 7

... association ...


Effect

Example

The BDEF extension DEMO_RAP_EXTENSION_1 extends the CDS behavior definition DEMO_RAP_EXTENSIBLE_ROOT. The first section of this extension extends an existing node by behavior-enabling the association _Children4Ext. The association target is an extension node.

The example above is described in detail in topic CDS BDL - Node Extension.

Variant 8

... type mapping ...


Effect

  • Adds a RAP type mapping to the entity behavior body of an existing RAP BO entity. This type mapping can only contain extension fields. It must not contain any fields from the original BDEF.

Example

The BDEF extension DEMO_RAP_EXT_MAPPING extends the CDS behavior definition DEMO_RAP_BASE_MAPPING. It adds a type mapping to structure DEMO_RAP_STRUC. The fields used in this type mapping are extension fields that are added to the data model via a CDS view entity extension.






General Material Data   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 19156 Date: 20240511 Time: 152049     sap01-206 ( 183 ms )