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."
S/4 HANA Cloud
Reproducing the Issue
- App Custom Fields and Logic, Substitution or Validation created using CDS View (Check if there is CDS selection in BAdI implementation)
- In BAdI implementation, only “released” CDS views can be used.
- In App View Browser (App ID F2170) , you can check if CDS view is Released.
- For example take CDS view I_GLACCOUNTINCHARTOFACCOUNTS, this has status released.
- 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)
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”.
In Custom fields and Logic App for BADI
Add "WITH PRIVILEGED ACCESS" after "SELECT XXX FROM XXX" in order to bypass the authorization check.
WITH PRIVILEGED ACCESS
WITH PRIVILEGED ACCESS, CDS, DCL, Data Control Language, authorizationCheck, authorization, restriction, pfcg_auth, su21, access control, ACCESSCONTROL.AUTHORIZATIONCHECK
, KBA , FI-SL-VSR , Validation, Substitution and Rules , AC-INT , Accounting Interface , Problem