Hello Experts,
I'm trying to update a custom table ( zrerate_dtl ) field ( adj_amt ) after check some logic in the following code. However, field ( adj_amt ) doesn't get updated at all. Can anybody find any issue with the following code and suggest how to rectify it, please?
clear: lv_tabix.
loop at git_zrerate_dtl into gwa_zrerate_dtl.
lv_tabix = sy-tabix.
READ TABLE git_zrerate_dtl_old into gwa_zrerate_dtl_old
WITH KEY zrerate = gwa_zrerate_dtl-zrerate
vbeln = gwa_zrerate_dtl-vbeln
kdmat = gwa_zrerate_dtl-kdmat
posnr = gwa_zrerate_dtl-posnr.
IF sy-subrc = 0 AND gwa_zrerate_dtl-adj_amt <> gwa_zrerate_dtl_old-adj_amt.
gwa_zrerate_dtl-adj_amt = gwa_zrerate_dtl_old-adj_amt.
modify git_zrerate_dtl from gwa_zrerate_dtl index lv_tabix"sy-tabix
transporting adj_amt.
update zrerate_dtl
set adj_amt = lw_zrerate_dtl-adj_amt
where vbeln = lw_zrerate_dtl-vbeln
and kdmat = lw_zrerate_dtl-kdmat
and posnr = lw_zrerate_dtl-posnr.
COMMIT WORK.
ENDIF.
endloop.
Many thanks in advance.