<?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: Internal table record checking (Urgent) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773004#M907876</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunil,&lt;/P&gt;&lt;P&gt;Thanks for the reply. can you also tell me that if suppose 2 and 4 is duplicate of 1 and i need to fill a duplicate field of 1 with  2 and 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I do it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Means&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lifnr      banks     duplicate&lt;/P&gt;&lt;P&gt;1           xx         2, 3&lt;/P&gt;&lt;P&gt;2          xx         3   etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like that&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 May 2008 13:02:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-02T13:02:42Z</dc:date>
    <item>
      <title>Internal table record checking (Urgent)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3772999#M907871</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 internal table having records. I want to check each record of the table with every other record to find out if there exist same record for more then one key field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody help me to place the logic for how i can check the records with each record? Like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lifnr     banks&lt;/P&gt;&lt;P&gt;1         12&lt;/P&gt;&lt;P&gt;2         34&lt;/P&gt;&lt;P&gt;3         12&lt;/P&gt;&lt;P&gt;4         12&lt;/P&gt;&lt;P&gt;5          76&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to find out 1,3 and 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a ton in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 12:43:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3772999#M907871</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T12:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table record checking (Urgent)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773000#M907872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Moni,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try the Below Piece of Code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA:
  jtab LIKE itab.

jtab = itab.

LOOP AT itab INTO wa.
  LOOP AT jtab INTO wa1 WHERE banks EQ wa-banks.
      write:
        / wa-banks.
  ENDLOOP.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;OR&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try the Below Piece of Code what it does is Fetches the First record and Compares it with all the other Records:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: w_index TYPE i,
w_lines TYPE i.

DESCRIBE itab LINES w_lines.

LOOP AT itab INTO wa.
  w_index = sy-tabix + 1.
  DO.  
  READ TABLE itab INTO wa1 INDEX w_index.
    IF w_index &amp;lt;= w_lines.
      IF wa-banks EQ wa1-banks.
        write:
          / wa-banks.
      ENDIF.
    ELSE.
      EXIT.
    ENDIF.
   ADD 1 TO w_index.
  ENDDO.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sunil.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 12:47:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773000#M907872</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T12:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table record checking (Urgent)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773001#M907873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Moni,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       just try this logic&lt;/P&gt;&lt;P&gt;          du_itab[]  = itab[] .   * store all the table records into another table*&lt;/P&gt;&lt;P&gt;            loop at  itab into wa.     " here  one record comes into workarea&lt;/P&gt;&lt;P&gt;             read table  du_itab into du_wa   with key  du_wa-number = wa-number.  &lt;/P&gt;&lt;P&gt;*&lt;STRONG&gt;( here read command checks in the table du_itab  if any same  record exits and  that record puts into the  du_wa)&lt;/STRONG&gt;***&lt;/P&gt;&lt;P&gt;            endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  just try like above u can get..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Surya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 12:51:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773001#M907873</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T12:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table record checking (Urgent)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773002#M907874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Moni,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this sample code, wherein we can seperate the duplicated records and store them in a seperate internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    LOOP AT it_data INTO wa_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      index_1 = sy-tabix.&lt;/P&gt;&lt;P&gt;      index_1 = index_1 + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      LOOP AT it_data INTO wa_data FROM index_1&lt;/P&gt;&lt;P&gt;               WHERE plant     = wa_data-plant&lt;/P&gt;&lt;P&gt;                 AND material  = wa_file_data1-zmaterial&lt;/P&gt;&lt;P&gt;                 AND fisc_year = wa_file_data1-zfisc_year.&lt;/P&gt;&lt;P&gt;        MOVE-CORRESPONDING wa_data  TO wa_data1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        APPEND wa_data1 TO it_data1.&lt;/P&gt;&lt;P&gt;        CLEAR: wa_data, wa_data1.&lt;/P&gt;&lt;P&gt;        flag = c_01.&lt;/P&gt;&lt;P&gt;        IF flag = c_01.&lt;/P&gt;&lt;P&gt;          flag = 0.&lt;/P&gt;&lt;P&gt;          index_1 = index_1 - 1.&lt;/P&gt;&lt;P&gt;          n1_i = n1_i + c_01.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&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;&lt;/P&gt;&lt;P&gt;Hope this is helpful to you. If you need further information, revert back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward all the helpful answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Nagaraj T&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 12:52:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773002#M907874</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T12:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table record checking (Urgent)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773003#M907875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This works&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA:
  BEGIN OF rec1,
    lifnr(1),
    bank(2),
  END OF rec1,
  itab LIKE STANDARD TABLE OF rec1.
