I have a condition where I need to check each of record in my it_item table with field "ID No." against the material no. in MARA, and if I found any entry in mara with same Id no. then I have to execute an write statement" Material" otherwise I have to execute a write statement" Not a material"
LOOP AT it_item.
SELECT single matnr from mara where matnr = it_itam-id_no .
IF sy-subrc = 0.
WRITE 'Not a material'.