‎2008 Jul 07 8:13 AM
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.
‎2008 Jul 07 8:18 AM
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>
‎2008 Jul 07 8:18 AM
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>
‎2008 Jul 07 8:19 AM
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
‎2008 Jul 07 8:20 AM
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.
‎2008 Jul 07 8:21 AM
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
‎2008 Jul 07 8:28 AM
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.