<?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: table records issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-records-issue/m-p/9286329#M1724549</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amine,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure if you are referring to database or internal table for rows processing. With assumption that this is internal table, here is code example that creates rows to et_result_table for situations when rows with same counter value have different statuses:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; TYPES BEGIN OF &lt;SPAN style="font-size: 10pt;"&gt;lty_status_s&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TYPES &lt;SPAN style="font-size: 10pt;"&gt;counter&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; TYPE &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;i&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TYPES &lt;SPAN style="font-size: 10pt;"&gt;status&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; TYPE &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;i&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; TYPES END OF &lt;SPAN style="font-size: 10pt;"&gt;lty_status_s&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt; TYPES &lt;SPAN style="font-size: 10pt;"&gt;lty_status_tt&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; TYPE TABLE OF &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;lty_status_s&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; METHODS &lt;SPAN style="font-size: 10pt;"&gt;find_diff_statuses_same_key&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IMPORTING &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; it_source_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; TYPE &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;lty_status_tt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXPORTING &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; et_result_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; TYPE &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;lty_status_tt&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;METHOD &lt;SPAN style="font-size: 10pt;"&gt;find_diff_statuses_same_key&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&amp;nbsp; DATA &lt;SPAN style="font-size: 10pt;"&gt;lt_sorted_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; TYPE &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;lty_status_tt&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DATA &lt;SPAN style="font-size: 10pt;"&gt;ls_sorted_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; TYPE &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;lty_status_s&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DATA &lt;SPAN style="font-size: 10pt;"&gt;ls_new_status_row&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; TYPE &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;lty_status_s&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DATA &lt;SPAN style="font-size: 10pt;"&gt;l_last_counter&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; TYPE &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;I&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; lt_sorted_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;it_source_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SORT &lt;SPAN style="font-size: 10pt;"&gt;lt_sorted_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; ASCENDING BY &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;counter&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;status&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOOP AT &lt;SPAN style="font-size: 10pt;"&gt;lt_sorted_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; INTO &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;ls_sorted_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AT NEW &lt;SPAN style="font-size: 10pt;"&gt;status&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF ( &lt;SPAN style="font-size: 10pt;"&gt;l_last_counter&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;ls_sorted_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;counter&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; ).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt;"&gt;ls_new_status_row&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;ls_sorted_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ls_new_status_row&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;status&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #3399ff; font-size: 10pt;"&gt;10&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;. &lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;" set new status here&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; APPEND &lt;SPAN style="font-size: 10pt;"&gt;ls_new_status_row&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; TO &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;et_result_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDIF.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDAT.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; l_last_counter&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;ls_sorted_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;counter&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&amp;nbsp; ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First I sorted table by counter and status. Then I am processing rows one by one. In case if there is new status found, I compare counter. If counter value is same as for last row, it means that we have situation as you described - for same counter, two different statuses. Then we copy the row to new table and update status to new (example 10). For simplification I used only counter comparison, but you can add also condition that last date must be equal as well as last counter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not know exactly your requirements, if you can have more than one situation of same counter and many different statuses, or duplicated rows etc. This algorithm shows power of AT NEW statement that is triggered when sorted table finds next different value for column. If you want to extend algorithm you can also use AT NEW counter, or AT END OF status, AT END OF counter. AT END OF is triggered when loop is processing last same value for particular column. These statements are useful for algorithms with data duplications and may run common actions for same values in column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Adam &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Feb 2013 16:41:05 GMT</pubDate>
    <dc:creator>adam_krawczyk1</dc:creator>
    <dc:date>2013-02-21T16:41:05Z</dc:date>
    <item>
      <title>table records issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-records-issue/m-p/9286322#M1724542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an issue with records in a table.&lt;/P&gt;&lt;P&gt;I want to know if i can solve it with an Abap logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea is if for the same date i have 2 records with the same key and differents status , then copy this record and assign a third status.&lt;/P&gt;&lt;P&gt;FYI, i will do it in a datasource user exit for BW.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 14:42:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-records-issue/m-p/9286322#M1724542</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-02-21T14:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: table records issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-records-issue/m-p/9286323#M1724543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yes you can. You need to loop then do a read for the entry with same key and date, copy it and change the status. You will need another table to store the new results though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;swanand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 14:49:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-records-issue/m-p/9286323#M1724543</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-02-21T14:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: table records issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-records-issue/m-p/9286324#M1724544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amine,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't understand how can two records have the same key.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 15:02:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-records-issue/m-p/9286324#M1724544</guid>
      <dc:creator>kakshat</dc:creator>
      <dc:date>2013-02-21T15:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: table records issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-records-issue/m-p/9286325#M1724545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kumar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually you are right.&lt;/P&gt;&lt;P&gt;It was a mistake from my part, it's the counter the key of my table.&lt;/P&gt;&lt;P&gt;What bother me, i am already doing a treatment in my user exit and now i have to combine the two of them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;IF &lt;/SPAN&gt;s_data_cats&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;refcounter &lt;SPAN class="L0S52"&gt;IS &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;NOT &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;INITIAL&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;SELECT &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;SINGLE &lt;/SPAN&gt;catshours &lt;SPAN class="L0S52"&gt;FROM &lt;/SPAN&gt;catsdb &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;wa_hours &lt;SPAN class="L0S52"&gt;WHERE &lt;/SPAN&gt;counter &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;s_data_cats&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;refcounter&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;IF &lt;/SPAN&gt;sy&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;subrc &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S32"&gt;0&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s_data_cats&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;catshours &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;s_data_cats&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;catshours &lt;SPAN class="L0S70"&gt;- &lt;/SPAN&gt;wa_hours&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And now, if the ref counter is not initial&lt;/P&gt;&lt;P&gt;and the record containg the counter and the other one containing the refcounter have the same date, i have to create a record similair the ref counter but with another statut.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;Amine&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 15:29:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-records-issue/m-p/9286325#M1724545</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-02-21T15:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: table records issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-records-issue/m-p/9286326#M1724546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can we create an internal table in CMOD user exit for BW?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 15:41:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-records-issue/m-p/9286326#M1724546</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-02-21T15:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: table records issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-records-issue/m-p/9286327#M1724547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, so that should be simple now. Isn't it? I guess all you need to do is match the date for the two records (counter and reference counter) inside the IF block on sy-subrc. Also, you will need to modify your SELECT on catsdb so as to retrieve the entire record rather than just the catshours field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 16:14:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-records-issue/m-p/9286327#M1724547</guid>
      <dc:creator>kakshat</dc:creator>
      <dc:date>2013-02-21T16:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: table records issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-records-issue/m-p/9286328#M1724548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes in fact.&lt;/P&gt;&lt;P&gt;But i have another concern. All records must have a counter.&lt;/P&gt;&lt;P&gt;How can i manage the record that i am creating?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 16:38:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-records-issue/m-p/9286328#M1724548</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-02-21T16:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: table records issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-records-issue/m-p/9286329#M1724549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amine,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure if you are referring to database or internal table for rows processing. With assumption that this is internal table, here is code example that creates rows to et_result_table for situations when rows with same counter value have different statuses:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; TYPES BEGIN OF &lt;SPAN style="font-size: 10pt;"&gt;lty_status_s&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TYPES &lt;SPAN style="font-size: 10pt;"&gt;counter&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; TYPE &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;i&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TYPES &lt;SPAN style="font-size: 10pt;"&gt;status&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; TYPE &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;i&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; TYPES END OF &lt;SPAN style="font-size: 10pt;"&gt;lty_status_s&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt; TYPES &lt;SPAN style="font-size: 10pt;"&gt;lty_status_tt&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; TYPE TABLE OF &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;lty_status_s&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; METHODS &lt;SPAN style="font-size: 10pt;"&gt;find_diff_statuses_same_key&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IMPORTING &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; it_source_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; TYPE &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;lty_status_tt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXPORTING &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; et_result_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; TYPE &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;lty_status_tt&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;METHOD &lt;SPAN style="font-size: 10pt;"&gt;find_diff_statuses_same_key&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&amp;nbsp; DATA &lt;SPAN style="font-size: 10pt;"&gt;lt_sorted_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; TYPE &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;lty_status_tt&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DATA &lt;SPAN style="font-size: 10pt;"&gt;ls_sorted_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; TYPE &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;lty_status_s&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DATA &lt;SPAN style="font-size: 10pt;"&gt;ls_new_status_row&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; TYPE &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;lty_status_s&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DATA &lt;SPAN style="font-size: 10pt;"&gt;l_last_counter&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; TYPE &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;I&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; lt_sorted_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;it_source_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SORT &lt;SPAN style="font-size: 10pt;"&gt;lt_sorted_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; ASCENDING BY &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;counter&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;status&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOOP AT &lt;SPAN style="font-size: 10pt;"&gt;lt_sorted_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; INTO &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;ls_sorted_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AT NEW &lt;SPAN style="font-size: 10pt;"&gt;status&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF ( &lt;SPAN style="font-size: 10pt;"&gt;l_last_counter&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;ls_sorted_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;counter&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; ).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt;"&gt;ls_new_status_row&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;ls_sorted_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ls_new_status_row&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;status&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #3399ff; font-size: 10pt;"&gt;10&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;. &lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;" set new status here&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; APPEND &lt;SPAN style="font-size: 10pt;"&gt;ls_new_status_row&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; TO &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;et_result_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDIF.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDAT.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; l_last_counter&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;ls_sorted_table&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;counter&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&amp;nbsp; ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First I sorted table by counter and status. Then I am processing rows one by one. In case if there is new status found, I compare counter. If counter value is same as for last row, it means that we have situation as you described - for same counter, two different statuses. Then we copy the row to new table and update status to new (example 10). For simplification I used only counter comparison, but you can add also condition that last date must be equal as well as last counter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not know exactly your requirements, if you can have more than one situation of same counter and many different statuses, or duplicated rows etc. This algorithm shows power of AT NEW statement that is triggered when sorted table finds next different value for column. If you want to extend algorithm you can also use AT NEW counter, or AT END OF status, AT END OF counter. AT END OF is triggered when loop is processing last same value for particular column. These statements are useful for algorithms with data duplications and may run common actions for same values in column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Adam &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 16:41:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-records-issue/m-p/9286329#M1724549</guid>
      <dc:creator>adam_krawczyk1</dc:creator>
      <dc:date>2013-02-21T16:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: table records issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-records-issue/m-p/9286330#M1724550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Adam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the great explanations &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1214/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Actually i never used the methods in Abap, i am working on BW side, but my aim is to improve my abap skills, it's very usefull when i am stuck especially at exctraction level when the bsuiness needs are complicated &lt;SPAN __jive_emoticon_name="wink" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1214/images/emoticons/wink.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that Kumar solution is more easy for me to implement and it takes in account the dates constraints.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 16:49:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-records-issue/m-p/9286330#M1724550</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-02-21T16:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: table records issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-records-issue/m-p/9286331#M1724551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That would depend on how the counter value is determined. If it's a sequential counter, you probably just need to increment the current value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 17:09:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-records-issue/m-p/9286331#M1724551</guid>
      <dc:creator>kakshat</dc:creator>
      <dc:date>2013-02-21T17:09:17Z</dc:date>
    </item>
  </channel>
</rss>

