hii Bekir
Within loop create 1 variable say w_matnr.
check if this material is EQ to the material coming through your loop if its same clear ur matnr field
just before endloop write assign value of internal table matnr to w_matnr.
Hope it will work.
Regards
Gaurav