Application Development and Automation 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: 
Read only

Update database records

Former Member
0 Likes
706

Hi gurus,

plea send the procedure how to update and Change the existing records in database for perticular predefined tables.

any one plea send the appropriate answer.

Regards,

sri.

1 ACCEPTED SOLUTION
Read only

0 Likes
674

Hi,

suppose for example KNA1.

here customer 1 is existed in KNA1 table like

kunnr = 1.

name1 = ram.

land1 = in.

ort01 = hyderabad

and here i am changing ort01 value.

data itab like kna1 occurs 0 with header line.

itab-kunnr = '1'.

itab-name1 = 'ram'.

itab-land1 = 'IN'.

itab-ort01 = 'singapore'.

append itab.

update kna1 from itab.

update <database table> from <inttable>

5 REPLIES 5
Read only

0 Likes
675

Hi,

suppose for example KNA1.

here customer 1 is existed in KNA1 table like

kunnr = 1.

name1 = ram.

land1 = in.

ort01 = hyderabad

and here i am changing ort01 value.

data itab like kna1 occurs 0 with header line.

itab-kunnr = '1'.

itab-name1 = 'ram'.

itab-land1 = 'IN'.

itab-ort01 = 'singapore'.

append itab.

update kna1 from itab.

update <database table> from <inttable>

Read only

Former Member
0 Likes
674

HI,

U can use update statement to update the database table.

First bring the records to be updated into an internal table and then update the database table.

For changing the records, first change the values u want to change in the internal table and the use MODIFY statement to modify the table.

Hope this helps u.

Regards,

Arunsri

Read only

Former Member
0 Likes
674

Hi,

Use keyword

UPDATE dbtab FROM TABLE itab.

the structure of itab should be same like dbtab and primary key values of existing records should be same to change the content.

Read only

Former Member
0 Likes
674

Hi Sai,

U can use UPDATE or MODIFY for this..

if u need to change the exixting record then use modify..

MODIFY <DB-TABLE> FROM <ITAB>

in case u need to append new records use.. INSERT...

INSERT <DB-TABLE> FROM table <ITAB>

Regards,

Sai

Edited by: Saikumar on Jul 7, 2008 12:52 PM

Read only

Former Member
0 Likes
674

Hi Sairam,

If you have all the fields which are key fields in the table then append records which you want to update ina internal table and then update using

UPDATE statement:

If you do niot have all key fields then update using

UPDATE and SET statement.

Also, before making any changes in a database table you need to lock the table using fn. module : ENQUEUE_TABLE_E

passing the table name

and unlock the table using fn. module DEQUEUE_TABLE_E.

Hope it helps you.