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 statement not working

Former Member
0 Likes
378

Hi,

I want to modify the record of PA0009 .I want to change the enddate of personnel No.

UPDATE PA0009 SET ENDDA = '30.10.2009'

WHERE PERNR = '1'

AND BEGDA = '01.09.2008'.

The above statement is not working. How to modify the enddate which is part of key table.

Please guide.

Thanks and Regards

K Srinivas

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
329

Hi,

Try this


UPDATE PA0009 SET ENDDA = '20091030'
WHERE PERNR = '1'
AND BEGDA = '20080901'.

2 REPLIES 2
Read only

Former Member
0 Likes
330

Hi,

Try this


UPDATE PA0009 SET ENDDA = '20091030'
WHERE PERNR = '1'
AND BEGDA = '20080901'.

Read only

Former Member
0 Likes
329

Hello,

Set the data format to the internal date format (YYYYMMDD), so in the set and the where clause pass '20091030' as ENDA which is to be changed and BEGDA in the where clause as 20080901. Also if the after the changes if the key combination results in dupicate records then the update will faiil. Just make sure that the combination of PERNR,SUBTY,OBJPS,SPRPS,ENDDA, BEGDA and SEQNR remains unique, if a record exists with this combination then sy-subrc will be 4 and the record will not be updated.

Regards,

Sachin