Writing an internal table to a WF container for an already triggered WF From Web Dynpro

Hilsbos, Margaret A Margaret.Hilsbos at dayzim.com
Fri Apr 13 08:26:36 EDT 2012


Ali,

Am I understanding your scenario? Sounds like:


1.       Something triggers a workflow

2.       Later, something happens in a webdynpro that creates data that needs to be supplied to the workflow instance that was triggered in step 1.

If that's correct, I'd look at putting a 'wait for event' in the workflow, then have the action in the webdynpro raise that event and pass the data.  I'm not sure if that would work - I haven't had to do anything like that - but that's what I'd look at.

Hope that helps,

Margaret


From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf Of Ali Husain
Sent: Thursday, April 12, 2012 7:29 PM
To: SAP WUG
Subject: Writing an internal table to a WF container for an already triggered WF From Web Dynpro


Hello All,

I've post this question in the Workflow forum but because i'm trying to work against the clock i'll post it here too.

I'm trying to write an internal table to a workflow container from Web Dynpro by calling a function module. While searching for this topic, most of the posts i found showed how to do it while raising the event via the FM SWE_EVENT_CREATE. The event container for this fm is swcont which is compatible with the macros. For example the following would work:

INCLUDE <cntn01>.

  swc_container lt_container.         "Declaration

 *  swc_create_container lt_container.  "Initialization - I don't think i need in my case since the workflow has already been triggered

   swc_set_table lt_container! 'T_SAME_RSM' it_same_rsm.

* Calling SWE_EVENT_CREATE which has the type SWCONT for its event parameter.

However, for my requirement the workflow has already been triggered and i don't need to call that FM. So instead i tried completing the work item using FM SAP_WAPI_WORKITEM_COMPLETE but that fm has the type swr_cont for its container parameter which is not compatible with the macros container type and hence it was dumping when i used it. Same thing for the FM SAP_WAPI_WRITE_CONTAINER.

I tried transferring the values between the two different structures but that only worked for a single container element and not the table type.

I also tried another approach but the workflow container was not updated even after including the commit work and wait statement:

**    CALL METHOD cl_swf_run_wim_factory=>find_by_wiid

**!      EXPORTING

**   &nbs p;    im_wiid     = wd_comp_controller->gv_wf_id

**      RECEIVING

**        re_instance = lo_wi_handle.

** Get the container

**    lo_cnt = lo_wi_handle->get_wi_container( ).

**    TRY.

**        lo_cnt->if_swf_cnt_element_access_1~element_set_value(

**          EXPORTING

**         name             = 'T_SAME_RSM'

**      qname            =

**            value            = lt_same_rsm

**      unit    !         =

**    IMPORTING

**      exception_return =

**               ).

**      CATCH cx_swf_cnt_cont_access_denied .

**      CATCH cx_swf_cnt_elem_not_found .

**      CATCH cx_swf_cnt_elem_access_denied .

**      CATCH cx_swf_cnt_elem_type_conflict .

**      CATCH cx_swf_cnt_unit_type_conflict .

**      CATCH cx_swf_cnt_elem_def_invalid .

**      CATCH cx_swf_cnt_invalid_qname .

**      CATCH cx_swf_cnt_container .

**    ENDTRY.

Any help on how i! would write a table type to the workflow container when the workflow has already been triggered?

Thanks a lot for the help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20120413/4cbed4d0/attachment-0001.htm


More information about the SAP-WUG mailing list