2023 Jun 07 3:38 PM
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.
2023 Jun 07 4:22 PM
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?
2023 Jun 09 4:27 PM
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?
2023 Jun 07 5:46 PM
Please indicate the message. SELECT SINGLE FOR UPDATE is not tagged as obsolete, so it must be something else.
2023 Jun 08 6:44 PM
Table COSR has field HRKFT within the primary key.
That's missing in the WHERE condition . Please check whether that's the issue