Ansicht
Dokumentation

ABENCDS_F1_COND_USER - CDS F1 COND USER

ABENCDS_F1_COND_USER - CDS F1 COND USER

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

- DEFINE ROLE, user_condition

...$[ALL$|EXISTS$] element =$|<>$|?= ASPECT user ...

Variants:

1. ... ( element ) = ASPECT user_alias ...

2. ... ( element ) = ASPECT user_business_partner_number ...

Addition:

... ALL$|EXISTS

Effect

User condition as part of an access condition cds_cond in an access rule of the statement DEFINE ROLE in CDS DCL. In a user condition, the predefined aspect user is specified on the right side introduced with ASPECT.

The left side is compared with the user name of the user currently logged on to AS ABAP by using one of the three operators =, <>, ?=, as in a literal condition.

The behavior when element is declared as optional element and missing at runtime is the same as for literal conditions.

Notes

  • A user condition acts like a comparison with the session variable $session.user in the CDS DDL. It is not currently possible to use session variables on the right side of conditions in DCL.
  • The behavior when an element is declared as optional element and is missing at runtime matches the one for literal conditions.

Variant 1

... ( element ) = ASPECT user_alias ...


Effect

The value of the alias can be checked instead of the user name.

If the user does not have an alias, the condition behaves like the Boolean predicate FALSE.

Variant 2

... ( element ) = ASPECT user_business_partner_number ...


Effect

The number of the business partner assigned to the user can be checked instead of the user name.

If the user does not have an assigned business partner, the condition behaves like the Boolean predicate FALSE.

Addition

... ALL$|EXISTS

Effect

The ALL or EXISTS quantifiers can be specified for user conditions and behave as for literal conditions.

Example

The following CDS view contains an element uname, which contains a user name:

The following role can be defined for the view:

The role grants a user AS ABAP access to his or her own entries in the DDIC database table ABDOCMODE, as well as to entries in which the UNAME column is initial or contains a null value.






ROGBILLS - Synchronize billing plans   General Data in Customer Master  
This documentation is copyright by SAP AG.

Length: 5883 Date: 20240329 Time: 165511     sap01-206 ( 61 ms )