SAP Knowledge Base Article - Public

2868600 - Validation and Substitution not working for Cloud badi using CDS view

Symptom

 Validation and Substitution not working for Cloud BADI using CDS view

"Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental."

Environment

SAP S/4HANA Cloud Public Edition

Reproducing the Issue

  1. App Custom Logic, Substitution or Validation created using CDS View (Check if there is CDS selection in BAdI implementation)

  2. In BAdI implementation, only "released" CDS views can be used. 
     
  3. In App View Browser (App ID F2170) , you can check if CDS view is Released. 

  4. For example take CDS view I_GLACCOUNTINCHARTOFACCOUNTS, this has status released.

    viewbrowser.png


  5. View Details. Select tab Annotation here you see Annotation: ACCESSCONTROL.AUTHORIZATIONCHECK  True: #CHECK. This means that this CDS view is with DCL (Data Control Language - authorization check)

    accesscontrol.png

  6. For API it could be, that the communication user does not have sufficient access privileges/authorities to read the information from cds-views.

  7. Check code at the select-statement in Custom Logic App. 

Cause


Many CDS views are with DCL. If you want to select data from CDS view in BAdI implementation, you should decide if you need this DCL check. If not, add “WITH PRIVILEGED ACCESS”.

Resolution

In Custom Logic App for BADI

Add "WITH PRIVILEGED ACCESS" after "SELECT XXX FROM XXX" in order to bypass the authorization check.

SELECT xxx
FROM XXX
WITH PRIVILEGED ACCESS

See Also

 2676581 - FAQ: Validation and Substitution Cloud BAdIs Availability

2462725 - FAQ: Validation and Substitution for Journal Entries in SAP S/4HANA Cloud Public Edition

Keywords

WITH PRIVILEGED ACCESS, CDS, DCL, Data Control Language, authorizationCheck, authorization, restriction, pfcg_auth, su21,  access control, ACCESSCONTROL.AUTHORIZATIONCHECK, API

 
, KBA , FI-SL-VSR , Validation, Substitution and Rules , AC-INT , Accounting Interface , FI-SL-VSR-2CL , Validation, Substitution and Rules (Public Cloud) , Problem

Product

SAP S/4HANA Cloud Public Edition all versions