Ansicht
Dokumentation

ABENBDL_FIELD_PROJECTION - BDL FIELD PROJECTION

ABENBDL_FIELD_PROJECTION - BDL FIELD PROJECTION

Fill RESBD Structure from EBP Component Structure   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.
SAP E-Book

- Field Characteristics, Projection BDEF

Field characteristics that can be added for regular fields

... field(readonly) Field1, Field2, ...;
  $| field(mandatory) Field1, Field2, ...;
  $| field(mandatory:create) Field1, Field2, ...;
  $| field(readonly:update) Field1, Field2, ...;
  $| field(suppress) Field1, Field2, ...;


Field characteristics that can be added for virtual fields

... field(modify$[,FieldChar$])VirtualField1, VirtualField2, ...;

Alternatives:

1. field(FieldChar) Field1, Field2, ...

2. field(modify$[,FieldChar$])VirtualField1, VirtualField2, ...

Effect

A projection BDEF automatically and implicitly inherits all field characteristics of its underlying projected BDEF. Field characteristics that don't require an implementation in the ABAP behavior pool can be added in the projection layer under the condition that the base BDEF hasn't already specified any field characteristics for the respective field.

Field characteristics that require an implementation (currently, this is the case only for features:instance) can't be newly added for regular fields, but for augmented virtual elements.

Read the sections below for further details.

Notes

  • Managed internal numbering, specified using they keyword numbering:managed, is inherited and it can't be newly defined in a projection BDEF.

Alternative 1

field(FieldChar) Field1, Field2, ...




Effect

The following field characteristics can be newly added in a projection BDEF:

  • mandatory
  • readonly
  • mandatory:create
  • readonly:update
  • suppress

Topic CDS BDL - field characteristics describes how they work.

If there's already field control defined in the underlying base BDEF, the projection BDEF can't define other field characteristics for the same field(s). Any such attempt leads to a syntax check error.

In a managed or unmanaged RAP BO, multiple field characteristics can be combined. In a projection BDEF, there's only one valid combination: mandatory:create, readonly:update.

Commas can be used to classify multiple fields in the same way. Example: field(readonly) Field1, Field2, Field3;.

Example

The following example demonstrates inheritance. The projection BDEF inherits managed internal numbering from its projected BDEF and therefore, the primary key field KEY_FIELD is automatically assigned a value.

The ABAP program DEMO_RAP_PROJECTION_NUMBERING uses EML to access to RAP business object and performs the following steps:

  • It creates three entity instances by specifying a value for the field char_field1.
  • It commits the three new entity instances to the database.
  • Using the SELECT statement, it displays the content of the underlying database table. It can be seen that the primary key field KEY_FIELD of each entity instance contains a value, which was generated by means of managed early numbering.

Code Snippet:

Result: values for the primary key field are generated automatically.

IMAGE @@ABDOC_INTERNAL_NUMB.png@@358@@106@@

Alternative 2

field(modify$[,FieldChar$]) Virt1, ...


Effect

CDS projection views may contain CDS virtual elements (defined using the keyword VIRTUAL), fields defined by association traversal (path expressions), or localized fields (defined using the keyword LOCALIZED). Such fields are automatically and implicitly set to read-only. They are excluded from the BDEF derived types and a RAP BO consumer can't update those fields.

A way to enable those field for transactional processing is by using the operation augment. The following syntax can be used to augment a field and thus include it in transactional handling:

field(modify$[, FieldChar$]) VirtualField;

An augment-enabled virtual field can be controlled with the following field characteristics FieldChar:

  • mandatory
  • readonly
  • mandatory:create
  • readonly:update
  • features:instance
  • A prerequisite for using features:instance on a virtual field is that BDEF strict mode is enabled.

For further details on the operation augment, see topic CDS BDL - augment, projection BDEF.






Addresses (Business Address Services)   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.

Length: 9625 Date: 20240328 Time: 201513     sap01-206 ( 93 ms )