<?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: Change documents + Workflow, avoiding recurrence in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-workflow-avoiding-recurrence/m-p/12083472#M1971180</link>
    <description>&lt;P&gt;Argh, I've checked it before and I missed it (!)&lt;/P&gt;&lt;P&gt;You're right, subsequent events have USWF-BATCH as the creator.&lt;/P&gt;&lt;P&gt;Case solved.&lt;/P&gt;&lt;P&gt;I'll do the check in Z* FM, no need to start workflow just to do nothing in there.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Sep 2019 13:01:52 GMT</pubDate>
    <dc:creator>former_member393881</dc:creator>
    <dc:date>2019-09-11T13:01:52Z</dc:date>
    <item>
      <title>Change documents + Workflow, avoiding recurrence</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-workflow-avoiding-recurrence/m-p/12083467#M1971175</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;
  &lt;P&gt;Scenario.&lt;/P&gt;
  &lt;P&gt;1. User creates customer.&lt;/P&gt;
  &lt;P&gt;2. Based on change documents, event CREATED is raised (SWE2 - configured custom Z* module checking some conditions and raising the event).&lt;/P&gt;
  &lt;P&gt;3. Workflow starts, goes through all company codes and synchronously calls XD01 via BDC to create customers in remaining company codes.&lt;/P&gt;
  &lt;P&gt;Problem.&lt;/P&gt;
  &lt;P&gt;Every time XD01 is called from workflow, event CREATED is raised as well, thus workflow is called recursively.&lt;/P&gt;
  &lt;P&gt;I am not able to distinguish whether event is raised by a user or workflow. &lt;/P&gt;
  &lt;P&gt;So far I just check (Z* FM, before raising CREATED event) if there's only 1 entry in KNB1, only then the event is raised.&lt;/P&gt;
  &lt;P&gt;I'm looking for a clever way to solve the issue, be it temporarily suppressing event generation within workflow session, passing some extra event parameters, or something else.&lt;/P&gt;
  &lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 13:42:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-workflow-avoiding-recurrence/m-p/12083467#M1971175</guid>
      <dc:creator>former_member393881</dc:creator>
      <dc:date>2019-09-10T13:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Change documents + Workflow, avoiding recurrence</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-workflow-avoiding-recurrence/m-p/12083468#M1971176</link>
      <description>&lt;P&gt;Hello Bartosz,&lt;/P&gt;&lt;P&gt;My suggestion is to extend the estandard BUS with your own object, create you ZCREATED event and work with this one.&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 14:46:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-workflow-avoiding-recurrence/m-p/12083468#M1971176</guid>
      <dc:creator>ruben_rollano</dc:creator>
      <dc:date>2019-09-10T14:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Change documents + Workflow, avoiding recurrence</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-workflow-avoiding-recurrence/m-p/12083469#M1971177</link>
      <description>&lt;P&gt;Hello Bartosz,&lt;/P&gt;&lt;P&gt;Just to understand better, when you say based on change documents &lt;BR /&gt;Do you mean IDOC -&amp;gt; change pointers ? or the Z* FM/Module is called in any exit of XD01 where it raises event ?&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;Rameez Khan&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 15:25:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-workflow-avoiding-recurrence/m-p/12083469#M1971177</guid>
      <dc:creator>rameez_khan</dc:creator>
      <dc:date>2019-09-10T15:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Change documents + Workflow, avoiding recurrence</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-workflow-avoiding-recurrence/m-p/12083470#M1971178</link>
      <description>&lt;P&gt; @&lt;A href="https://answers.sap.com/users/284301/rameezkhan.html"&gt;Rameez Khan&lt;/A&gt;, &lt;A href="https://answers.sap.com/users/469011/rubenrollano.html"&gt;Ruben Rollano Carcajona&lt;/A&gt;&lt;/P&gt;&lt;P&gt;No IDOCs involved. &lt;/P&gt;&lt;P&gt;I have created custom BOR object ZZ_KNA1 (as a subtype of KNA1). Standard KNA1 object does not have any events, thus I've added them (events ZZ_KNA1.created/ZZ_KNA1.changed) and tied them to change document (DEBI - customer) - tcode SWEC.&lt;/P&gt;&lt;P&gt;Then in tcode SWE2 I've tied event ZZ_KNA1.created to my workflow and configured custom Z* function module as the "Receiver function module". &lt;/P&gt;&lt;P&gt;By adding receiver FM, before ZZ_KNA1.created event is raised, Z* FM is called automatically by system (no custom coding here, system just calls this FM whenever customer is created). In this FM I check some conditions (customer group KNA1-KTOKD) before raising the actual event and then raising the event by calling SWW_WI_CREATE_VIA_EVENT_IBF.&lt;/P&gt;&lt;P&gt;The above works, workflow is started after customer is created.&lt;/P&gt;&lt;P&gt;The problem is the workflow itself also creates customers (extends them to other company codes) but that fires ZZ_KNA1.created events as well, which in turn start workflows.&lt;/P&gt;&lt;P&gt;As an example.&lt;/P&gt;&lt;P&gt;Let's say, there are 3 company codes 1000, 1001, 1002.&lt;/P&gt;&lt;P&gt;1. User creates customer in CC 1000.&lt;/P&gt;&lt;P&gt;2. Z* FM is called, ZZ_KNA1.created event is raised, workflow is called.&lt;/P&gt;&lt;P&gt;3. Workflow starts copying customer to CC 1001, 1002.&lt;/P&gt;&lt;P&gt;4. Z* FM is called, ZZ_KNA1.created event is raised for CC 1001 - the same workflow is called again.&lt;/P&gt;&lt;P&gt;5. Z* FM is called, ZZ_KNA1.created event is raised for CC 1002 - the same workflow is called again.&lt;/P&gt;&lt;P&gt;I do not want steps 4 and 5 to happen or at least find a condition that would allow me to filter the events (inside Z* FM) and react only to those generated by users and not the workflow itself.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 06:40:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-workflow-avoiding-recurrence/m-p/12083470#M1971178</guid>
      <dc:creator>former_member393881</dc:creator>
      <dc:date>2019-09-11T06:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Change documents + Workflow, avoiding recurrence</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-workflow-avoiding-recurrence/m-p/12083471#M1971179</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;if the creation of the additional CC views happens in a batch workitem, then the user, who executes these steps and fires the (unwanted) events, should be the WF Batch User (WF-BATCH in standard customizing.&lt;/P&gt;&lt;P&gt;So you could try to define a starting condition for the Workflow like&lt;/P&gt;&lt;P&gt;&amp;amp;_EVT_CREATOR&amp;amp; &amp;lt;&amp;gt; 'WF-BATCH'&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 10:19:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-workflow-avoiding-recurrence/m-p/12083471#M1971179</guid>
      <dc:creator>josef_graf</dc:creator>
      <dc:date>2019-09-11T10:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Change documents + Workflow, avoiding recurrence</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-workflow-avoiding-recurrence/m-p/12083472#M1971180</link>
      <description>&lt;P&gt;Argh, I've checked it before and I missed it (!)&lt;/P&gt;&lt;P&gt;You're right, subsequent events have USWF-BATCH as the creator.&lt;/P&gt;&lt;P&gt;Case solved.&lt;/P&gt;&lt;P&gt;I'll do the check in Z* FM, no need to start workflow just to do nothing in there.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 13:01:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-workflow-avoiding-recurrence/m-p/12083472#M1971180</guid>
      <dc:creator>former_member393881</dc:creator>
      <dc:date>2019-09-11T13:01:52Z</dc:date>
    </item>
  </channel>
</rss>

