04-16-2008 6:28 PM
hi,
Can any one tell me that, if we use MODIFY statement to update database table from an internal table then if the database table contains all key fields then it will be modifying the exxisting values from a module pool transaction. becuse when i am doing that the table is getting appending,instead of modifying the values
04-16-2008 6:31 PM
Basically the way it works is that if you are using the FROM addition, like
MODIFY <db_table> from <workarea>
The system will look at the key values from the DB table, and if they patch the field values in the workarea, then this record will be modfied, meaning any non-key fields will be updated from the workarea, if the runtime does not find a key match, then the record will be INSERTed into the db table.
Regards,
Rich Heilman
04-17-2008 6:35 AM
hai
kiran,
MODIFY = UPDATE + INSERT.
it means wgen modify is used, it first checks the key fields of existing records.
if matches, then checks with non-key fields.
if matches, no modifications are done.
if not matches , then modify the non-key fields.
if not matches,
then it insert new record into db table.
so, Modify should work with both insert and modifying functionalities.
reward points , if useful
thank you
prasad
Edited by: PRASAD GVK on Apr 17, 2008 7:48 AM
04-17-2008 6:54 AM
When You are using MODIFY statement to update the DB table then, if all the key fields are there it should modify the existing record otherwise it will append a new record. Make sure that all the key fields are there in your case.
04-17-2008 11:10 PM
Hi Kiran,
MODIFY statement can act as both update and insert.
First it checks whether the record is present for that particular key ,if it is present it will update the record.
If it is not present , then it will insert a new record.
Reward points if useful.
Thanks & Regards,
AMK.