转 Forward a work item to your own currently logged in SAP ID

Forward a work item to your own currently logged in SAP ID

By Anirban Bhattacharjee, KPIT Cummins and Infosystems from Link

Purpose: The purpose of this document is to demonstrate how you can forward a work item to your own ID. This is not possible via the standard transaction SWIA. For example, if your SAP ID is XYZZ and you are logged into SAP via this ID, you would try to forward the work item to this same ID by running SWIA. This transaction you are executing from this ID itself. But SWIA will give you the prompt “You cannot choose yourself as an agent” and not allow this forward.

 

Business Scenario: Many times when testing various workflow developments, we need to forward a work item to our own ID for testing purposes. Sometimes it becomes difficult to maintain our own ID in the Agent / Approver tables as they might need Customizing Transport Requests or other business constraints. Standard T-Code SWIA does not allow forwarding the work items to your own ID. On such situations we either need to forward the work item to some other test IDs or ask someone else to do it for us.

Not any more, as with this technique you can even forward any work item to yourself while you are logged in via that same SAP ID and be able to do your testing.

Process: The steps are very simple

·         We will take a work item and first try to forward it to the current logged in SAP ID (self ID) via T-Code SWIA. This will not work.

·         We will then use a special function module to forward this work item to our own logged in SAP ID.

Looking at a work item in the workflow log

Here the following foreground work item currently does not have any agents assigned to it.

扫描二维码关注公众号,回复: 1135380 查看本文章

We check the work item ID from the technical log

The work item ID for the user decision step is 2733499. We will now run transaction SWIA and enter this work item ID

Now we will select this row and try to forward it to the logged in ID via which this workflow is been tested and this transaction is being executed

SWIA gives the following prompt when I try to forward the work item to the current logged in ID via which SWIA is being executed and workflow being tested

The transaction SWIA prompts; “You cannot choose yourself as an agent” and does not allow the Administrator Forward.

Process to forward this work item to self:

Now to make this possible, we need to run the function module:

SWW_WI_FORWARD

This highly useful function module allows you to skip any previous checks and forward to any desired Agent / Approver, including self.

We need to enter the same work item ID for the user decision step 2733499. This we had entered previously in SWIA.

Pass the importing parameter PRECONDITIONS_CHECKED as “X”. This will ensure no conditions are checked!!!

In the TABLES parameter NEW_AGENTS, pass your own logged in SAP ID, like US-XXYYZZ.

This should be the same agent to whom you tried to forward via SWIA but it failed. So this will be the self logged in ID.

The function module screen will look as shown

Now execute the function module. We will see the function module returns the work item status as READY with the selected new agent

To verify that the WI forward worked as expected, we look at the workflow log – agents again

We can see now that the log does not say “No selected agents”, but is showing our own ID to which we forwarded the work item to.

Also note the e-mail like icon, indicates that the work item came as a forward.

In technical log, the step details also confirms that the Forward was a success

Checking in business work place SBWP, to verify with certainty that the work item did get forwarded successfully to own logged in ID

Conclusion: Thus we have successfully forwarded a dialog / foreground work item to own logged in ID even when standard transaction SWIA did not allow the administrator forward to self.

猜你喜欢

转载自sapabap.iteye.com/blog/1917167