Code: Alles auswählen.
* DEKLARATIONEN *
TYPES: BEGIN OF ty_WARN,
WRNUM TYPE DBTAB1-WRNUM,
END OF ty_WARN.
TYPES: BEGIN OF ty_WARA,
WARART TYPE DBTAB2-WARART,
WARNUM TYPE DBTAB2-WARNUM,
END OF ty_WARA.
DATA: itab_WARNUM TYPE STANDARD TABLE OF ty_WARN,
wa_itab_WARNUM TYPE ty_WARN,
itab_WARART TYPE STANDARD TABLE OF ty_WARA,
wa_itab_WARART TYPE ty_WARA.
* START- SELEKTIONSBILD *
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETER: p_test.
SELECTION-SCREEN END OF BLOCK B1.
* PROGRAMM-START *
START-OF-SELECTION.
* DATEN LESEN *
SELECT WARNUM FROM DBTAB1 INTO CORRESPONDING FIELDS OF
TABLE itab_WARNUM WHERE XXX = '1000'.
SELECT WARART FROM DBTAB2 INTO CORRESPONDING FIELDS OF
TABLE itab_WARART FOR ALL ENTRIES IN itab_WARNUM
WHERE WARNUM = WARNUM. "DTVON < SY-DATUM and DTBIS > SY-
DATUM.
* DATEN AUSGEBEN *
LOOP AT itab_WARNUM INTO wa_itab_WARNUM.
WRITE: / wa_itab_WARNUM.
ENDLOOP.
LOOP AT itab_WARART INTO wa_itab_WARART.
WRITE: / wa_itab_WARART.
ENDLOOP.
Wenn du "into corresponding fields" verwendest, dann müssen das Datenbankfeld und das Feld der internen Tabelle auch gleich heißen. Also überprüfe noch einmal die Schreibweise (WRNUM / WARNUM).fl0w hat geschrieben:Code: Alles auswählen.
* DEKLARATIONEN * TYPES: BEGIN OF ty_WARN, WRNUM TYPE DBTAB1-WRNUM, END OF ty_WARN. SELECT WARNUM FROM DBTAB1 INTO CORRESPONDING FIELDS OF TABLE itab_WARNUM WHERE XXX = '1000'.
WHERE WARNUM = itab_WARNUM-WARNUM.fl0w hat geschrieben:Code: Alles auswählen.
SELECT WARART FROM DBTAB2 INTO CORRESPONDING FIELDS OF TABLE itab_WARART FOR ALL ENTRIES IN itab_WARNUM WHERE WARNUM = WARNUM. "DTVON < SY-DATUM and DTBIS > SY- DATUM.
Code: Alles auswählen.
LOOP AT itab_WARNUM INTO wa_itab_WARNUM.
WRITE: / wa_itab_WARNUM.
ENDLOOP.
LOOP AT itab_WARART INTO wa_itab_WARART.
WRITE: / wa_itab_WARART.
ENDLOOP.
Code: Alles auswählen.
SORT itab_WARART.
LOOP at itab_WARNUM INTO wa_itab_WARNUM.
CLEAR wa_itab_WARART.
READ TABLE itab_WARART INTO wa_itab_WARART WITH KEY
WARNUM = wa_itab_WARNUM-WARNUM.
WRITE: / wa_itab_WARNUM-WARNUM,
/ wa_itab_WARART-WARART.
ENDLOOP.
Code: Alles auswählen.
SELECT warnum WARART FROM DBTAB2 INTO CORRESPONDING FIELDS OF
TABLE itab_WARART FOR ALL ENTRIES IN itab_WARNUM
WHERE WARNUM = itab_warnum-WARNUM.