cancel
Showing results for 
Search instead for 
Did you mean: 

How to execute an workitem of activity of R3 workflow by BAPI?

Former Member
0 Kudos

Hi guys:

There are several kinds of step in R3 workflow, for example,decision step and activity step. for decision step, there are BAPIs like AP_WAPI_RESERVE_WORKITEM and

SAP_WAPI_DECISION_COMPLETE can execute the workitem. But how to handle it if it is an workitem of activity step? And activity step may have different outcomes which is defined in R3 workflow, how to execute the workitem and let the workflow go to different outcomes?

I noticed there are two BAPIS SAP_WAPI_EXECUTE_WORKITEM AP_WAPI_REJECT_WORKITEM, what are they do and what the usage of them?

Thank you very much!

Regards,

Xiaoming Yang

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Well, I will try again, if you have some task to complete, I suppose it uses some Function Modules or BAPI's, complete these in your code, with the parameters you would normally bind into your task. Then in the end of the program raise an event. This event you can then listen for in your terminating events in the task.

I do not think you kan define outcomes with terminating events. But bind a value to your terminating event, and then direct the workflow using a Branch.

Hope it helps.

Kind regards

Mikkel

Former Member
0 Kudos

Hi,

I hope you require clarification of what exactly these WAPI's meant for:

SAP_WAPI_EXECUTE_WORKITEM - used for programmatically executing a particular workitem .

SAP_WAPI_REJECT_WORKITEM - used for rejecting particualr work item. It can not be used for all work items, but only for those whose processing can be rejected.

Both WAPIs returns RETURN CODE and NEW STATUS of workitem.

Return code 0 indicates that processing is successful.

Hope this will help you start off.

Regds,

Akshay

PS: Please mark helpful answers.

Former Member
0 Kudos

Hi,

I am not sure, I understand you question completely, but the SAP_WAPI_EXECUTE_WORKITEM, just calls the method of the workitem ID it's called for. Thus you can complete a workitem from a FM and not through the SAP inbox.

To use The Reject_Workitem the task must be defined with "Processing can be rejected", then the user can choose to do so in the workplace. When it happens a special exception is triggered, and a business process for this incident can be modelled. The Wapi just rejects processing for a particular workitem.

The Decision_Complete Can on be used for.. well decisions. If you want to complete other tasks, you must combine the use of wapis and method calls, depending of your requirement.

Hope it helps

Kind regards

Mikkel Iversen

Former Member
0 Kudos

Hi Mikkel,

Thank you for your reply. You are right, what i to do is complete a workitem from a FM and not through the SAP inbox. For an decision step, it can be completed by SAP_WAPI_DECISION_COMPLETE. There are parameters like workitem_id and decision key and agent user.

But how to complete a activity step?Call SAP_WAPI_EXECUTE_WORKITEM? But the BAPI SAP_WAPI_EXECUTE_WORKITEM have only workitem parameter, how to let the workflow go to different outcomes?

That's my question and I still get no answer. Appreciate if you guys can help me out. Thank you!

Regards,

Xiaoming Yang