<?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: Trigger a process(IDOC) when Data in Z-table updated in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-a-process-idoc-when-data-in-z-table-updated/m-p/4174838#M998092</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shirin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As my requirement is also similar to urs, working on an interface and the outbound IDOC from ECC 6.0 to XI needs to be triggered whenever table is updated(ztransaction saved). Can U share the code pls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;balu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Jul 2008 06:26:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-23T06:26:43Z</dc:date>
    <item>
      <title>Trigger a process(IDOC) when Data in Z-table updated</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-a-process-idoc-when-data-in-z-table-updated/m-p/4174834#M998088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on an interface and the outbound IDOC from R/3 to XI needs to be triggered when a particular field value in a Z*table changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far I am able to trigger the IDOC from the calling Z*prog which updates this table, but I need some exit, PAI etc which will get triggered only when the data in table is updated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Current Flow chart:
Z-prog starts---&amp;gt;Updates a Z-table---&amp;gt;if sy-subrc=0---&amp;gt;I create an IDOC from the Z-prog itself&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;What I need:
Z-table is updated---&amp;gt;check if particular filed value changed---&amp;gt;Trigger IDOC&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;Shirin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jul 2008 14:30:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-a-process-idoc-when-data-in-z-table-updated/m-p/4174834#M998088</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-22T14:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger a process(IDOC) when Data in Z-table updated</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-a-process-idoc-when-data-in-z-table-updated/m-p/4174835#M998089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What process is updating the Z-Table? &lt;/P&gt;&lt;P&gt;SM30 maintenance? Then you can use table maintenance events.&lt;/P&gt;&lt;P&gt;Another Z-program? Then you can include the check and trigger there.&lt;/P&gt;&lt;P&gt;A standard SAP application? There is probably a user exit which can be used.&lt;/P&gt;&lt;P&gt;Unsure? Then you'll have to poll the table contents every x minutes and see if anything has changed...&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jul 2008 14:36:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-a-process-idoc-when-data-in-z-table-updated/m-p/4174835#M998089</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-07-22T14:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger a process(IDOC) when Data in Z-table updated</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-a-process-idoc-when-data-in-z-table-updated/m-p/4174836#M998090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the quick response. Yes it is possible to do it the way you have mentioned. In my case from Z-program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was wondering if its possible to trigger the idoc directly whenever table data is updated. Update could either be from a z-program/sm30 or through SE11-debug mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Quick one, will SM30 events as mentioned in ur mail, get triggered even if I update the table from a Z-program ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;Shirin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jul 2008 14:58:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-a-process-idoc-when-data-in-z-table-updated/m-p/4174836#M998090</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-22T14:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger a process(IDOC) when Data in Z-table updated</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-a-process-idoc-when-data-in-z-table-updated/m-p/4174837#M998091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; I was wondering if its possible to trigger the idoc directly whenever table data is updated. Update could either be from a z-program/sm30 or through SE11-debug mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't think of a point where you could attach the required custom logic. Maybe somebody else can?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; will SM30 events as mentioned in ur mail, get triggered even if I update the table from a Z-program ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm afraid, no.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jul 2008 15:07:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-a-process-idoc-when-data-in-z-table-updated/m-p/4174837#M998091</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-07-22T15:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger a process(IDOC) when Data in Z-table updated</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-a-process-idoc-when-data-in-z-table-updated/m-p/4174838#M998092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shirin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As my requirement is also similar to urs, working on an interface and the outbound IDOC from ECC 6.0 to XI needs to be triggered whenever table is updated(ztransaction saved). Can U share the code pls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;balu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 06:26:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-a-process-idoc-when-data-in-z-table-updated/m-p/4174838#M998092</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T06:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger a process(IDOC) when Data in Z-table updated</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-a-process-idoc-when-data-in-z-table-updated/m-p/4174839#M998093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Balu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am triggering my IDOCS from the Z*program itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The trigger point is when I have successfully updated the table (sy-subrc = 0).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I have used the code below to populate my IDOC. I have also maintained a distribution model, so that is the reason I pass only the idoc type in edidc segment and do not pass any port , receiver etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you find the code useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shirin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if this was helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
***********************
*Local Data Declaration
***********************
  DATA:  wa_msg_header TYPE zca_msg_header,
         wa_edidc      TYPE edidc,
         wa_edidd      TYPE edidd,
         i_edidc       TYPE edidc OCCURS 0,
         i_edidd       TYPE edidd OCCURS 0,
         wa_trailer    TYPE zca_gs_trailer,
         wa_count(10)  TYPE n,
         wa_allocation_response TYPE zca_allocation_response.

