comparing internal tables

ABAP, Java, BSP, etc.
3 Beiträge • Seite 1 von 1
3 Beiträge Seite 1 von 1

comparing internal tables

Beitrag von technocrat ( / / 0 / 3 ) »
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.

gesponsert
Stellenangebote auf ABAPforum.com schalten
kostenfrei für Ausbildungsberufe und Werksstudenten


Beitrag von RiffRaff (Specialist / 379 / 0 / 1 ) »
Hallo,

Code: Alles auswählen.

DATA: h_tabix LIKE sy-tabix.
.
.
.
* get data from flat to it_flat
* get data from sap to it_sap
.
.
.
SORT it_flat.
LOOP AT it_sap assigning <sap>.
* hold sy-tabix from LOOP, because he is overwrite by READ
  h_tabix = sy-tabix.
  READ TABLE it_flat TRANSPORTING NO FIELDS
                     WITH KEY data = <sap>-data
                     BINARY SEARCH.
  IF sy-subrc <> 0.
    DELETE it_sap INDEX h_tabix.
  ENDIF.
ENDLOOP.

* now in it_sap only data which not in it_flat
mfg
Richard

Beitrag von Gast ( / / 0 / 3 ) »

Code: Alles auswählen.

SORT it_flat.
LOOP AT it_sap assigning <sap>.
* In this case, there's no need to save sy-tabix
  READ TABLE it_flat TRANSPORTING NO FIELDS
                     WITH KEY data = <sap>-data
                     BINARY SEARCH.
  IF sy-subrc <> 0.
    DELETE it_sap.
  ENDIF.
ENDLOOP.

Seite 1 von 1

Vergleichbare Themen

1
Antw.
4665
Views
500 Internal Server Error
von kaim77 » 18.12.2018 13:47 • Verfasst in Web-Dynpro, BSP + BHTML
1
Antw.
1003
Views
Internal SAP BADIs implementieren?
von retsch » 07.06.2023 10:54 • Verfasst in ABAP® für Anfänger
0
Antw.
2311
Views
display a Internal table on a SmartForm
von jamiguel77 » 31.12.2014 20:15 • Verfasst in ABAP® für Anfänger
1
Antw.
1128
Views
RFC Tables?
von dimes » 13.03.2006 08:31 • Verfasst in ABAP® Core
0
Antw.
608
Views
Joining Tables to themselves
von pilgrim » 07.07.2006 16:10 • Verfasst in ABAP® Core

Über diesen Beitrag


Unterstütze die Community und teile den Beitrag für mehr Leser und Austausch

Aktuelle Forenbeiträge

Feldwerte vergleichen
vor 35 Minuten von a-dead-trousers 4 / 63
Mahnung erstellen
Gestern von Sebastian82 4 / 167
Absprung VA02 Position
vor 3 Tagen von gs3rr4 gelöst 3 / 155

Newsletter Anmeldung

Keine Beiträge verpassen! Wöchentlich versenden wir lesenwerte Beiträge aus unserer Community.
Die letzte Ausgabe findest du hier.
Details zum Versandverfahren und zu Ihren Widerrufsmöglichkeiten findest du in unserer Datenschutzerklärung.

Aktuelle Forenbeiträge

Feldwerte vergleichen
vor 35 Minuten von a-dead-trousers 4 / 63
Mahnung erstellen
Gestern von Sebastian82 4 / 167
Absprung VA02 Position
vor 3 Tagen von gs3rr4 gelöst 3 / 155

Unbeantwortete Forenbeiträge

OPD Druck im SPOOL
vor 3 Tagen von Manfred K. 1 / 127
Export von Spools in XLSX
vor einer Woche von abapamateur 1 / 1032
Feldberechnung ME32K
vor einer Woche von ZF_SAPler 1 / 1614