You should do this using a Modify statement as in below −
LOOP AT itab. SELECT SINGLE matnr INTO itab-matnr FROM zlldet WHERE palet = itab-palet. MODIFY itab. ENDLOOP.
Also note that when you have an internal table itab with a header line, it means that you have a table itab and structure itab and usage of this depends on the situation. Few of the commands like MODIFY and LOOP AT uses both at the same time.
DATA itab TYPE TABLE OF [something]. DATA wa TYPE [something]. LOOP AT itab INTO wa. " copies each line into wa SELECT SINGLE matnr INTO wa-matnr FROM zlldet WHERE palet = itab-palet. MODIFY itab FROM wa. " writes the changed line back to the table ENDLOOP.
Also, note the below points.