Code: Alles auswählen.
LOOP AT pt_people INTO ls_people.
REFRESH: lt_temp_people[], lt_people[].
CLEAR ls_people.
ls_people-mandt = sy-mandt.
ls_people-name = ls_people-name.
* LOOP über ls_people Struktur
APPEND ls_people TO lt_people.
* temporäre interne Tabelle wird befüllt
CLEAR ls_people.
REFRESH lt_temp_people.
lt_temp_people[] = lt_people[].
REFRESH lt_people.
* LOOP über temporäre interne Tabelle
LOOP AT lt_temp_people INTO ls_people.
* LOOP über die Adressliste
LOOP AT ls_people-addresslist INTO ls_addresslist.
ls_people-city = ls_addresslist-city.
ls_people-county = ls_addresslist-country.
* Struktur mit nun zusätlich mit Adressen der internen Tabelle hinzugefügt
APPEND ls_people TO lt_people.
ENDLOOP.
* hier wird geprüft, ob überhaupt etwas in der Adressliste ist. Falls nicht, muss hier die Struktur hinzugefügt werden
IF sy-subrc <> 0.
APPEND ls_people TO lt_people.
ENDIF.
ENDLOOP.
CLEAR ls_people.
REFRESH lt_temp_people.
lt_temp_people[] = lt_people[].
REFRESH lt_people.
LOOP AT lt_temp_people INTO ls_people.
LOOP AT ls_people-nationalitylist INTO ls_nationalitylist.
ls_people-country = ls_nationalitylist-country.
ls_people-code = ls_nationalitylist-code.
APPEND ls_people TO lt_people.
ENDLOOP.
IF sy-subrc <> 0.
APPEND ls_people TO lt_people.
ENDIF.
ENDLOOP.
APPEND LINES OF lt_people TO gt_people.
ENDLOOP.
Code: Alles auswählen.
LOOP AT pt_people INTO ls_people.
...
LOOP AT lt_name INTO ld_name.
...
LOOP AT lt_temp_people INTO ls_people.
...
LOOP AT ls_people-addresslist INTO ls_addresslist.
...
ENDLOOP. "LOOP AT ls_people-addresslist
...
ENDLOOP. "LOOP AT lt_temp_people
...
LOOP AT lt_temp_people INTO ls_people.
...
LOOP AT ls_people-nationalitylist INTO ls_nationalitylist.
...
ENDLOOP. "LOOP AT ls_people-nationalitylist
...
ENDLOOP. "LOOP AT lt_temp_people
...
ENDLOOP. "LOOP AT lt_name
...
ENDLOOP. "LOOP AT pt_people
Folgende Benutzer bedankten sich beim Autor a-dead-trousers für den Beitrag:
ABAP_User
Nein. Denn normalerweise besteht kein Grund, diese Daten in eine einzige DB-Tabelle zu kippen (Stichwort Normalisierung).ABAP_User hat geschrieben:Soweit verständlich?