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.
12101
Views
500 Internal Server Error
von kaim77 » 18.12.2018 13:47 • Verfasst in Web-Dynpro, BSP + BHTML
1
Antw.
3641
Views
Internal SAP BADIs implementieren?
von retsch » 07.06.2023 10:54 • Verfasst in ABAP® für Anfänger
0
Antw.
9445
Views
display a Internal table on a SmartForm
von jamiguel77 » 31.12.2014 20:15 • Verfasst in ABAP® für Anfänger
0
Antw.
1965
Views
Joining Tables to themselves
von pilgrim » 07.07.2006 16:10 • Verfasst in ABAP® Core
4
Antw.
4770
Views
TABLES-Parameter vs. RFC-Fkt.bst
von ralf.wenzel » 09.05.2015 17:28 • Verfasst in ABAP® Core

Über diesen Beitrag


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

Aktuelle Forenbeiträge

BAPI zur ABSO?
vor 4 Tagen von DeathAndPain 2 / 724
Materialstammerweiterung: Neuer Reiter
vor einer Woche von DeathAndPain gelöst 4 / 1381
Ermittlung der Arbeitstage (Mosid)
vor 2 Wochen von Radinator 11 / 47053
LSMW-Problem
vor 4 Wochen von DeathAndPain gelöst 6 / 4960

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

BAPI zur ABSO?
vor 4 Tagen von DeathAndPain 2 / 724
Materialstammerweiterung: Neuer Reiter
vor einer Woche von DeathAndPain gelöst 4 / 1381
Ermittlung der Arbeitstage (Mosid)
vor 2 Wochen von Radinator 11 / 47053
LSMW-Problem
vor 4 Wochen von DeathAndPain gelöst 6 / 4960