‎2007 Aug 02 1:34 PM
Dear All,
can you correct the code,, here I'm dynamically updating the ZRUNID and ZRUNDATE for the selected range of MATNR, but the values are not updating into the table.
IF NOT DEL_TAB_MARA[] IS INITIAL.
INSERT ZMARA_H FROM TABLE DEL_TAB_MARA.
UPDATE ZMARA_H SET: ZRUNID = P_I_RUNID
ZRUNDATE = SY-DATUM
WHERE MATNR IN MATNR1.
ENDIF.
with best regards
mahesh
‎2007 Aug 02 1:45 PM
Hi,
I think before the UPDATE statment, you need to have a record in the header i mean the MATNR should have a value then only it will update it,
Regards
Sudheer
‎2007 Aug 02 1:45 PM
Hi,
Did ou do a COMMIT WORK after the INSERT and UPDATE statements.
Regards,
Sesh
‎2007 Aug 03 9:37 AM
Hi Mahesh,
My suggestion is to update the internal table with runid and rundate before inserting into the customized table.
IF NOT DEL_TAB_MARA[] IS INITIAL.
Loop at MATNR1.
wa_del_tab_mara-zrunid = p_i_runid.
wa_del_tab_mara-zrundate = sy-datum.
Modify del_tab_mara from wa_del_tab_mara transporting zrunid zrundate
where MATNR eq MATNR1-matnr.
Endloop.
INSERT ZMARA_H FROM TABLE DEL_TAB_MARA.
ENDIF.