cancel
Showing results for 
Search instead for 
Did you mean: 

FM or tables to get the latest workitem

Former Member
0 Kudos

Hello,

    Is there any FM or tables to get the latest work item which got executed by giving the workflow number as input.

Thanks,

Saravana

Accepted Solutions (1)

Accepted Solutions (1)

former_member217176
Participant
0 Kudos

HI Saravan,

Use table SWWWIHEAD you can get the work item numbers of  a workflow by giving parent work item id which is parent workflow work item number.You can sort on creation time to get the latest work item if you want so.

Regards,

Jayaraj

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi Saravana,

you can try using f.m. SWW_WI_FIND_DEPENDANT_WIS, using the top level workflow ID and uncheking the parameter DIRECT_DEPENDANTS_ONLY.

You can then easily work on the returned table DEPENDENT_WIS to find the latest step in your workflow.

Regards,

Antonio

Former Member
0 Kudos

In my report, I have got the event wise workitem using tables SWWWIHEAD and SWWLOGHIST. Now, the problem is I'm not able to find the table or FM which gives the event status (active/not active) for that specific work item. I checked the table SWFDEVENA, but this is not giving the work item wise event status.

How will I get the work item wise event status?

former_member185167
Active Contributor
0 Kudos

What do you mean by " work item wise event status" ?

Former Member
0 Kudos

when you execute the table SWWWIHEAD with  WI_RH_TASK, you will get list of work items (WI_ID).

in tcode SWDD, if you put the WI_RH_TASK and see the header. there are events assigned for this task. I want those event status for the work items.

former_member185167
Active Contributor
0 Kudos

Hello,

Could you give an example?

You say you use WI_RH_TASK to get WI_ID, but then you use WI_RH_TASK anyway in SWDD. So why do you need WI_ID?

I still think SWFDEVENA shows you what you need, or at least what you've asked for.

If you're starting with WI_ID then link it to task in SWWWIHEAD and use that task in SWFDEVENA.

regards

Rick

Former Member
0 Kudos

Hi,

All Events generated are logged in the event log (SWEL). To view it first you need to switch on the Event trace (SWELS).You can do this by selecting Utilities-> Event log -> On/off from the area menu SAP Business Workflow.

Regards,

Reshma S

Former Member
0 Kudos

Hi,

You can go to swi1 t-code and view the details of the work item which are executed and their status too. you can also view the details of the work item and their status ...

Hope it helps....

Regards,

Reshma S

Former Member
0 Kudos

I have few more queries.....

1. which table stores the workflow event status details (Active/not active)?

2. is it possible to get the event wise last executed work item for a workflow? how to do it?

anjan_paul
Active Contributor
0 Kudos

Hi,

For point 1 . check the table SWETYPEENA.

                2. Check the table SWEQUEUE

Anyways it is always preferable to use of FM SAP_WAPI_*.

Former Member
0 Kudos

Hi Anjan,

In my report, I have got the event wise workitem using tables SWWWIHEAD and SWWLOGHIST. Now, the problem is I'm not able to find the table or FM which gives the event status (active/not active) for that specific work item. I checked the table SWFDEVENA, but this is not giving the work item wise event status.

How will I get the work item wise event status?

Regards,

Saravana

anjan_paul
Active Contributor
0 Kudos

Hi,

  yes,  SWWWIHEAD with  WI_RH_TASK  and pass it to  SWFDEVENA should solve your provlem as Rick said.

Former Member
0 Kudos

Actually My requirement is....

giving workflow no as input and to get last executed work item with the material list which got executed during the last work item.

is there any tables to relate these?

former_member185167
Active Contributor
0 Kudos

Hello,

No, that is getting too specific. You will have to write an ABAP program for that requirement. When you do, try to not access thetables directly but instead use SAP_WAPI* function modules.

SAP_WAPI_WORKITEMS_TO_OBJECT may be particularly helpful.

regards

Rick Bakker / hanabi technology

0 Kudos

Use SAP_WAPI_WORKITEMS_TO_OBJECT along with the Business Object name and material number . And in task filter add your template number .

anjan_paul
Active Contributor
0 Kudos

Hi,

  Also check  SAP_WAPI_WORKITEMS_BY_TASK fm.

Former Member
0 Kudos

Actually My requirement is....

giving workflow no as input and to get last executed work item with the material list which got executed during the last work item.

is there any tables to relate these?

anjan_paul
Active Contributor
0 Kudos

Hi,

   check the table parameter WORKITEM_TYPE_FILTER in the FM SAP_WAPI_WORKITEMS_BY_TASK.

former_member186746
Active Contributor
0 Kudos

In addition to Jayaraj's advise,

You can also filter using WI_TYPE and WI_AAGENT to find out execution of dialog workitems.

alternatively just use transaction SWI5 to get all info on execution of workflows and tasks etc.

Kind regards, Rob Dielemans