Skip to Content
0

Execute Dialog Workitem from program - No desicion step

Jul 18, 2017 at 06:38 AM

106

avatar image

Hi all,

I'm facing the following problem:

Existing workflow has a parallel step, depending on decision step before

Left lane: Activitiy Workitem starting dialog task in SAP-GUI

Right Lane: Activity Workitem starting Webflow in Webdynpro

The new challenge is now to "exceute" the workitem by RFC.

Getting the data and additional information out out of the workitem by reading the object key in the container and pass the data to remote user is no problem. To write back the remote users relevant container values (decision, amount..) is also no problem with SAP_WAPI_WRITE_CONTAINER. Updating the business data out of the users "remote input" is no problem, too. But I don't know how to execute the WI after the RFC logic has run and workflow goes on and find next step depending on the new container values.

To clearify this a little bit. The RFC should bypass the business logic which is in the method of the workflow task as usual. I tried with SAP_WAPI_SET_WORKITEM_COMPLETD but this stops the workflow at this point.

Any suggestions appreciated,

Hans

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

5 Answers

Mike Pokraka Jul 25, 2017 at 07:08 PM
1

Personally I would model this in a third branch with a custom wait step - 1 of 2 fork with the decision step in parallel. Then send the results via an event to the wait step and it will cancel the decision work item. Easier to build, clearer in the log, and much easier to troubleshoot.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

I'll upvote this answer. Using wait for event steps provide more control and from the workflow point of view you don't care where the event is coming from, RFC, Transaction, another workflow, etc.

Kind regards, Rob Dielemans

1
Rob Dielemans Jul 18, 2017 at 10:56 AM
0

Hi,

If the dialog workitem is an asynchronous one, you can just simply use sap_wapi_create_event to trigger one of the terminating events.

Kind regards, Rob Dielemans

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Rob,

thank you I tried that before but I had used the wrong object key. For object type WEBSERVICE I had to use the workitem id. After your post I tried again and found the solution.

Kind regards, Hans

0
Hans-Juergen Forberger Jul 20, 2017 at 05:57 PM
0

Hi Rob,

I had to reopen this thread cause the solution doesn't work in background, What I want to do is bypassing a dialog workitem with program logic. Your solution works if I start my program in foreground, when I execute the workitem via program with SAP_WAPI_EXECUTE_WORKITEM the event is registered and browser opens for webflow task which doesn't bother me for testing. Fireing the event afterwards works fine but the problem now is that program should work in background and there a shortdump occurs when task is trying to open webflow because there is no frontend connection. Is there any workaround for that, you know ?

Kind regards, Hans-Juergen

Share
10 |10000 characters needed characters left characters exceeded
Pavan Bhamidipati Jul 21, 2017 at 06:51 AM
0

Hi,

I had to reopen this thread cause the solution doesn't work in background, What I want to do is bypassing a dialog workitem with program logic. 

If your dialog workitem is a copy of the decision step or decision step iteself then I think you can try below steps

  1. Get the Dialog woritem ID and and pass the workitem ID along with the decision to SAP_WAPI_DECISION_COMPLETE.
  2. Also make sure before calling the above mentioned function module update the workitem container.

As you mentioned that your one of the branch is using a WEBSERVICE BOR then this task will be for sure a asynchrounous task. In this case you have to trigger the terminating event COMPLETED of the business object. I hope you maintained a terminating event for the task.

Thanks,

Pavan

Share
10 |10000 characters needed characters left characters exceeded
Hans-Juergen Forberger Jul 25, 2017 at 09:30 AM
0

Hi Pavan,

yes it is a asynchronous task. And firing Completed-Event is only useful after instance is registered (Sweinst). Yet the problem occurs while registering because it's a Dialog task and shortdump is raised if I try to register in background.

Kind regards

Hans

Share
10 |10000 characters needed characters left characters exceeded