Skip to Content

Update main workflow container from In-Progress Subworkflow

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Jun 23, 2010 at 05:23 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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

  • avatar image
    Former Member
    Jun 23, 2010 at 06:03 AM

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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 28, 2010 at 05:25 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 29, 2010 at 05:34 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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