Hello All,
I am trying to update rate, price unit, unit of measure in the conditions table using the MODIFY statement as showm below. But the values in the internal table are not getting updated. The work area ls_crcond has the new values but why does the modify statement is failing to update that row in the internal table. Here is the code:-
READ TABLE ct_crcon INTO ls_crcond
WITH KEY vbeln = lw_item-vbeln
kposn = lw_item-posnr
kschl = lv_ts_agr.
IF ls_crcond-kmein NE lv_kmein.
* MOVE lv_kpein TO ls_crcond-kpein.
* MOVE lv_kmein TO ls_crcond-kmein.
* MOVE lv_kumza TO ls_crcond-kumza.
* MOVE lv_kumne TO ls_crcond-kumne.
CALL FUNCTION 'MARM_SINGLE_READ'
EXPORTING
* KZRFB = ' '
* MAXTZ = 0
matnr = lw_item-matid
meinh = ls_crcond-kmein
IMPORTING
wmarm = ls_marm
EXCEPTIONS
wrong_call = 1
not_found = 2
OTHERS = 3.
IF ls_marm-umrez GT 1.
MOVE ls_marm-umrez TO ls_crcond-kpein.
MOVE ls_mara-meins TO ls_crcond-kmein.
MODIFY ct_crcon FROM ls_crcond INDEX sy-tabix TRANSPORTING kpein kmein.
ELSEIF ls_marm-umren GT 1.
ls_crcond-kbetr = ls_crcond-kbetr * ls_marm-umren.
MOVE ls_mara-meins TO ls_crcond-kmein.
MODIFY ct_crcon FROM ls_crcond INDEX sy-tabix TRANSPORTING kbetr kmein.
ENDIF.
ENDIF.
Thanks,