Application Development 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: 

Update statement not working

sanjay_deshpande4
Participant
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Can you send me the update statement your using?

Regards,

Subhashinii

7 REPLIES 7

Former Member
0 Kudos

Hi,

Can you send me the update statement your using?

Regards,

Subhashinii

0 Kudos

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

0 Kudos

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

0 Kudos

I have verified the way you suggested.Still i am getting the issue.Please guide.

0 Kudos

why dont u try INSERT ???

0 Kudos

why dont u try INSERT ???

0 Kudos

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