‎2007 Oct 31 9:06 AM
my code updates a database table zbh_test but only 1 entry ie, the 4th record
i want all the entries of my internal table, only the header data is getting updated
types:begin of str,
mandt type vbak-mandt,
vbeln type vbak-vbeln,
erdat type vbak-erdat,
user type sy-uname,
end of str.
data:itab type table of str with header line.
data:wa_itab type str.
start-of-selection.
select mandt vbeln erdat from vbak into table itab package size 10.
endselect.
loop at itab.
itab-user = 'bhanum'.
modify itab.
endloop.
modify zbh_test from table itab.
commit work.
please let me know
‎2007 Oct 31 9:13 AM
Hi Bhanu,
do like this
types:begin of str,
mandt type vbak-mandt,
vbeln type vbak-vbeln,
erdat type vbak-erdat,
user type sy-uname,
end of str.
data:itab type table of str.
data:wa_itab type str.
start-of-selection.
select mandt vbeln erdat from vbak into table itab package size 10.
endselect.
loop at itab into wa.
wa-user = 'bhanum'.
modify itab from wa.
endloop.
modify zbh_test from table itab.
commit work.<b>Reward Points if it helps,</b>
Satish
‎2007 Oct 31 10:57 AM
‎2007 Oct 31 9:15 AM
‎2007 Oct 31 11:03 AM
Hi,
change ur code..
start-of-selection.
select mandt vbeln erdat from vbak into corresponding fields of table itab package size 10.
loop at itab into wa_itab.
wa_itab-user = 'bhanum'.
modify itab from wa_itab.
clear wa_itab.
endloop.
modify zbh_test from table itab.
if sy-subrc eq 0.
commit work.
endif.
Rewrad if helpful.
Regards,
Nagaraj