Skip to content

ABAP Keyword Documentation →  ABAP Dictionary →  ABAP CDS in ABAP Dictionary →  ABAP CDS - Authorizations →  ABAP CDS - DCL Statements →  ABAP CDS - DEFINE ROLE →  ABAP CDS - DEFINE ROLE, condition 

This functionality is not yet released and must not be used

ABAP CDS - DEFINE ROLE, Literal Conditions

Other versions: 7.31 | 7.40 | 7.54

Syntax


... path_expr operator 'value' ...

Effect

Condition of the WHERE clause of the statement DEFINE ROLE in the ABAP CDS DCL for mapping roles and assignment roles. In a literal condition of this type, an association of the CDS entity is compared with a fixed value 'value' in a relational expression using a logical operator operator. This is done in a path expression path_expr in DDL syntax.


Note

Within the definition of a role, literal conditions can be used either together with conditions for mapping roles or together with conditions for assignment roles or even as individual conditions.


Example

The following assignment role contains a literal condition that restricts access to those sales orders assigned to the current user.

@EndUserText.label: 'ACM-Testrole on SalesOrder: Restricted by Delivery'
ROLE acmtest_salesorder_delivery {
   grant SELECT on sacm_cds_snwd_so
      WHERE toemployee.login_name = aspect ACMTEST_Employee_Username
      AND delivery_status = ' '; }

The literal condition requires the field delivery_status of the CDS entity sacm_cds_snwd_so to be initial. The combination with the aspect dictates that a user can only access an item in the CDS entity where this condition is met and the user has the associated authorization.