Code: Alles auswählen.
SELECT *
FROM kna1
INTO TABLE it_kunnr
FOR ALL ENTRIES IN it_my_kunnr
WHERE kunnr = it_my_kunnr-kunnr.
LOOP AT it_my_kunnr INTO wa_my_kunnr.
READ TABLE it_kunnr
WITH KEY kunnr = wa_my_kunnr-kunnr
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
" Eintrag in KNA1 vorhanden
ELSE.
" Kein Eintrag in KNA1 vorhanden
WRITE: / wa_my_kunnr-kunnr.
ENDIF.
ENDLOOP.
Code: Alles auswählen.
it_my_kunnr2[] = it_my_kunnr[].
SORT it_my_kunnr2 BY kunnr.
DELETE ADJACENT DUPLICATES FROM it_my_kunnr2 COMPARING kunnr.
SELECT *
FROM kna1
INTO TABLE it_kunnr
FOR ALL ENTRIES IN it_my_kunnr2
WHERE kunnr = it_my_kunnr2-kunnr.
LOOP AT it_my_kunnr2 INTO wa_my_kunnr.
READ TABLE it_kunnr
WITH KEY kunnr = wa_my_kunnr-kunnr
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
" Eintrag in KNA1 vorhanden
ELSE.
" Kein Eintrag in KNA1 vorhanden
WRITE: / wa_my_kunnr-kunnr.
ENDIF.
ENDLOOP.
Code: Alles auswählen.
SORT it_my_kunnr BY kunnr.
LOOP AT it_my_kunnr INTO wa_my_kunnr.
AT NEW kunnr.
READ TABLE it_kunnr
WITH KEY kunnr = wa_my_kunnr-kunnr
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
" Eintrag in KNA1 vorhanden
ELSE.
" Kein Eintrag in KNA1 vorhanden
WRITE: / wa_my_kunnr-kunnr.
ENDIF.
ENDAT.
ENDLOOP.