<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: workflow.. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/workflow/m-p/2451236#M549305</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to trigger an event programmatically, we would use the function module SWE_EVENT_CREATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUS1001006 ( Standard Material )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: key LIKE sweinstcou-objkey.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;key = '68." Material Number (hard-coded)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SWE_EVENT_CREATE'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;objtype = 'BUS1001006'&lt;/P&gt;&lt;P&gt;objkey = key&lt;/P&gt;&lt;P&gt;event = 'CREATED'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CREATOR = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TAKE_WORKITEM_REQUESTER = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;START_WITH_DELAY = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;START_RECFB_SYNCHRON = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NO_COMMIT_FOR_QUEUE = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DEBUG_FLAG = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NO_LOGGING = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IDENT =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EVENT_ID =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EVENT_CONTAINER =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OBJTYPE_NOT_FOUND = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTHERS = 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;WRITE 'Event Triggered'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to test whether the event is getting triggered or not, we can make use of Event Trace. Switch on the event trace using the transaction SWELS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Press &amp;#145;Switch On&amp;#148;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now execute the program developed earlier. Now switch-off the event trace using the same transaction SWELS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now go to transaction SWEL. Here you can list out the events triggered in the particular period of time. Here is the event-trace list: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Data for workflow trigger&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: objtype LIKE swetypecou-objtype,&lt;/P&gt;&lt;P&gt;objkey LIKE sweinstcou-objkey,&lt;/P&gt;&lt;P&gt;event LIKE swetypecou-event,&lt;/P&gt;&lt;P&gt;event_container LIKE swcont OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objtype = 'ZBUS1001'. "Material [sub object of BUS1001]&lt;/P&gt;&lt;P&gt;MOVE v_wfmatnr TO objkey. "V_WFMATNR is material number&lt;/P&gt;&lt;P&gt;event = 'CreatePLMMaterial'."Custom Event defined in &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ZBUS1001 [Tcode SWO1]&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;REFRESH event_container.&lt;/P&gt;&lt;P&gt;*Following are the Event parameters required in the *Workflow &lt;/P&gt;&lt;P&gt;swc_set_element event_container 'Attachment' v_wfattachment.&lt;/P&gt;&lt;P&gt;swc_set_element event_container 'Material' v_wfmatnr.&lt;/P&gt;&lt;P&gt;swc_set_element event_container 'TisGroup' v_wftisgroup.&lt;/P&gt;&lt;P&gt;swc_set_element event_container 'SchDate' v_schdate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SWE_EVENT_CREATE'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;objtype = objtype&lt;/P&gt;&lt;P&gt;objkey = objkey&lt;/P&gt;&lt;P&gt;event = event&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;event_container = event_container&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;objtype_not_found = 1&lt;/P&gt;&lt;P&gt;OTHERS = 2.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In TCode SWETYPV Create entry for Object type Event and Workflow ID.&lt;/P&gt;&lt;P&gt;In my case Object type is ZBUS1001&lt;/P&gt;&lt;P&gt;Event CreatePLMMaterial&lt;/P&gt;&lt;P&gt;Rec type = &amp;lt;Workflow ID&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also check with the link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.sdn.sap.com/click.jspa?searchID=2650853&amp;amp;messageID=3074200" target="test_blank"&gt;https://forums.sdn.sap.com/click.jspa?searchID=2650853&amp;amp;messageID=3074200&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/c5/e4af8b453d11d189430000e829fbbd/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/c5/e4af8b453d11d189430000e829fbbd/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps to solve ur problem....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do reward if useful....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dinesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Jul 2007 04:22:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-03T04:22:07Z</dc:date>
    <item>
      <title>workflow..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/workflow/m-p/2451235#M549304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;whats the program for triggering the event using function module in workflow....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2007 04:18:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/workflow/m-p/2451235#M549304</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-03T04:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: workflow..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/workflow/m-p/2451236#M549305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to trigger an event programmatically, we would use the function module SWE_EVENT_CREATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUS1001006 ( Standard Material )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: key LIKE sweinstcou-objkey.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;key = '68." Material Number (hard-coded)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SWE_EVENT_CREATE'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;objtype = 'BUS1001006'&lt;/P&gt;&lt;P&gt;objkey = key&lt;/P&gt;&lt;P&gt;event = 'CREATED'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CREATOR = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TAKE_WORKITEM_REQUESTER = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;START_WITH_DELAY = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;START_RECFB_SYNCHRON = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NO_COMMIT_FOR_QUEUE = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DEBUG_FLAG = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NO_LOGGING = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IDENT =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EVENT_ID =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EVENT_CONTAINER =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OBJTYPE_NOT_FOUND = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTHERS = 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;WRITE 'Event Triggered'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to test whether the event is getting triggered or not, we can make use of Event Trace. Switch on the event trace using the transaction SWELS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Press &amp;#145;Switch On&amp;#148;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now execute the program developed earlier. Now switch-off the event trace using the same transaction SWELS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now go to transaction SWEL. Here you can list out the events triggered in the particular period of time. Here is the event-trace list: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Data for workflow trigger&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: objtype LIKE swetypecou-objtype,&lt;/P&gt;&lt;P&gt;objkey LIKE sweinstcou-objkey,&lt;/P&gt;&lt;P&gt;event LIKE swetypecou-event,&lt;/P&gt;&lt;P&gt;event_container LIKE swcont OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objtype = 'ZBUS1001'. "Material [sub object of BUS1001]&lt;/P&gt;&lt;P&gt;MOVE v_wfmatnr TO objkey. "V_WFMATNR is material number&lt;/P&gt;&lt;P&gt;event = 'CreatePLMMaterial'."Custom Event defined in &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ZBUS1001 [Tcode SWO1]&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;REFRESH event_container.&lt;/P&gt;&lt;P&gt;*Following are the Event parameters required in the *Workflow &lt;/P&gt;&lt;P&gt;swc_set_element event_container 'Attachment' v_wfattachment.&lt;/P&gt;&lt;P&gt;swc_set_element event_container 'Material' v_wfmatnr.&lt;/P&gt;&lt;P&gt;swc_set_element event_container 'TisGroup' v_wftisgroup.&lt;/P&gt;&lt;P&gt;swc_set_element event_container 'SchDate' v_schdate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SWE_EVENT_CREATE'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;objtype = objtype&lt;/P&gt;&lt;P&gt;objkey = objkey&lt;/P&gt;&lt;P&gt;event = event&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;event_container = event_container&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;objtype_not_found = 1&lt;/P&gt;&lt;P&gt;OTHERS = 2.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In TCode SWETYPV Create entry for Object type Event and Workflow ID.&lt;/P&gt;&lt;P&gt;In my case Object type is ZBUS1001&lt;/P&gt;&lt;P&gt;Event CreatePLMMaterial&lt;/P&gt;&lt;P&gt;Rec type = &amp;lt;Workflow ID&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also check with the link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.sdn.sap.com/click.jspa?searchID=2650853&amp;amp;messageID=3074200" target="test_blank"&gt;https://forums.sdn.sap.com/click.jspa?searchID=2650853&amp;amp;messageID=3074200&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/c5/e4af8b453d11d189430000e829fbbd/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/c5/e4af8b453d11d189430000e829fbbd/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps to solve ur problem....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do reward if useful....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dinesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2007 04:22:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/workflow/m-p/2451236#M549305</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-03T04:22:07Z</dc:date>
    </item>
  </channel>
</rss>

