Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Update Statement

Former Member
0 Likes
371

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

3 REPLIES 3
Read only

Former Member
0 Likes
352

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

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
352

Hi,

Did ou do a COMMIT WORK after the INSERT and UPDATE statements.

Regards,

Sesh

Read only

Former Member
0 Likes
352

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.