cancel
Showing results for 
Search instead for 
Did you mean: 

How to update key field in RAP managed scenario?

HugoJ
Product and Topic Expert
Product and Topic Expert
0 Kudos
792

I am implementing a RAP based List Report app in S/4HANA On-Premise 2022 and have the need to update a key field during a determination method.

The scenario is a simple Document Header table with multiple Items (child entities), and whenever an item is deleted I want to redetermine all the Item positions of the document to make sure they stay ordered (10, 20, etc.).

Example: If Item number 10 is deleted, Item 20 would become 10, Item 30 would become 20 and so on.

However the item position field is part of the primary key of the item table, and possibly that is preventing the EML MODIFY statement from working correctly. Is there a way to update a key field in this managed scenario?
I would like to avoid having a separate GUID type key, and also deleting the items and re-inserting them inside the same determination method doesn't seem to work either.

Thank you

View Entire Topic
Andre_Fischer
Product and Topic Expert
Product and Topic Expert

Hi Hugo,

there is no way to update key fields, but what you can try is to change the layout of the key.

I would suggest you use UUID based key fields. And just use the position as a semantic key which is calculated by your determination and that is used for sorting in your UI.

Kind regards,

Andre

 

Georgi
Explorer
0 Kudos

Hi @Andre_Fischer 

is there a way to update those on create determination in managed scenario?

I have the userid as a key field, but I would like to set it from the backend and not to pass if from the UI.

Regards,

Georgi

Georgi
Explorer
0 Kudos

Hi Andre,

I was able to workaround it with the managed with unmanaged save implementation.

Kind Regards,

Georgi