<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<div><br></div><div>Hello All,</div><div><br></div><div>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.</div><div><br></div><div><div><span style="font-size: 10pt; ">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:</span></div><div><br></div><div>INCLUDE &lt;cntn01&gt;.</div><div><br></div><div>&nbsp; swc_container lt_container. &nbsp; &nbsp; &nbsp; &nbsp; "Declaration</div><div><br></div><div>&nbsp;* &nbsp;swc_create_container lt_container. &nbsp;"Initialization - I don't think i need in my case since the workflow has already been triggered</div><div><br></div><div>&nbsp; &nbsp;swc_set_table lt_container!
  'T_SAME_RSM' it_same_rsm.</div><div><br></div><div>* Calling SWE_EVENT_CREATE which has the type SWCONT for its event parameter.</div><div><br></div><div>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.</div><div><br></div><div>I tried transferring the values between the two different structures but that only worked for a single container element and not the table type.</div><div><br></div><div>I also tried another approach but the workflow container was not updated even after including the commit work and wait statement:</div><div><br></div><div>** &nbsp; &nbsp;CALL METHOD cl_swf_run_wim_factory=&gt;find_by_wiid</div><div><br></div><div>**!
  &nbsp; &nbsp; &nbsp;EXPORTING</div><div><br></div><div>** &nbsp; &nbs
p; &nbsp; &nbsp;im_wiid &nbsp; &nbsp; = wd_comp_controller-&gt;gv_wf_id</div><div><br></div><div>** &nbsp; &nbsp; &nbsp;RECEIVING</div><div><br></div><div>** &nbsp; &nbsp; &nbsp; &nbsp;re_instance = lo_wi_handle.</div><div><br></div><div>** Get the container</div><div><br></div><div>** &nbsp; &nbsp;lo_cnt = lo_wi_handle-&gt;get_wi_container( ).</div><div><br></div><div>** &nbsp; &nbsp;TRY.</div><div><br></div><div>** &nbsp; &nbsp; &nbsp; &nbsp;lo_cnt-&gt;if_swf_cnt_element_access_1~element_set_value(</div><div><br></div><div>** &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;EXPORTING</div><div><br></div><div>** &nbsp; &nbsp; &nbsp; &nbsp; name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 'T_SAME_RSM'</div><div><br></div><div>** &nbsp; &nbsp; &nbsp;qname &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=</div><div><br></div><div>** &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= lt_same_rsm</div><div><br></div><div>** &nbsp; &nbsp; &nbsp;unit &nbsp; &nbsp;!
  &nbsp; &nbsp; &nbsp; &nbsp; =</div><div><br></div><div>** &nbsp; &nbsp;IMPORTING</div><div><br></div><div>** &nbsp; &nbsp; &nbsp;exception_return =</div><div><br></div><div>** &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ).</div><div><br></div><div>** &nbsp; &nbsp; &nbsp;CATCH cx_swf_cnt_cont_access_denied .</div><div><br></div><div>** &nbsp; &nbsp; &nbsp;CATCH cx_swf_cnt_elem_not_found .</div><div><br></div><div>** &nbsp; &nbsp; &nbsp;CATCH cx_swf_cnt_elem_access_denied .</div><div><br></div><div>** &nbsp; &nbsp; &nbsp;CATCH cx_swf_cnt_elem_type_conflict .</div><div><br></div><div>** &nbsp; &nbsp; &nbsp;CATCH cx_swf_cnt_unit_type_conflict .</div><div><br></div><div>** &nbsp; &nbsp; &nbsp;CATCH cx_swf_cnt_elem_def_invalid .</div><div><br></div><div>** &nbsp; &nbsp; &nbsp;CATCH cx_swf_cnt_invalid_qname .</div><div><br></div><div>** &nbsp; &nbsp; &nbsp;CATCH cx_swf_cnt_container .</div><div><br></div><div>** &nbsp; &nbsp;ENDTRY.</div><div><br></div><div>Any help on how i!
  would write a table type to the workflow container when the workflow 
has already been triggered?</div><div><br></div><div>Thanks a lot for the help.</div></div>                                               </div></body>
</html>