Code: Alles auswählen.
TYPES: tp_book type table of ZBC_BOOK. "ist it_book
TYPES: tp_kat type table of ZBC_KATEGORIE. "ist it_kat
* die eigene Tabelle mit typen von beiden ist it_korb
types: begin of tp_korb,
z_isbn type z_isbn,
z_titel type z_titel,
z_subtitel type z_subtitel,
z_autor type z_autor,
z_kat_name type z_kat_name, "kat_name ist nur in it_kat vorhanden. und ist der FK von.. "it_books-kategorie
end of tp_korb.
types: tt_korb type standard table of tp_korb. "ist it_korb
Code: Alles auswählen.
LOOP AT it_books INTO wa_books.
APPEND wa_books-z_isbn TO it_korb.
APPEND wa_books-z_titel TO it_korb.
.....
SELECT * FROM ZBC_KATEGORIE INTO TABLE it_kat where Z_KATEGORIE = wa_books-z_kategorie.
loop at it_kat into wa_kat.
APPEND wa_kat-z_kat_name TO it_korb.
endloop.
ENDLOOP.
Code: Alles auswählen.
DATA wa_korb LIKE LINE OF it_korb.
LOOP AT it_books INTO wa_books.
MOVE wa_books-z_isbn TO wa_korb-z_isbn.
MOVE wa_books-z_titel TO wa_korb-z_titel.
.....
SELECT * FROM ZBC_KATEGORIE INTO TABLE it_kat where Z_KATEGORIE = wa_books-z_kategorie.
loop at it_kat into wa_kat.
MOVE wa_kat-z_kat_name TO it_korb.
* kann es wirklich mehr als einen Eintrag dazu geben?
endloop.
APPEND wa_korb TO it_korb.
ENDLOOP.