‎2008 Mar 05 1:08 PM
hi,
i have ztable
mandt key field
ztest1 key field
ztest2 key field
ztest2 non key field
when i'm trying to modify any key field, MODIFY keyword is actually adding a new record in the Database. it is because the new combination of key fields is unique.
i tried using update statement . Update is not working as the combination key is creating a new record which is not present in Db and hence , its not updating.
do we have any workaround on this ??
if i update the key field same field should be updated with other fields intact
please help.
‎2008 Mar 05 1:20 PM
key field means unique record.
if u try to change a key field it will add a new entry.
to an existing entry with a key combination u can change only the non-key fields.
else u need to delete the record combination and add the new combination.
‎2008 Mar 05 1:10 PM
Hi Pratyush,
In this case UPDATE key word works. You must be passing wrong parameters.
Just check your code once again.
Regards,
Atish
‎2008 Mar 05 2:18 PM
hi,
correct me if i'm wrong.
Update keyword works for existing records in the DB table? if after changing the record , the comdination of key fields are already present in the DB, then it will update or else it won't update.(sy-subrc = 4).
‎2008 Mar 05 2:58 PM
‎2008 Mar 06 5:02 AM
‎2008 Mar 05 1:20 PM
key field means unique record.
if u try to change a key field it will add a new entry.
to an existing entry with a key combination u can change only the non-key fields.
else u need to delete the record combination and add the new combination.