***********************
*Populate IDOC segments
***********************
* 1. Save the message type and the basic IDoc type* in the control segment
  MOVE 'ZMT_ALLOCATION_RESPONSE' TO wa_edidc-mestyp.
  MOVE 'ZGS_ALLOCATION_RESPONSE' TO wa_edidc-idoctp.


* 2. Populate the Genius specific Message Header 'ZCA_MSG_HEADER'
  wa_msg_header-source        = 'SOURCE_SYST'.
  wa_msg_header-destination   = 'DESTINATION-LS.
  wa_msg_header-message_id    = ''.  "Populate this in XI
  wa_msg_header-date_time     = ''.  "populate this in xi.
  wa_msg_header-message_typ   = 'I'.
  wa_msg_header-status        = 'S'.

  MOVE 'ZCA_MSG_HEADER' TO wa_edidd-segnam.
  MOVE wa_msg_header    TO wa_edidd-sdata.
  APPEND wa_edidd       TO i_edidd.
  CLEAR wa_edidd.

* 3 Populate the ALOCATION_RESPONSE segment
  CONCATENATE 'EXAM'
               sy-datum
               sy-uzeit
               INTO
               wa_allocation_response-uid.
* wa_allocation_response-uid                 =  i_set_number  .
  wa_allocation_response-set_number          =  i_set_number .
  wa_allocation_response-trigger             =  '1' .              "Always default to Allocation Change   .
  wa_allocation_response-next_a_exam         =  i_next_a_exam .
  wa_allocation_response-miles_to_a          =  i_miles_to_a .
  wa_allocation_response-next_b_exam         =  i_next_b_exam .
  wa_allocation_response-miles_to_b          =  i_miles_to_b.
  wa_allocation_response-next_major_exam     =  i_next_maj_exam  .
  wa_allocation_response-miles_to_major_exam =  i_miles_to_maj_exam .

  MOVE  'ZCA_ALLOCATION_RESPONSE' TO wa_edidd-segnam.
  MOVE   wa_allocation_response   TO wa_edidd-sdata.
  APPEND wa_edidd                 TO i_edidd.
  CLEAR  wa_edidd.

*4 Populate the Trailer record 'ZCA_TRAILER'
  wa_trailer-data_marker  = 'T'.
  wa_trailer-checksum     = wa_count.

  MOVE 'ZCA_TRAILER' TO wa_edidd-segnam.
  MOVE wa_trailer       TO wa_edidd-sdata.
  APPEND wa_edidd       TO i_edidd.
  CLEAR  wa_edidd.

* Check for distribution model and create the IDOC
  CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
    EXPORTING
      master_idoc_control            = wa_edidc
    TABLES
      communication_idoc_control     = i_edidc
      master_idoc_data               = i_edidd
    EXCEPTIONS
      error_in_idoc_control          = 1
      error_writing_idoc_status      = 2
      error_in_idoc_data             = 3
      sending_logical_system_unknown = 4
      OTHERS                         = 5.

* No need for error handling here as the IDOC will be created and ststus record will
* mention the latest ststus including any error message.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2008 08:48:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-a-process-idoc-when-data-in-z-table-updated/m-p/4174839#M998093</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-24T08:48:08Z</dc:date>
    </item>
  </channel>
</rss>

