‎2006 Dec 08 11:51 AM
hi
i m having itab with vbeln
and ztable with objnr and ordsent.
where objnr and vbeln are equal
so now when i find objnr EQ vbeln i have to modify the ztable-ordsent = ' '.
i have writen the followin code
LOOP AT lt_ztsd2marc INTO ls_ztsd2marc.
READ TABLE ct_success INTO ls_success WITH KEY ordnr =
ls_ztsd2marc-ordnr.
IF sy-subrc EQ 0.
ls_ztsd2marc-ordsent = ' '.
MODIFY TABLE lt_ztsd2marc FROM ls_ztsd2marc TRANSPORTING ordsent .
MODIFY ztsd2marc FROM TABLE lt_ztsd2marc.
IF sy-subrc EQ 0.
MESSAGE s112(z2).
ENDIF.
ENDIF.
ENDLOOP.
its updating it in work area but the changes are not gettin reflected in the internal table and not even in my ztable ztsd2marc.
plz tell me wat is wrong in this code?
‎2006 Dec 08 11:57 AM
Hi Neha ,
What is the value of SY-SUBRC when you modify the internal table and table.
Regards
Arun
‎2006 Dec 08 11:58 AM
You should not use
<b>MODIFY table</b> with in the loop
try with
<b>modity</b> itab.
and after endloop then update your z table
Message was edited by:
Manohar Reddy K
‎2006 Dec 08 11:59 AM
Hello,
Try using stmt like below :
MODIFY TABLE lt_ztsd2marc FROM ls_ztsd2marc
& use commit work after z table updation.
Thanks.
‎2006 Dec 08 12:05 PM
Hi
Give
<b> Modify itab -> Modifying internal table
Modify ztable -> Modifying Table</b>
Regards
Haritha.
‎2006 Dec 08 12:05 PM
Hi,
Replace
MODIFY TABLE lt_ztsd2marc FROM ls_ztsd2marc TRANSPORTING ordsent .
MODIFY ztsd2marc FROM TABLE lt_ztsd2marc.
by this single statement
MOdify lt_ztsd2marc from ls_ztsd2marc transporting ordsent where ordnr = ls_ztsd2marc-ordnr.
‎2006 Dec 08 12:06 PM
LOOP AT lt_ztsd2marc INTO ls_ztsd2marc.
READ TABLE ct_success INTO ls_success WITH KEY ordnr =
ls_ztsd2marc-ordnr.
IF sy-subrc EQ 0.
ls_ztsd2marc-ordsent = ' '.
MODIFY TABLE lt_ztsd2marc FROM ls_ztsd2marc TRANSPORTING ordsent
where ordnr = ls_ztsd2marc-ordnr .
**MODIFY ztsd2marc FROM TABLE lt_ztsd2marc.
update ztsd2marc set ordsent = it_ztsd2marc-orsent
where ordnr = it_ztsd2marc-ordnr.
IF sy-subrc EQ 0.
MESSAGE s112(z2).
ENDIF.
ENDIF.
ENDLOOP.
‎2006 Dec 08 12:26 PM
hi..
jus try the code below.. it'll def give the solution to ur question.
i've jus modified little of ur code that u posted.
LOOP AT lt_ztsd2marc INTO ls_ztsd2marc.
READ TABLE ct_success INTO ls_success WITH KEY ordnr =
ls_ztsd2marc-ordnr.
IF sy-subrc EQ 0.
ls_ztsd2marc-ordsent = ' '.
MODIFY TABLE lt_ztsd2marc FROM ls_ztsd2marc TRANSPORTING ordsent
where ordnr = ls_ztsd2marc-ordnr .
**MODIFY ztsd2marc FROM TABLE lt_ztsd2marc.
update ztsd2marc set ordsent = it_ztsd2marc-orsent
where ordnr = it_ztsd2marc-ordnr.
IF sy-subrc EQ 0.
MESSAGE s112(z2).
ENDIF.
ENDIF.
ENDLOOP.
all the best