‎2009 Jan 21 8:59 AM
Hi All,
can i use the below statement in loop endloop?
UPDATE zbmt_fsi_detail FROM TABLE i_zbmt_fsi_detail
Or else will it give any dump or perfomance issues?
I want all line items in i_zbmt_fsi_detail should be updated..Please help me out?
‎2009 Jan 21 9:01 AM
‎2009 Jan 21 9:02 AM
Hi,
Instead of the loop you can directly upldate the using statement.
UPDATE zbmt_fsi_detail FROM TABLE i_zbmt_fsi_detail
i_zbmt_fsi_detail should be smae structure as of zbmt_fsi_detail .
‎2009 Jan 21 9:13 AM
Hi Avinash,
Both the structures were same ..So i have used below staement only
UPDATE zbmt_fsi_detail FROM TABLE i_zbmt_fsi_detail.......
But each line item in that internal table is not getting updated to zbmt_fsi_detail.
‎2009 Jan 21 9:03 AM
Hi,
Updating in the loop to the DB table is the performance issue.
so you
try below out side the loop.
MODIFY Z_TABLE from it_table.
here performance will be increased.
Thanks!
‎2009 Jan 21 9:04 AM
hi,
updating a database table will create a performance problrm when large maount of data need to be updated. But update can be done inside a loop i have done similar requiremnt like this updating all the records in the internal tables as below.
LOOP AT it_upd1 INTO wa_upd.
UPDATE zdm_wtyprof SET upload_status = 'S'
WHERE spart = wa_upd-spart
AND mcodesd = wa_upd-mcodesd
AND prof = wa_upd-prof.
CLEAR wa_upd.
ENDLOOP.
‎2009 Jan 21 9:05 AM
This should give you syntax error.
UPDATE can be used in LOOP....ENDLOOP
Refer:
http://help.sap.com/saphelp_NW04/helpdata/en/fc/eb3a94358411d1829f0000e829fbfe/content.htm
‎2009 Jan 21 9:05 AM
Hi,
You can use like that. but the performance will be low. try to get all records in internal table then use that statement outside loop.
Thanks,
Srilakshmi.
‎2009 Jan 21 9:06 AM
‎2009 Jan 21 9:15 AM
Hi Shruti,
UPDATE..FROM TABLE.. is not very meaningful in LOOP ..ENDLOOP..
as it will update the table again ang again from the same table..
Instead either you just use UPDATE..FROM TABLE.. or UPDATE ..FROM wa...in a LOOP
However Update FROM TAble will have better performance anyday.
Each line in your internal table may not be reflected because of the key..
Go to your DB table and check the key columns there..then in your internal table see if any of the records have the same keys.. if u have any such record then it will be written just once in DB..
Edited by: Ankesh Saharan on Jan 21, 2009 2:46 PM