Symptom
Custom logic implementation fails for SAP_WFRT user due to authorization issues.
Environment
SAP S/4HANA Cloud
Reproducing the Issue
- Go to the Custom Fields and Logic app
- Create new custom logic for an implementation that will use the workflow user SAP_WFRT
- Examples are Workflow Agent Determination
- The Custom Logic will have a SELECT statement to get data from a CDS view
- Test the logic, which will be successful
- Now when the logic is actually being called (example of creating a new purchase requisition) the logic may fail
Cause
The business user testing the logic had authorization to select data from a CDS View, but the SAP_WFRT user does not have authorization.
Resolution
In this case adding WITH PRIVILEGED ACCESS to the SELECT statement will allow the logic to succeed.
As an example for I_ProfitCenter it would look like:
SELECT SINGLE profitctrresponsibleuser FROM I_ProfitCenter WITH PRIVILEGED ACCESS INTO CORRESPONDING FIELDS OF [ ... ]
See Also
Keywords
Custom Fields and Logic, Custom Logic CDS View, SELECT WITH PRIVILEGED ACCESS, workflow, BAdI , KBA , MM-IV-INT-WF , Workflow , BC-SRV-APS-EXT-BL , Custom Business Logic , Problem
Product
SAP S/4HANA Cloud all versions