Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

updation

Former Member
0 Kudos
144

hi all,

can anyone tell me how to update database table row by row???

7 REPLIES 7

Former Member
0 Kudos
108

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

Former Member
0 Kudos
108

This can be done using update statement inside a loop and using of where clause with the update statement.

Former Member
0 Kudos
108

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

Former Member
0 Kudos
108

Hi

USE UPDATE in loop.

Loop at itab in wa_itab.

update <database table> FROM <wa_itab>.

Endloop.

Amresh.

Former Member
0 Kudos
108

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

Former Member
0 Kudos
108

Hi,

[UPDATE|http://www.sapdb.org/7.4/htmhelp/34/ee7fba293911d3a97d00a0c9449261/content.htm]

Check with this link.

thanks,

Neelima.

0 Kudos
108

hi,

problem solved.

thanks