Code: Alles auswählen.
SELECT tiban~iban tiban~banks tiban~bankl tiban~bankn
FROM tiban
APPENDING table gt_iban
WHERE tiban~iban IN o_iban.
clear wa_iban.
LOOP AT gt_iban INTO wa_iban. " Felder aus TIBAN in ITAB schreiben
write: wa_iban-iban to itab-iban,
wa_iban-banks to itab-banks,
wa_iban-bankl to itab-bankl,
wa_iban-bankn to itab-bankn.
* Felder aus KNBK dazu lesen
clear wa_knbk.
SELECT * FROM knbk INTO wa_knbk
WHERE banks = wa_iban-banks
and bankl = wa_iban-bankl
and bankn = wa_iban-bankn.
WRITE: wa_knbk-kunnr to itab-kunnr.
ENDSELECT.
Code: Alles auswählen.
* Felder aus KNBK dazu lesen
clear wa_knbk.
SELECT * FROM knbk INTO wa_knbk
WHERE banks = wa_iban-banks
and bankl = wa_iban-bankl
and bankn = wa_iban-bankn.
WRITE: wa_knbk-kunnr to itab-kunnr.
ENDSELECT.
* Felder aus KNA1 dazu lesen
clear wa_kna1.
SELECT * FROM kna1 INTO wa_kna1
WHERE kunnr = wa_knbk-kunnr.
write: wa_kna1-loevm to itab-loevm,
wa_kna1-xzemp to itab-xzemp,
wa_kna1-name1 to itab-name1,
wa_kna1-name2 to itab-name2,
wa_kna1-stras to itab-stras,
wa_kna1-pstlz to itab-pstlz,
wa_kna1-ort01 to itab-ort01.
endselect.
append itab. " Zeile an ITAB anhängen
clear itab. " Zwischenspeicher der ITAB löschen, damit keine Altdaten übertragen werden
ENDLOOP.
Code: Alles auswählen.
* Felder aus KNBK dazu lesen
clear wa_knbk.
SELECT * FROM knbk INTO wa_knbk
WHERE banks = wa_iban-banks
and bankl = wa_iban-bankl
and bankn = wa_iban-bankn.
WRITE: wa_knbk-kunnr to itab-kunnr.
* Felder aus KNA1 dazu lesen
clear wa_kna1.
SELECT single * FROM kna1 INTO wa_kna1
WHERE kunnr = wa_knbk-kunnr.
write: wa_kna1-loevm to itab-loevm,
wa_kna1-xzemp to itab-xzemp,
wa_kna1-name1 to itab-name1,
wa_kna1-name2 to itab-name2,
wa_kna1-stras to itab-stras,
wa_kna1-pstlz to itab-pstlz,
wa_kna1-ort01 to itab-ort01.
append itab. " Zeile an ITAB anhängen
clear itab. " Zwischenspeicher der ITAB löschen, damit keine Altdaten übertragen werden
endselect.
Code: Alles auswählen.
SELECT tiban~iban tiban~banks tiban~bankl tiban~bankn
FROM tiban
APPENDING table gt_iban
WHERE tiban~iban IN o_iban.
clear wa_iban.
LOOP AT gt_iban INTO wa_iban. " Felder aus TIBAN in ITAB schreiben
write: wa_iban-iban to itab-iban,
wa_iban-banks to itab-banks,
wa_iban-bankl to itab-bankl,
wa_iban-bankn to itab-bankn.
* Felder aus KNBK dazu lesen
clear wa_knbk.
SELECT * FROM knbk INTO wa_knbk
WHERE banks = wa_iban-banks
and bankl = wa_iban-bankl
and bankn = wa_iban-bankn.
WRITE: wa_knbk-kunnr to itab-kunnr.
* Felder aus KNA1 dazu lesen
clear wa_kna1.
SELECT single * FROM kna1 INTO wa_kna1
WHERE kunnr = wa_knbk-kunnr.
write: wa_kna1-loevm to itab-loevm,
wa_kna1-xzemp to itab-xzemp,
wa_kna1-name1 to itab-name1,
wa_kna1-name2 to itab-name2,
wa_kna1-stras to itab-stras,
wa_kna1-pstlz to itab-pstlz,
wa_kna1-ort01 to itab-ort01.
append itab. " Zeile an ITAB anhängen
clear itab. " Zwischenspeicher der ITAB löschen, damit keine Altdaten übertragen werden
ENDSELECT.
endloop.
Folgende Benutzer bedankten sich beim Autor Alexander D. für den Beitrag:
thr-hn