cancel
Showing results for 
Search instead for 
Did you mean: 

SAP tables for the actual and the responcible agent of the workitem

Former Member
0 Kudos

Hi Workflow Gurus,

How to display the workitems which is executed by substitute in the list of resow ponsible agent?

Is the information is stored in table where the actual agent and the responsible agents are stored?

We have the requirement as below:

1. The work item belongs to Agent 'A'.

2. The Agent 'A' has kept the substitution rule to receive workitems to Agent 'B'.

3. In the UWL list of Agent 'B', the work item of Agent 'A' is appearing.

4. Now Agent 'B' has appeoved the workitem where Agent 'A' is responsible agent.

5. Now the Agent 'B' is the actual agent for the workitem.

We need to create the report where we need to show the workitem with actual and responsible agent where the work item and workflow status is complete.

How do we get this information? Is it stored in any SAP table?

Do we have any Function modules to get this information?

Thanks in advance.

BR, Santosh

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

I think there is a simple way. Do one thing store the user who are responsible users in a container element RESPAGENT in the workflow container. Then in the task level where you have the activity step do a binding from wi_actual_agent ->ActualAgent container element in wflow hich you create. If the 2 container element value is different RESPAGENT and ACTUALAGENT then set a flag in the workflow container. Then you should read the table SWWWIHEAD and pick the top WIID and then get the workflow ID and check this in table SWW_CONT with the Flag as set and then you get them.

Thnaks

Arghadip

Former Member
0 Kudos

Hi Gurus,

Is there a table where the information of Responsible and actual agent is stored for the completed work items?

The report which we are developing is where we will store the information of the responsible user who has executed task and that task appeared in his UWL due to Manage substiturion functionality/ rule.

I get the data from table SWWWIHEAD and also have the information of subtitutes. But here we need to know which substitute has executed whose work item. Say A as a substitute for B. Now A has executed Workitem on behalf of B.

The B will see in the report that A has executed his work item which he has passed to him by way of substitution.

Thanks,

Santosh

bpawanchand
Active Contributor
0 Kudos

So that means you already have the workitems in the report, so by using the FM SAP_WAPI_READ_CONTAINER you can get actuall agent who has executed the workitem.

By using the below code snippet


DATA: 
           lt_cont   type table of swr_cont,
          ls_cont   type swr_cont.
CALL FUNCTION 'SAP_WAPI_READ_CONTAINER'
  EXPORTING
    workitem_id                            = lv_wiid
 TABLES
   SIMPLE_CONTAINER                = lt_cont.

READ TABLE lt_cont INTO ls_cont WITH KEY element = '_WI_Actual_Agent'.
          

include the above lines of code inside a loop and pass each workitem to get the respective actual agent, WI_Actual_agent is a system where you can find it inworkitem conatiner, and it will give you the user name who has executed the workitem,

But I hope you can get the same actual agent even from the tabl SWWWIHEAD

former_member554978
Active Contributor
0 Kudos

for responsible and actual agents... probably you can have a look at the below FM's

SWL_WI_DISP_ACTUAL_AGENTS

SWL_WI_DISP_POSSIBLE_AGENTS

Former Member
0 Kudos

Hi Karri Kemppi,

Thanks for understanding the requirement closely.

Is there any way by which this kind of requirement can be handled?

I have the actual agent but not sure if the work item is executed by substitute,actual user or someone else. Also, substitute info is dynamic dependant on the substitute rule maintenance. The work item even might have been forwarded by agent or substitute to someone else.

Thanks in advance.

BR, Santosh

Former Member
0 Kudos

any breakthrough ?

I need to find out from 'Whose inbox work-item was forwarded to the other user'.

I am able to find who forwarded to whom but no luck with 'from whose inbox'.

Any help is highly appreciated.

Regards,

Vinod

Former Member
0 Kudos

Hi,

you can list of forwarded work item from table SWWLOGHIST against method = SWW_WI_FORWARD. The approach can be get all workitems from table SWWWIHEAD belonging to your task and then get all work item from table SWWLOGHIST against method = SWW_WI_FORWARD for all workitems fetched from SWWWIHEAD.

Regards,

Rajneesh

Former Member
0 Kudos

Hi Rajneesh,

Thank you for your reply.

I am actually looking out for the information with respect to substitutes functionality of the UWL.

When work item of X is executed by Y. We are developing report to show the workitems with the details like for agent X and agent Y. Thus X will come to know who has executed his items.

BR, Santosh

former_member554978
Active Contributor
0 Kudos

For substitutes...the main table is HRUS_D2

and you can use SWWUSERWI and SWWWIHEAD as well for your requirement..........

Former Member
0 Kudos

Thank you Kerri for your reply.

We have used the same table SWWWIHEAD with the wi_aagent as user and his substititutes. We obtained the substitute information through function module.

Unfortunately, we get the very big list which includes the workitems executed by user as well as its sustitute.

There is no bifurcation that the substitute has executed the workitems on behalf of the user. The information in the

table SWWWIHEAD only gives me workitems executed by actual user.

We are looking ou for linkage/mapping where we need information of workitems belongs to X and executed by user Y.

I hope this clarifies the requirement.

Thanks in advance .

BR, Santosh

Former Member
0 Kudos

>We are looking ou for linkage/mapping where we need information of workitems belongs to X and executed by user Y.

This is pretty much impossible (at least afterwards) to get this kind of information. You can always get the user who completed the item, but you will never know, if he was the actual agent or a substitute.

You would need to store the actual agent (the user who gets the work item at the first place) at the same time as the work item is created in this inbox. And remember that there might be several users. Then you could compare afterwards, if the work item was executed by someone else than the "actual" agent. And what if the actual agent forwards the item to someone other than the substitute - then it will not be anymore the substitute - and this will be again something quite difficult.

Regards,

Karri

Former Member
0 Kudos

Hi,

Check the tables SWWUSER SE16. There is a table that have the information about all active work items and their current agent(s).

The active/passive substitutions can be found in table HRUS_D2.

You should be able to build your report with this information, but this confuses me a bit:

>We need to create the report where we need to show the workitem with actual and responsible agent where the work item and workflow status is complete.

So after all you want to get some kind of report that lists the completed items and the agent who completed the item? Well, this information is in the work item header table SWWWIHEAD.

There aren't really any functions in SAP that would do your job. But some nice usefull functionas are the workflow API functions. Check SAP_WAPI* in SE37. These might be useful, but first you need to know what information you really want to display in your report.

Regards,

Karri