SAP Knowledge Base Article - Public

2766198 - SAP_WFRT Authorization Issues With Custom Logic

Symptom

Custom logic implementation fails for SAP_WFRT user due to authorization issues.

Environment

SAP S/4HANA Cloud

Reproducing the Issue

  1. Go to the Custom Fields and Logic app
  2. 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
  3. Test the logic, which will be successful
  4. 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 has authorization to select data from a CDS View, but the user SAP_WFRT does not have authorization.

Resolution

In this case adding 'WITH PRIVILEGED ACCESS' to the SELECT statement will allow the user SAP_WFRT to select data from CDS view.

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

ABAP SELECT Statement 753

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 Public Edition all versions ; SAP S/4HANA Cloud all versions