We are using Flexible Workflow for Supplier Invoice approval in S/4HANA Cloud and have implemented an additional condition at the Step level (BAdI definition SWF_WORKFLOW_CONDITION_DEF). We can see our custom condition when setting up a workflow and have assigned it to multiple steps.
I need to execute different logic depending on which step is currently being evaluated. When I trace the runtime of our implementation of the evaluation BAdI (definiton SWF_WORKFLOW_CONDITION_EVAL), I cannot find any information about the Step number in the importing parameters. The Supplier Invoice and Fiscal Year are supplied in the first two SONT_KEY_PART_n components of the IS_SAP_OBJECT_NODE_TYPE parameter, but no Step number.
If I cannot get the Step number from the importing parameters, is there a released S/4HANA Cloud CDS view from which I can get the Steps that have already been processed? I cannot use the I_WorkflowStatusDetails CDS view, as a workflow task does not get created when a Step is skipped. I can see the information I want at the bottom of the detail page in the Supplier Invoices List app, but I can't find a way of getting hold of that info in the BAdI implementation.
Any help would be greatly appreciated!