DATA:
  BEGIN OF rec2,
    bank(2),
    count      TYPE i,
  END OF rec2,
  itab2 LIKE STANDARD TABLE OF rec2.

START-OF-SELECTION.

  PERFORM build_table.

  REFRESH itab2.
  LOOP AT itab INTO rec1.
    rec2-bank = rec1-bank.
    rec2-count = 1.
    COLLECT rec2 INTO itab2.
  ENDLOOP.
  LOOP AT itab2 INTO rec2
    WHERE count GT 1.
    LOOP AT itab INTO rec1
      WHERE bank EQ rec2-bank.
      WRITE:/ 'Bank', rec1-bank, 'Lifnr', rec1-lifnr.
    ENDLOOP.
  ENDLOOP.


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  build_table
*&amp;amp;---------------------------------------------------------------------*
FORM build_table.

  rec1-lifnr = '1'.
  rec1-bank = '12'.
  APPEND rec1 TO itab.

  rec1-lifnr = '2'.
  rec1-bank = '34'.
  APPEND rec1 TO itab.

  rec1-lifnr = '3'.
  rec1-bank = '12'.
  APPEND rec1 TO itab.

  rec1-lifnr = '4'.
  rec1-bank = '12'.
  APPEND rec1 TO itab.

  rec1-lifnr = '5'.
  rec1-bank = '76'.
  APPEND rec1 TO itab.

ENDFORM.                    " build_table
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the Output&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Bank 12 Lifnr 1    
Bank 12 Lifnr 3    
Bank 12 Lifnr 4    
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 13:00:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773003#M907875</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T13:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table record checking (Urgent)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773004#M907876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunil,&lt;/P&gt;&lt;P&gt;Thanks for the reply. can you also tell me that if suppose 2 and 4 is duplicate of 1 and i need to fill a duplicate field of 1 with  2 and 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I do it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Means&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lifnr      banks     duplicate&lt;/P&gt;&lt;P&gt;1           xx         2, 3&lt;/P&gt;&lt;P&gt;2          xx         3   etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like that&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 13:02:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773004#M907876</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T13:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table record checking (Urgent)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773005#M907877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Moni,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there exists a third field called Duplicate (of type Char or STRING)and if you want to fill it with the Duplicates, If yes, then try the Foll Code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA:
  jtab            LIKE itab,
  w_duplicate(10) TYPE c.
 
jtab = itab.
 
LOOP AT itab INTO wa.
  LOOP AT jtab INTO wa1 WHERE banks EQ wa-banks.
    CONCATENATE w_duplicate wa1-lifnr INTO w_duplicate SEPARATED BY SPACE.
    wa-duplicate = w_duplicate.
    MODIFY itab FROM wa.
  ENDLOOP.
ENDLOOP.

