‎2006 Dec 04 12:42 PM
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 = ' '.
plz can any one can tell me can i modify the ztable directly if yes then how?
‎2006 Dec 04 12:45 PM
create a workarea which is of the structure of your z-table.
move all the required values into that workarea.
use the following statement
<b>modify ZTABLE from WA</b>
thx
pavan
‎2006 Dec 04 12:45 PM
Hello,
you can do coding as below :
loop at itab.
select single * from ztable into ztable where objnr = itab-vbeln.
if sy-subrc eq 0.
ztable-ordsent = ' '.
***update stmts with commit.
endif.
endloop.
Hope it helps.
Thanks.
‎2006 Dec 04 12:45 PM
hi neha,
1. do like this.
2.
LOOP AT ZTABLE.
READ TABLE ITAB WITH KEY VBLEN = ZTABLE-OBJNR.
<b> IF SY-SUBRC = 0.
ZTABLE-ORDSENT = ''.
MODIFY ZTABLE FROM ZTABLE.
ENDIF.</b>
ENDLOOP.
ENDLOOP.
3. Ztable (internal table)
and Actual ZTABLE should be same structure.
regards,
amit m.
‎2006 Dec 04 12:49 PM
hi Neha,
do this way ..
seect * from ztable in to table itab2 for all entries of itab where objnr = itab-vbeln.
if sy-subrc = 0.
loop at itab2.
ztable-ordsent = ' '.
modify ztable from itab2 transporting rdsent.
endloop.
Regards,
Santosh
‎2006 Dec 04 12:52 PM
data : v_tabix like sy-tabix.
loop at ztable.
v_tabix = sy-tabix.
read table itab with key vbeln = ztable-objnr.
if sy-subrc = 0.
ztable-ordsent = ' '.
modify ztable index v_tabix.
endif.
clear: ztable, itab, v_tabix.
endloop.
‎2006 Dec 04 12:53 PM
Hi Neha,
Get ztable records into an internal table ztable.
Loop at Ztable.
Read table itab with key vbeln = ztable-objnr.
if sy-subrc = 0.
ztable-ordsent = ' '.
modify ztable.
endif.
Hope this helps.
Regards,
Sudheer
‎2006 Dec 04 1:21 PM
Hi Neha,
You can modify Z_TABLE. Please have look in the below example.
loop at itab into wa_tab.
select *
into wa_ztable
from ztable where objnr eq wa_tab-vbeln.
if sy-subrc eq 0.
* lock the entry using FM 'ENQUEUE_Ztablelockobject
wa_ztable-ordsent = space.
modify ztable from wa_ztable.
if sy-subrc ne 0.
* Unlock table entry using FM 'DEQUEUE_Ztablelockobject'
message 'Error while modifying' type 'E'.
endif.
* Unlock table entry using FM 'DEQUEUE_Ztablelockobject'I hope above pseucode will helps you.
Regards
Bhupal Reddy