11-02-2009 10:49 AM
Hello all,
I am trying to change an entry Z table using UPDATE statement.
Even after execution of update the entry is not getting modified.
I have used commit work.
Please guide to resolve the issue.
Thanks.
11-02-2009 10:53 AM
Hi,
Can you send me the update statement your using?
Regards,
Subhashinii
11-02-2009 10:53 AM
Hi,
Can you send me the update statement your using?
Regards,
Subhashinii
11-02-2009 11:03 AM
Consider this-
UPDATE zreq_header SET zstatus_mat = 2
WHERE material = wa_out-material AND
req_no = p_req_no AND
bwtar = wa_out-bwtar AND
werks = wa_out-werks AND
lgort = wa_out-lgort AND
vkorg = wa_out-vkorg AND
vtweg = wa_out-vtweg AND
lgnum = wa_out-lgnum AND
lgtyp = wa_out-lgtyp .
COMMIT WORK.
Following fields are primary keys of zreq_header -
REQ_NO SERIAL_NO MATERIAL MODE_REQ
11-02-2009 11:11 AM
Hi,
The reason its not updating is because your not specificying the full primary key conditions in the WHERE CONDITION OF UPDATE.
So its leading to double entries and update is failing.
Check if for the given data double entries are there in the DB table.
Regards,
Subhashini
11-02-2009 11:37 AM
I have verified the way you suggested.Still i am getting the issue.Please guide.
11-02-2009 11:39 AM
11-02-2009 11:39 AM
11-02-2009 11:40 AM
Hi,
Did you change the update statement to include the full primary key in where condition.
Please can you send that and the dis you check the where condition values which your assigning.
It could be that duplicate entries exist for those values.
Also try using modify and check if it works.
Are you sure your changing an existing entry it your inserting new entry use modify.
Regards,
Subhashini
Edited by: Subhashini K on Nov 2, 2009 5:12 PM