Friday 15 May 2020

What’s new in S/4 Workflows: CDS Views and Flexible AMDP Class

My Goal here (and make it a Blog Series) is to “bring” what’s new on SAP Workflow on S/4.

ABAP Development, SAP ABAP Tutorials and Material, SAP ABAP Exam Prep, SAP ABAP Guides


First of all, “calm down”, Classical Workflows (as they’re now called) still work on S/4 (using BOR, CL, etc.) and we got introduced to Flexible Workflows (so that the approval “process” can be configured by the business area using FIORI Apps), changing how you develop them (using TCode SWDD_SCENARIO).

This time i’m not gonna go deep in Flex WFs here, but bring you 2 “news” in the WF area on S/4.

1: CDS View I_WorkflowTask

The standard CDS View I_WorkflowTask brings you almost everything you need to know regarding Workflow Instances (as the first select is in the “old” SWWWIHEAD):

ABAP Development, SAP ABAP Tutorials and Material, SAP ABAP Exam Prep, SAP ABAP Guides

As you can see, it has several associations to other relevant WF related CDS Views (i suggest you to explore them). All are published:

ABAP Development, SAP ABAP Tutorials and Material, SAP ABAP Exam Prep, SAP ABAP Guides

Let’s bring an example, of a Flexible WF Process:

ABAP Development, SAP ABAP Tutorials and Material, SAP ABAP Exam Prep, SAP ABAP Guides

ID 45103:

ABAP Development, SAP ABAP Tutorials and Material, SAP ABAP Exam Prep, SAP ABAP Guides

ABAP Development, SAP ABAP Tutorials and Material, SAP ABAP Exam Prep, SAP ABAP Guides

Association to _TaskStartEvent:

ABAP Development, SAP ABAP Tutorials and Material, SAP ABAP Exam Prep, SAP ABAP Guides

So now you can see ho technically started the WF process:

ABAP Development, SAP ABAP Tutorials and Material, SAP ABAP Exam Prep, SAP ABAP Guides

Another example, let’s get a Decision Task ID:

ABAP Development, SAP ABAP Tutorials and Material, SAP ABAP Exam Prep, SAP ABAP Guides

And use the association to _TaskRecipient:

ABAP Development, SAP ABAP Tutorials and Material, SAP ABAP Exam Prep, SAP ABAP Guides

Now you can see all the users that have the Open Task on their Inboxes:

ABAP Development, SAP ABAP Tutorials and Material, SAP ABAP Exam Prep, SAP ABAP Guides

So anytime you need WF related data, don’t forget about I_WorkflowTask CDS View!

2: Flexible Workflow “Technical Background”:

Every time you create a Flex WF using SWDD_SCENARIO, like the one below:

ABAP Development, SAP ABAP Tutorials and Material, SAP ABAP Exam Prep, SAP ABAP Guides

It’s also created:

1 – A CDS View:

ABAP Development, SAP ABAP Tutorials and Material, SAP ABAP Exam Prep, SAP ABAP Guides

2 – Table Function CDS:

ABAP Development, SAP ABAP Tutorials and Material, SAP ABAP Exam Prep, SAP ABAP Guides

2.1 – That reads data from a generated AMDP Class:

ABAP Development, SAP ABAP Tutorials and Material, SAP ABAP Exam Prep, SAP ABAP Guides

It’s all automatic, for you to use as you need.

No comments:

Post a Comment