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 DB table

Former Member
0 Likes
398

HI ,

Can i update fields in DB that are key ?

for example .

if i have fields

c

and all the fields are keys and i want to do update it in the DB to

user 123 key

username Joy key

address Germany key

Can i do so since when i try to do UPDATE (mt_table_name) FROM <ls_object>.

i get sy-subrc = 4.

and in the DB table i have the record like

UPDATE (mt_table_name) FROM <ls_object>.

Regards

joy

1 ACCEPTED SOLUTION
Read only

former_member191735
Active Contributor
0 Likes
367

You can update (if your company allowed you to do this). If there is already a record in the table with the same key, it gives you an error

if you use modify statement; The data will be modified if there is a record with the same key else the record will be inserted.

All in all, you cannot have 2 records with same key

Good luck

2 REPLIES 2
Read only

former_member156446
Active Contributor
0 Likes
367

read the SAP help in Modify statement.

Read only

former_member191735
Active Contributor
0 Likes
368

You can update (if your company allowed you to do this). If there is already a record in the table with the same key, it gives you an error

if you use modify statement; The data will be modified if there is a record with the same key else the record will be inserted.

All in all, you cannot have 2 records with same key

Good luck