I wish to write a SELECT query to find valid materials in a text file and then show them in a new page. Can someone help to explain why this does not work? f_mvke is the file name and t_mvke is the temporary table.
if f_mvke is not initial.
loop at t_mvke.
select single * from MARA WHERE matnr = t_mvke-matnr.
if sy-subrc = 0.
select single * from MVKE WHERE matnr = t_mvke-matnr AND vkorg = t_mvke-vkorg AND vtweg = '11'.
if sy-subrc = 0.
select single * from MAKT WHERE matnr = t_mvke-matnr AND spras = 'D' AND maktx = t_mvke-maktx.
endif.
skip 1.
write: / 'Verkaufs Org' ,20 t_mvke-vkorg.
write: / 'Material Nummer' ,20 t_mvke-matnr.
write: / 'Material Text' ,20 t_mvke-maktx.
ok_count = ok_count + 1.
endif.
endloop.
endif.