cancel
Showing results for 
Search instead for 
Did you mean: 

Need the variable which stores current workitem id

Former Member
0 Kudos

Hi All ,

Is it possible to know the current work item ID ?? I tried with one of the workflow container element but it is giving me worl item ID of the first step which has been executed . I want to know the work item id of the current step which going to be executed .

Any inputs ??

Thanks ,

Sonu M.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sonu,

in fact the workflow itself is a work item so that is the ID you will get from the workflow work item container, too. Have you thus checked you are checking the correct work item?

If you would need to get the current <u>task</u> work item ID, it's available in the task container under _Workitem->WorkitemId.

If you need to retrieve the tasks ID, you can either:

1. directly reference it in the task and pass it on to the texts, method etc.,

2. bind it to a workflow container element as a return value (make sure to have an element ready for this) or

3. for completed work items and workflows, use the SAP_WAPI_GET* function modules to retrieve work items with various criteria.

Hope this helps,

Mikko

Former Member
0 Kudos

Thanks a lot for the help ....

-

Sonu M.

Answers (2)

Answers (2)

Former Member
0 Kudos

hi Mikko,

2 bind it to a workflow container element as a return value (make sure to have an element ready for this)

If you use it as a return value, How can the current task use it?

I want to use the current workitem id in the method of this task. But I bound _workitem.workitemid to the import parameter of the method in Bind Object Method view, it didn't work. The value of the import parameter was still <Not Set>.

How can I get the current workitemid in the method of current task?

Is there any way to access the current WI ID value as the workitemid is a system element ?

Former Member
0 Kudos

Hi Sonu,

use FM SWO_GET_REQUESTORS (or REQUESTERS), somthing similar.

This give as WORKINGWI the current wi_id of the workitem in process.

Best wishes,

Florin