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: 

What is the replacement for SELECT SINGLE * FOR UPDATE in EHP8?

ajay_mukundan2
Explorer
0 Kudos
349

Hello Gurus,

My team is working on an upgrade project from ECC 6.0 EHP0 to EHP8.

When we do a FUNCTIONAL_DB ATC check, we get an error to remediate the below code.

Kindly let me know the replacement for the below query suitable for EHP8:

SELECT SINGLE FOR UPDATE * FROM cosr
WHERE lednr = coepr_ins-lednr
AND objnr = coepr_ins-objnr
AND gjahr = coepr_ins-gjahr
AND wrttp = coepr_ins-wrttp
AND versn = coepr_ins-versn
AND stagr = coepr_ins-stagr
AND vrgng = coepr_ins-vrgng
AND perbl = perbl.

The SELECT ... FOR UPDATE statement retrieves columns from a uniquely specified row of the database table and simultaneously set an update lock on the selected row. (Reference)

*Note that I referred to this EHP8 ABAP documentation link and didn't find a reference about a replacement for " Select single * FOR UPDATE.." statement.

4 REPLIES 4

raymond_giuseppi
Active Contributor
0 Kudos
243

What was the error text, was it related to missing key HRKFT?

Are you actually updating statistical key figure in a custom program with Abap sql statements and not BAPI such as BAPI_KEYFIGURE_CREATEMULTIPLE or BAPI_KEYFIGURE_GETDETAIL+ BAPI_KEYFIGURE_CHANGEMULTIPLE?

243

This primary keys was added with SAP 4.7 (740905 - G_COEPR_CHECK: New key field w/ SELECT)

You never get warning from SCI or similar tool?

Sandra_Rossi
Active Contributor
0 Kudos
243

Please indicate the message. SELECT SINGLE FOR UPDATE is not tagged as obsolete, so it must be something else.

harald_lesche-holzbecher
Product and Topic Expert
Product and Topic Expert
0 Kudos
243

Table COSR has field HRKFT within the primary key.

That's missing in the WHERE condition . Please check whether that's the issue