SAP CDS DCL CON STRUC
Get Example source ABAP code based on a different SAP table
SAP_ONLY
ABAP_CDS_DCL - Structure of the Access Control Context
The following picture shows the structure of the access control context:
_Containers
__
__Aggregated Element A
__Aggregated Element B
__
__Grouped Element C
__Grouped Element D
__
__Gated Field U
__Gate Value 1 for Field U
__Gate Value 2 for Field U
__Gated Field V
__Gate Value 1 for Field V
__Protected Element Masking
__
__Element G
__Masking Value for Element G in Entity X
__Element H
__Masking Value for Element H in Entity X
__
__Element J
__Masking Value for Element J in Entity Y
__
__NODE1
__Value 11
__NODE2
__NODE21
__NODE22
__Value221
__Value222
__
...>
Text in bold indicates structure components that are singletons in the sense that they can only be written by a single ABAP code layer during creation. For more details, refer to the section
Containers
Containers are predefined sections in the access control context that can be addressed
They primarily serve as an aid in the communication between frameworks and consumers.
Currently, containers exist to express the following types of information:
Namespaces
For use cases where the predefined containers are not sufficient, applications can request to receive a namespace in which they can create their own data structures.
Providing a namespace is a development task in component
The two existing namespaces
Creating an Access Control Context
The access control context is created using the ABAP class
The access control context as created by the class must be passed to the runtime system using a service method. The data is then valid for the source code in the current ABAP call stack after this line, and for called methods from this point on. However, it is discarded when the current stack frame is left.
If several layers of ABAP code want to use the access control context to pass data to the runtime system, conflicts can occur if two layers want to provide the same type of data. This is prevented by an exception when the access control context is set.
In the above diagram, the bold written parts are such singletons, which can only be accessed by a single layer of ABAP code. For example, only a single layer can specify the grouping fields, while protected element masking can be specified by different layers, unless they operate on different entities.