comparing internal tables

ABAP, Java, BSP, etc.

comparing internal tables

Postby Arda4704 » Tue Feb 08, 2005 1:51 pm

Hi,

Can anyone help me with the name of the function module if there is one to compare two internal tables.

I have a flat file for DATE fields. I have to retrieve the same from the SAP system and compare the both and download the DATE fields into a file which are missing from the flat file.

Any help would be greatly appreciated.

Thanks in advance.
Arda4704
.
.
 
Posts: 5
Joined: Mon Oct 11, 2004 1:46 pm

Postby Logan3964 » Tue Feb 08, 2005 2:10 pm

Hallo,


Code: [Select all] [Expand/Collapse] [Download] (Untitled.txt)
  1. DATA: h_tabix LIKE sy-tabix.
  2. .
  3. .
  4. .
  5. * get data from flat to it_flat
  6. * get data from sap to it_sap
  7. .
  8. .
  9. .
  10. SORT it_flat.
  11. LOOP AT it_sap assigning <sap>.
  12. * hold sy-tabix from LOOP, because he is overwrite by READ
  13.   h_tabix = sy-tabix.
  14.   READ TABLE it_flat TRANSPORTING NO FIELDS
  15.                      WITH KEY data = <sap>-data
  16.                      BINARY SEARCH.
  17.   IF sy-subrc <> 0.
  18.     DELETE it_sap INDEX h_tabix.
  19.   ENDIF.
  20.  
  21. * now in it_sap only data which not in it_flat
GeSHi ©


mfg
Richard
Logan3964
...
...
 
Posts: 386
Joined: Wed Jul 07, 2004 1:53 pm

Postby Alva1590 » Tue Feb 08, 2005 2:14 pm

Code: [Select all] [Expand/Collapse] [Download] (Untitled.txt)
  1. SORT it_flat.
  2. LOOP AT it_sap assigning <sap>.
  3. * In this case, there's no need to save sy-tabix
  4.   READ TABLE it_flat TRANSPORTING NO FIELDS
  5.                      WITH KEY data = <sap>-data
  6.                      BINARY SEARCH.
  7.   IF sy-subrc <> 0.
  8.     DELETE it_sap.
  9.   ENDIF.
  10.  
GeSHi ©
Alva1590
.....
.....
 
Posts: 4387
Joined: Mon Dec 02, 2002 3:01 pm


Return to Development Related

Who is online

Users browsing this forum: No registered users and 6 guests