cancel
Showing results for 
Search instead for 
Did you mean: 

Flexible Workflow - Additional Condition for Steps - Where can I get the step number from?

afordham
Participant
0 Kudos
1,486

Hi,

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!

Many thanks,

OwenLiu
Product and Topic Expert
Product and Topic Expert
0 Kudos

Change tag to Source and Procurement

Accepted Solutions (0)

Answers (1)

Answers (1)

fegutieri
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Andrew,

Unfortunately I didn't have the time to perform a test in one of our internal S/4HANA Cloud environments, however I believe that the information you might be wanting to find should be found in the internal table it_parameter_value. If the ID is not found, maybe you can find the condition name in the field "name". You can also take a look at a sample scenario posted in one of our blogs some time ago: SAP S/4HANA Cloud – Flexible Workflow with new custom Pre-Condition for Purchase Requisition. It is an example for a purchase requisition but it is also applicable to supplier invoices.

Please, let me know if this clarifies your doubt.

Have a great week.

fegutieri
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Andrew,

Please let me know in case my answer helps you by marking it as "answered".

Thanks