This is the 4th part of this blog .

SAP CRM/SolMan ChaRM:  Multiple Target Agents via SAP Workflow – Minimal ABAP Development

http://scn.sap.com/community/it-management/alm/solution-manager/blog/2014/01/21/sap-crmsolman-charm-multiple-target-agents-via-sap-workflow–minimal-abap-development

Second part can be accessed:

http://scn.sap.com/community/it-management/alm/solution-manager/blog/2014/01/22/sap-crmsolman-charm-multiple-target-agents-via-sap-workflow–minimal-abap-development–part-2

Third part can be accessed:

http://scn.sap.com/community/it-management/alm/solution-manager/blog/2014/01/23/sap-crmsolman-charm-multiple-target-agents-via-sap-workflow–minimal-abap-development–part-3-last

In the link of part 3 appears the word last at the .  That is because with parts 1 to 3 this we consider you have all the elements we researched to do our work and begin working with WF in ChaRM.     This part 4 will show how to test the WF as well as running the full scenario using the Web UI plus getting additional details behind the WF scene like how to trace and troubleshoot.

Let’s test the WF itself.

We select one of our RfCs.

PFAC_7B.gif

Based on table CRMD_ORDERADM_H we get the GUID #.

CRMD_ORDERADM_I.png

Back to SWDD, we click on the test button and provide the mandatory import parameter the GUID #.

SWDD_WS99900020_Q.gif

SWDD_WS99900020_R.gif

You get a confirmation that the task is in process.

SWDD_WS99900020_S.gif

And from there we can access all the logs.  Click the Workflow Log button and there are lots of screens there to see, but we will just point a couple of them.  The one below gives you access to the Agents that are to process the task to review the RfC.  Click on that button and then on Agents.

SWDD_WS99900020_T.gif

As you can see, based on the manager’s requirements, even though Requester (Delegate Number 1) is a Delegate, that user is removed from the list of agents to get the Task.  Just the OU’s Team  Lead and the other Delegates get notified.

SWDD_WS99900020_U.gif

Back to the main log screen, selecting the button you get access to see the individual steps of the WF and e.g. access the container contents of that particular step.  That helps as you can find out you are not passing the correct parameters and need to fix the binding in the WF, etc.

SWDD_WS99900020_V.gif

SWDD_WS99900020_W.gif

Finally, you can see if the overall WF is stopping at the task it is supposed to be stopped waiting for an asynchronous task to be performed.

SWDD_WS99900020_X.gif

SWDD_WS99900020_Y.gif

etc.   You can continue or quit SWDD.

Before we create a fresh scenario, we need to enable WF event tracing.  Go to transaction SWELS and make sure event tracing is on.

SWELS.gif

Now, let’s create a fresh scenario and for that we will logon as The Boss.  We will create a RfC and place it in phase Validation.  The Boss and all Delegates should be notified in their WebUI’s Worklist.   Once any of those Agents moves the RfC to the next phase To Be Approved, the Task in all the Worklists will disappear.

CRM_UI_1.gif

CRM_UI_2.gif

You can access the Worklist and the entry was added there.

CRM_UI_3.gif

Before we access the document to Validate it, let’s see what happens behind the scenes.

Launch transaction SWEL and execute it.  The event that starts the WF was launched.

SWEL_1.gif

You can double-click on that entry and it will take you to the same Workflow log we access before.

But, what does really control that the WF Task is waiting for an action?  Transaction SWE3 has the answer.   There is an entry automatically created there by the WF Task with the terminating event REQUESTTOBEAPPROVEDNEW.  If you select that line and double-click on Object Data you will get access to a list of different GUIDs of RfCs that are in phase Validation (ready to be processed).

SWE3_1.gif

SWE3_2.gif

You can confirm with table CRMD_ORDERADM_H that the GUID corresponds to the RfC.

CRMD_ORDERADM_J.png

Check on the screen above that there is a receiver key 20137, which is reflected in the WF log you can access through SWEL.

SWEL_3.gif

Those key values are important as when the event to terminate the task is triggered, it will find the exact entry in SWE3 (Table SWFDVEVINS) to remove it from there, leaving the other entries there untouched.

Let’s go back to the Web UI and click on our RfC entry in the worklist to review it and promote it to the next phase.   The description is the one you entered when created the Task.  Below WF adds the link to the RfC.  You can click on it to open it.

CRM_UI_4.gif

We validate the RfC and promote it to the next phase.

CRM_UI_4.gif

A couple of things:  The RfC gets removed from the Worklist and the WF log diagram shows that the WF for this RfC is completed.

CRM_UI_6.gif

SWEL shows that the terminating event was triggered.

SWEL_4.gif

Double-clicking on that entry in the log we click the graphical button and see that the WF is completed.

SWEL_5.gif

You can confirm that the document does not exist any longer in SWE3.

SWE3_3.gif

I guess that is sufficient for this blog.

Let’s just add that there is a table SWWWIHEAD that keeps information that can help troubleshooting.  The list was sorted descending and shows in the red square the different steps the RfC has gone through.  Some completed, some ready.    Accessing that table you can find if, e.g. a RfC phase is on error status.

SWWWIHEAD.gif

Some bibliography for you.

1. The 2 workflow pack:

  • Practical WF forSAP 2nd Ed.  All the book.  It covers almost anything in WF.  Excellent.
  • ABAP Development for SAP Business  Workflow    A couple of tips we got to understand the ABAP programming instructions.  Good complement for WF developers

http://www.sap-press.com/products/The-Workflow-2%252dpack.html

2. Hoping this does not create a conflict.  With all the respect, the guys from http://www.****************.    Good examples to learn WF.

3. Mr Nathan Williams and his wonderful book:  IT Service Management in SAP Solution Manager.   I still do not understand how one guy can do so much and to top it off, he is a musician.  Can you believe that?

http://www.sap-press.com/products/IT-Service-Management-in-SAP-Solution-Manager.html

4.  BRFPlus – Business Rule management for ABAP Applications.

http://www.sap-press.com/products/BRFplus-%E2%80%94-Business-Rule-Management-for-ABAP-Applications.html

5.  BRFPlus.  There is this 1-2 days training in BRFplus you can get for free.  Excellent material, well organized.   There are 3 sessions in particular that tell you how it works.

http://scn.sap.com/docs/DOC-8824?rid=/webcontent/uuid/90754865-f283-2b10-6d9f-b10f3c28c3a0

And the bonus … a BRFPlus example.

http://scn.sap.com/community/it-management/alm/solution-manager/blog/2014/01/24/basic-brfplus-example-to-confirm-if-an-employee-is-a-team-lead-manager-or-not

Enjoy,

Juan-Carlos

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

    1. Juan-Carlos Garcia-Garavito Post author

      You are very welcome Raghavendra.  It has been a painful but rewarding experience to come up with our solution as there were many approaches on SCN to this, but none of them fit our needs.   We are not saying they were not good, as many were, but it is the usual case when you arrive to a company and they have a unique way of doing businesses, and you, as the consultant, have to dig and dig to get the bone.   

      When we discovered the WF there, we found its potential and now we are limitless.  We are work flowing many things in our ChaRM solution and enjoying the trip.

      At least a way to return a bit of what I have received from my colleagues.

      Regards,

      Juan

      (0) 

Leave a Reply