cancel
Showing results for 
Search instead for 
Did you mean: 

Update main workflow container from In-Progress Subworkflow

kammaje_cis
Active Contributor
0 Kudos

Hi,

I have a requirement where I need to update a main workflow container element from a sub-workflow, while the sub-workflow is still running. (In-Progress)

I have tried using the FM SAP_WAPI_WRITE_CONTAINER in sub-workflow, but it returns an error saying "Cannot call WAPI interface 'SAP_WAPI_WRITE_CONTAINER' in this context".

I have also tried FM SWW_WI_CONTAINER_MODIFY, but it does not update at all.

I have also tried triggering an even in sub-workflow, which in turn triggers a class method, but it gives an errors saying "WF locked"

Please let me know if you have any other strategies.

Thanks

Krishna

Accepted Solutions (0)

Answers (4)

Answers (4)

bpawanchand
Active Contributor
0 Kudos

Hi,

what I can suggest you is try to create a program exit in the subworkflow and in the program exit you can access the main workflow F wotkitem ID, by using thie main workflow workitem ID try to create the instance of the container. and from there in the program exit class you can set and get the values of the workflow container elements.

but here you have to make sure that you have to create the instance of the parent workitem ID container, but not the subworkflow workitem ID container.

[Program Exits In Workflow |http://wiki.sdn.sap.com/wiki/display/ABAP/ProgramExitsIn+Workflow]

Regards

Pavan

kammaje_cis
Active Contributor
0 Kudos

Thanks Pavan, Very Interesting and new approach to me. I will try that.

For now I have triggered an event in Subworkflow and captured it in the main workflow, and subsequently updated the main workflow container.

Thanks

Krishna

Former Member
0 Kudos

I would probably create a task that I call in the main workflow to read the container of the sub-workflow. So, instead of using SAP_WAPI_WRITE_CONTAINER, use SAP_WAPI_READ_CONTAINER in this task and pass back the details you want to the main workflow. The trick here is to figure out the sub-workflow task ID. You can read the current workflow instance and find out the ID of the included sub-workflow instance.

Alternatively, you can pass the main Workflow ID to the child workflow and the child can write the values into a table that the parent can access using its own ID. I don't like this approach, but it works.

Regards,

Abdullah Azzouni

Former Member
0 Kudos

Define table and element at workflow container ...define their proerties as export parametes .....

suresh_subramanian2
Active Contributor
0 Kudos

Hello Krishna Kishor Kammaje !

You have to pass data from sub workflow to main workflow.

So, please check your bindings that carries data from sub workflow to main workflow.

Regards,

S.Suresh

kammaje_cis
Active Contributor
0 Kudos

Hi Suresh,

I guess you did not get the full question. The binding of values from subworkflow to main workflow happens only when sub workflow completes. Not when subworkflow is still in-progress.

-Thanks

Krishna