Changing the Value of a Workflow Container in the "STARTED" Status

Changing the Value of a Workflow Container in the "STARTED" Status

Today, my colleagues and I accidentally came across the task of changing the value of a workflow container while it is in the "STARTED" status. At first, we assumed that this was impossible, but it turns out there's nothing impossible — it's a perfectly feasible task that can be solved using the SAP function module SAP_WAPI_WRITE_CONTAINER.

For example, in a workflow that I had started, it became necessary to urgently change the container value from US-IGNATOVSN to, say, US-USER01.

We call the function module SAP_WAPI_WRITE_CONTAINER, passing in the workflow element ID and the container element name along with its new value:

We receive a message like this:

We then update the tree of the running workflow:

Apparently, this only works for "active" tasks — which makes sense.