<?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 report program if Z table field is modified/created in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-report-program-if-z-table-field-is-modified-created/m-p/1288054#M154492</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi prashant,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   i'm working on a similar query as that of ur's.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  see the logic is as we proceed in ur case is DISPATCH DATE say are to be modified in the process of inserting 0r changing the contents of a ZTABLE.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt; so here the logic would be &lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;MODIFY ZTABLE FROM TABLE ITAB.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the key reference in our logic .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now it is known that u have a ZTABLE with dispatch date &lt;/P&gt;&lt;P&gt;here the data element will be DATUM . &lt;/P&gt;&lt;P&gt;now in the ZTABLE go to DISPATCH DATE filed i.e its DATA ELEMET double click on data element  DATUM .&lt;/P&gt;&lt;P&gt;now if u see here there will be a tick called as Checkbox on change document which is enabling the CDHDR and CDPOS.&lt;/P&gt;&lt;P&gt;*if its not checked get it checked in . &lt;/P&gt;&lt;P&gt;This is the source to the logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now what u need to do in ur logic part is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. collect all the entries of the table.&lt;/P&gt;&lt;P&gt;(im not sure how many entries are there but try to get all the primary keys + one or two more fields so that the time is saved . this we do to check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. before the modify comes into affect see if u can store all the content of the table i.e step 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.lets say we have modified the ZTABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4.now collect all the entries i.e newly modified into new inttab with same logic as the basic primary key configurations + two fields .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. let the two internal tables be compared and based on the comparision derive a new internal table as follows .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ztemp .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; TYPES: BEGIN OF line,&lt;/P&gt;&lt;P&gt;          brand(10) TYPE c,&lt;/P&gt;&lt;P&gt;          rate(3)   TYPE p DECIMALS 2,&lt;/P&gt;&lt;P&gt;          gender(1) TYPE c,&lt;/P&gt;&lt;P&gt;          sno       TYPE i,&lt;/P&gt;&lt;P&gt;          desc(30)  TYPE c,&lt;/P&gt;&lt;P&gt;        END OF line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DATA: it_lines_1 TYPE TABLE OF line&lt;/P&gt;&lt;P&gt;                  WITH KEY brand&lt;/P&gt;&lt;P&gt;                           rate&lt;/P&gt;&lt;P&gt;                           gender,&lt;/P&gt;&lt;P&gt;       wa_lines_1 LIKE LINE OF it_lines_1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DATA: it_lines_2 TYPE TABLE OF line&lt;/P&gt;&lt;P&gt;                  WITH KEY brand&lt;/P&gt;&lt;P&gt;                           rate&lt;/P&gt;&lt;P&gt;                           gender,&lt;/P&gt;&lt;P&gt;       wa_lines_2 LIKE LINE OF it_lines_2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DATA: gi_counter TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;   PERFORM fill_it_line_1. " not included; tested with your 4 records&lt;/P&gt;&lt;P&gt;   SORT it_lines_1.&lt;/P&gt;&lt;P&gt;   CLEAR gi_counter.&lt;/P&gt;&lt;P&gt;   LOOP AT it_lines_1 INTO wa_lines_1.&lt;/P&gt;&lt;P&gt;     wa_lines_2 = wa_lines_1.&lt;/P&gt;&lt;P&gt;     ADD 1 TO gi_counter.&lt;/P&gt;&lt;P&gt;     AT END OF gender.&lt;/P&gt;&lt;P&gt;       IF gi_counter &amp;gt; 1.&lt;/P&gt;&lt;P&gt;         APPEND wa_lines_2 TO it_lines_2.&lt;/P&gt;&lt;P&gt;       ENDIF.&lt;/P&gt;&lt;P&gt;       CLEAR gi_counter.&lt;/P&gt;&lt;P&gt;     ENDAT.&lt;/P&gt;&lt;P&gt;   ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This only works if you are able to define the fields of the internal table in this order, so with the key fields first in the right order. Otherwise the AT END OF will not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6. now if u can reach upto here then we need not create a background program .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7. u are exactly right change pointers will have to come into picture .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8 .then comes the picture of moving this content to application server using datasets etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps u in building the logic .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i would like to hear from other developers too in this regard.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;vijay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Mar 2006 11:25:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-03-13T11:25:06Z</dc:date>
    <item>
      <title>Trigger report program if Z table field is modified/created</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-report-program-if-z-table-field-is-modified-created/m-p/1288052#M154490</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;I have a requirement where i want to run the report program ONLY if a particular field ( Dispatch date ) is modified or updated of a 'Z' Table ( Custom Table ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The report program would fetch data from the same 'Z' table only for those records which are modified/updated. This data is then transferred to an application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. How should i trigger the report program for the above requirement. &lt;/P&gt;&lt;P&gt;2. If a background program is to be created, then what should be the trigerring criteria &amp;amp; where it should be defined.&lt;/P&gt;&lt;P&gt;3. Do i need to set any change pointers etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pointers to the above requirement would be very helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2006 02:48:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-report-program-if-z-table-field-is-modified-created/m-p/1288052#M154490</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-13T02:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger report program if Z table field is modified/created</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-report-program-if-z-table-field-is-modified-created/m-p/1288053#M154491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think that you should Workflow to achive that -:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Blag.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2006 02:51:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-report-program-if-z-table-field-is-modified-created/m-p/1288053#M154491</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-13T02:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger report program if Z table field is modified/created</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-report-program-if-z-table-field-is-modified-created/m-p/1288054#M154492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi prashant,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   i'm working on a similar query as that of ur's.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  see the logic is as we proceed in ur case is DISPATCH DATE say are to be modified in the process of inserting 0r changing the contents of a ZTABLE.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt; so here the logic would be &lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;MODIFY ZTABLE FROM TABLE ITAB.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the key reference in our logic .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now it is known that u have a ZTABLE with dispatch date &lt;/P&gt;&lt;P&gt;here the data element will be DATUM . &lt;/P&gt;&lt;P&gt;now in the ZTABLE go to DISPATCH DATE filed i.e its DATA ELEMET double click on data element  DATUM .&lt;/P&gt;&lt;P&gt;now if u see here there will be a tick called as Checkbox on change document which is enabling the CDHDR and CDPOS.&lt;/P&gt;&lt;P&gt;*if its not checked get it checked in . &lt;/P&gt;&lt;P&gt;This is the source to the logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now what u need to do in ur logic part is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. collect all the entries of the table.&lt;/P&gt;&lt;P&gt;(im not sure how many entries are there but try to get all the primary keys + one or two more fields so that the time is saved . this we do to check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. before the modify comes into affect see if u can store all the content of the table i.e step 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.lets say we have modified the ZTABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4.now collect all the entries i.e newly modified into new inttab with same logic as the basic primary key configurations + two fields .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. let the two internal tables be compared and based on the comparision derive a new internal table as follows .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ztemp .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; TYPES: BEGIN OF line,&lt;/P&gt;&lt;P&gt;          brand(10) TYPE c,&lt;/P&gt;&lt;P&gt;          rate(3)   TYPE p DECIMALS 2,&lt;/P&gt;&lt;P&gt;          gender(1) TYPE c,&lt;/P&gt;&lt;P&gt;          sno       TYPE i,&lt;/P&gt;&lt;P&gt;          desc(30)  TYPE c,&lt;/P&gt;&lt;P&gt;        END OF line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DATA: it_lines_1 TYPE TABLE OF line&lt;/P&gt;&lt;P&gt;                  WITH KEY brand&lt;/P&gt;&lt;P&gt;                           rate&lt;/P&gt;&lt;P&gt;                           gender,&lt;/P&gt;&lt;P&gt;       wa_lines_1 LIKE LINE OF it_lines_1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DATA: it_lines_2 TYPE TABLE OF line&lt;/P&gt;&lt;P&gt;                  WITH KEY brand&lt;/P&gt;&lt;P&gt;                           rate&lt;/P&gt;&lt;P&gt;                           gender,&lt;/P&gt;&lt;P&gt;       wa_lines_2 LIKE LINE OF it_lines_2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DATA: gi_counter TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;   PERFORM fill_it_line_1. " not included; tested with your 4 records&lt;/P&gt;&lt;P&gt;   SORT it_lines_1.&lt;/P&gt;&lt;P&gt;   CLEAR gi_counter.&lt;/P&gt;&lt;P&gt;   LOOP AT it_lines_1 INTO wa_lines_1.&lt;/P&gt;&lt;P&gt;     wa_lines_2 = wa_lines_1.&lt;/P&gt;&lt;P&gt;     ADD 1 TO gi_counter.&lt;/P&gt;&lt;P&gt;     AT END OF gender.&lt;/P&gt;&lt;P&gt;       IF gi_counter &amp;gt; 1.&lt;/P&gt;&lt;P&gt;         APPEND wa_lines_2 TO it_lines_2.&lt;/P&gt;&lt;P&gt;       ENDIF.&lt;/P&gt;&lt;P&gt;       CLEAR gi_counter.&lt;/P&gt;&lt;P&gt;     ENDAT.&lt;/P&gt;&lt;P&gt;   ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This only works if you are able to define the fields of the internal table in this order, so with the key fields first in the right order. Otherwise the AT END OF will not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6. now if u can reach upto here then we need not create a background program .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7. u are exactly right change pointers will have to come into picture .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8 .then comes the picture of moving this content to application server using datasets etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps u in building the logic .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i would like to hear from other developers too in this regard.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;vijay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2006 11:25:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-report-program-if-z-table-field-is-modified-created/m-p/1288054#M154492</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-13T11:25:06Z</dc:date>
    </item>
  </channel>
</rss>

