2009 Feb 18 6:14 AM
hi all,
can anyone tell me how to update database table row by row???
2009 Feb 18 6:18 AM
Hi,
try this code.
UPDATE t352r from table it_rev " t352r is the name of data bse it_rev is the name of internal table
"or
UPDATE t352r from wa_rev " t352r is the name of data bse wa_rev is the name of work area
thanks
Arun
Edited by: Arun Kayal on Feb 18, 2009 7:19 AM
2009 Feb 18 6:19 AM
This can be done using update statement inside a loop and using of where clause with the update statement.
2009 Feb 18 6:20 AM
hi .
it is a sample code for update ztable
DATA: it_zsdo LIKE STANDARD TABLE OF zsdo WITH HEADER LINE,
wa_it_zsdo LIKE zsdo,
count_loop LIKE sy-tabix.
" Here i am updating zsdo u should change it according to ur need
SELECT * FROM zsdo
INTO CORRESPONDING FIELDS OF TABLE it_zsdo.
* WHERE kunnr in sokunnr
* and bsid in sobsid.
* WHERE ssok = '1'.
BREAK-POINT.
LOOP AT it_zsdo INTO wa_it_zsdo.
* count_loop = sy-tabix.
* wa_it_zsdo-samp_flag = 'X'.
MODIFY zsdo FROM wa_it_zsdo." INDEX count_loop.
ENDLOOP.
" Just paste in in editor window and execute it. after this it will update ur DB table
2009 Feb 18 6:23 AM
Hi
USE UPDATE in loop.
Loop at itab in wa_itab.
update <database table> FROM <wa_itab>.
Endloop.
Amresh.
2009 Feb 18 6:24 AM
Hi,
If you update ztable through internal table you will not get the success or failure update for individual record, but if you do record by record you will get update for each row.
Both statements will work it depends on your requirement and performance
2009 Feb 18 6:27 AM
Hi,
[UPDATE|http://www.sapdb.org/7.4/htmhelp/34/ee7fba293911d3a97d00a0c9449261/content.htm]
Check with this link.
thanks,
Neelima.
2009 Apr 01 5:55 AM