LOOP AT itab INTO wa.
  write:
    / wa-lifnr,
      wa-banks,
      wa-duplicates.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that was related to your Doubt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sunil.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sunil Saini on May 2, 2008 3:15 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 13:14:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773005#M907877</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T13:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table record checking (Urgent)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773006#M907878</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;Use the below logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;       lifnr type lifnr,&lt;/P&gt;&lt;P&gt;       banks type i,&lt;/P&gt;&lt;P&gt;      end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: v_count type i,&lt;/P&gt;&lt;P&gt;      v_banks type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data wa like itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-lifnr = 1.&lt;/P&gt;&lt;P&gt;itab-banks = 12.&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-lifnr = 2.&lt;/P&gt;&lt;P&gt;itab-banks = 34.&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-lifnr = 3.&lt;/P&gt;&lt;P&gt;itab-banks = 12.&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-lifnr = 4.&lt;/P&gt;&lt;P&gt;itab-banks = 12.&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-lifnr = 5.&lt;/P&gt;&lt;P&gt;itab-banks = 76.&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by banks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab index 1.&lt;/P&gt;&lt;P&gt;v_banks = itab-banks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;if not v_banks = itab-banks.&lt;/P&gt;&lt;P&gt; v_banks = itab-banks.&lt;/P&gt;&lt;P&gt; write:/5 wa-lifnr, 20 wa-banks, 40 'Count = ', v_count.&lt;/P&gt;&lt;P&gt; clear v_count.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;wa = itab.&lt;/P&gt;&lt;P&gt; v_count = v_count + 1.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt; write:/5 wa-lifnr, 20 wa-banks, 40 'Count = ', v_count.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 13:19:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773006#M907878</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T13:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table record checking (Urgent)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773007#M907879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually i have that Duplicate field in the table where I am storing all the matching records. In that case how I can modify that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I am filling it with itab-duplicate = wa1-lifnr. where all other fields are initializing with wa then it is doing but not in an ordered manner&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mean in one it is showing 4 and in 4 showing 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for Help Sunil, But Cna you sort this too?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 13:22:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773007#M907879</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T13:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table record checking (Urgent)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773008#M907880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Moni,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF&lt;/STRONG&gt; in my First Reply the Second technique was working then this should solve your Problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA:
  w_index TYPE i,
  w_lines TYPE i,
  w_duplicate(10) TYPE c.
 
DESCRIBE itab LINES w_lines.
 
LOOP AT itab INTO wa.
  w_index = sy-tabix + 1.
  DO.  
  READ TABLE itab INTO wa1 INDEX w_index.
    IF w_index &amp;lt;= w_lines.
      IF wa-banks EQ wa1-banks.
        CONCATENATE w_duplicate wa1-lifnr INTO w_duplicate SEPARATED BY SPACE.
        wa-duplicate = w_duplicate.
        MODIFY itab FROM wa.
      ENDIF.
    ELSE.
      EXIT.
    ENDIF.
   ADD 1 TO w_index.
  ENDDO.
ENDLOOP.

LOOP AT itab INTO wa.
  write:
    / wa-lifnr,
      wa-banks,
      wa-duplicates.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ELSE&lt;/STRONG&gt; try the below code it is same as above except one more Internal Table is used:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA:
  w_index 	  TYPE i,
  w_lines 	  TYPE i,
  jtab            LIKE itab,
  w_duplicate(10) TYPE c.
 
DESCRIBE itab LINES w_lines.
 
LOOP AT itab INTO wa.
  w_index = sy-tabix + 1.
  DO.  
  READ TABLE jtab INTO wa1 INDEX w_index.
    IF w_index &amp;lt;= w_lines.
      IF wa-banks EQ wa1-banks.
        CONCATENATE w_duplicate wa1-lifnr INTO w_duplicate SEPARATED BY SPACE.
        wa-duplicate = w_duplicate.
        MODIFY itab FROM wa.
      ENDIF.
    ELSE.
      EXIT.
    ENDIF.
   ADD 1 TO w_index.
  ENDDO.
ENDLOOP.

LOOP AT itab INTO wa.
  write:
    / wa-lifnr,
      wa-banks,
      wa-duplicates.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sunil.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 13:34:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773008#M907880</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T13:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table record checking (Urgent)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773009#M907881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your first code is working for me. But when I am putting the concatenate stat it is showing &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lifnr    duplicate&lt;/P&gt;&lt;P&gt; 1        2&lt;/P&gt;&lt;P&gt; 2        2&lt;/P&gt;&lt;P&gt; 4        2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in my case 1  = 2   and 2  = 4 or 1 = 2, 4 something like that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help in this lastly.......?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 13:54:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773009#M907881</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T13:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table record checking (Urgent)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773010#M907882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Moni,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think that it will work using First Code because we have used &lt;STRONG&gt;LOOP&lt;/STRONG&gt; with &lt;STRONG&gt;WHERE&lt;/STRONG&gt; condition so it will take all the Records starting from &lt;STRONG&gt;First&lt;/STRONG&gt; to &lt;STRONG&gt;Last&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;So for this only Second Code(Technique) can Solve the Problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sunil.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 14:37:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-record-checking-urgent/m-p/3773010#M907882</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T14:37:03Z</dc:date>
    </item>
  </channel>
</rss>

