Use of SAP_WAPI_WRITE_CONTAINER

Dart, Jocelyn jocelyn.dart at sap.com
Mon Mar 17 17:07:30 EDT 2008


Agreed - Mike is correct.  The approach is wrong - SAP_WAPI_WRITE_CONTAINER is NOT to be used for updating the workflow container within a workflow step - it's purpose is an API to be used by programs EXTERNAL to workflow.   
 
Instead you should use either the standard binding or a programmed binding or terminating event parameters.  In ECC 6.0 you may also to be able to use a simpler form of programmed binding ... a transformational binding - try clicking on the arrow button between the source and target fields in the binding window and you should see some of the options.  Other than that check the SAP Library Help.
 
Regards,
Jocelyn 

________________________________

From: sap-wug-bounces at mit.edu on behalf of Mike Pokraka
Sent: Mon 17/03/2008 11:56 PM
To: SAP Workflow Users' Group
Subject: Re: Use of SAP_WAPI_WRITE_CONTAINER



I would question the reasons you cannot use binding... perhaps you could
elaborate because I don't understand your statement about how an FM with
importing parameters prevents a container operation and find it difficult
to imagine a scenario where there is no simpler way to work around what
you describe.

To me the system behaviour is correct, you should not update the container
yourself *inside* a synchronous WF method, and I would steer well clear of
that.

There are other workarounds such as programmed binding or making your
method asynch but I would still think there would be better alternatives
that will enable regular binding.

Cheers,
Mike


On Fri, March 14, 2008 6:36 pm, SAP at e-Wave wrote:
> Hi everyone.  I am curious if anyone else has to update a main
> workflow container whilst WITHIN a running workitem using
> SAP_WAPI_WRITE_CONTAINER in ECC 6.0
>
> So, whilst a workflow is executing, a step in the workflow is calling
> a method of a 'z' object.  This method needs to update an element in
> the main workflow container (again, I can't pass it back via the
> swc_set_element macro for various reasons, one being that the method
> in production calls a function module that only has importing
> parameters, not exporting, etc, etc, too late to change now as we have
> thousands of existing workitems).
>
> I have done extensive testing an analysis and am quite stumped.
>
> You can call SAP_WAPI_WRITE_CONTAINER during the method (or, more
> specifically, from an FM called from the method), but it won't update
> the parent workflow container as it raises an exception (you can see
> it in the step history for that workitem in the technical log): "
>
> Call of interface SAP_WAPI_WRITE_CONTAINER within the runtime system
> not permitted" (this is message number SWF_RUN 624).
>
> If I look in the code of the WAPI, there is a specific check:
>
> *- function valid (allowed)
>        IF lv_handle LE 0.
>          lv_excp = lh_wapi->get_last_exception( ).
>          return_code = 900.
>          RAISE EXCEPTION lv_excp.
>        ENDIF.
>
> If I copy this function module and comment these lines out, then all
> works fine.  What's also frustrating, is that this code snippet that
> performs the check does not exist i 4.6 or 4.7, so it works there!
> For some reason in 6.0, they have prevented the use of this WAPI to be
> called during a running workitem.
>
> Now yes, I can write an ABAP that runs and updates the container
> external to the workflow, but I need this to happen real time.
>
> I have even tried putting a wrapper FM around it and calling it in the
> update task.  It doesn't error out, but mysteriously just doesn't
> update the container.
>
> Again, for a lot of technical reasons that I won't list, I can't just
> use standard container binding, so it's a pretty unique case.
>
> Any help/thoughts from anyone would be greatly appreciated.
>
> Cheers,
> Greg
>
>
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>


_______________________________________________
SAP-WUG mailing list
SAP-WUG at mit.edu
http://mailman.mit.edu/mailman/listinfo/sap-wug






More information about the SAP-WUG mailing list