cancel
Showing results for 
Search instead for 
Did you mean: 

How to determine the value for semantic identifier (RAP BO, managed, Strict mode v2)

A__R_
Explorer
0 Kudos

Hello all,

I have developed a RAP managed BO.

This has as primary key a UUID (read only, numbering : managed ).

A semantic identifier is assigned via a determination (on CREATE, as described in the SAP Help) and determined by a number range object (cl_numberrange_runtime=>number_get).

Unfortunatly this leads to a Runtime Error: BEHAVIOR_ILLEGAL_STATEMENT when the strict mode 2 is activated.

What would be the recommended procedure to provide the semantic key with a unique value?

Unfortunately the info from the runtime error is not helpful:

Method ADJUST_NUMBERS is only available when late numbering is used (-> Unmanaged)

A__R_
Explorer
0 Kudos

Inspiration and ideas are more than welcome.

View Entire Topic
lloydfernandes
Advisor
Advisor
0 Kudos

Hello Alexander,

Since your RAP BO is a managed scenario, and you've marked the key field as `read only, numbering : managed` in your behavior definition, this would fall under the managed internal early numbering category. The RAP managed runtime automatically draws a UUID during the CREATE request. You do not need to generate the value explicitly.

The ADJUST_NUMBERS method, on the other hand, can be made use of to generate a value for the key field only if the BO is late numbering enabled and is of type Unmanaged or Unmanaged Save.

Please refer to Early Numbering.

Regards,

Lloyd

A__R_
Explorer
0 Kudos

Hello lloydfernandes ,

I'll try to make my question a little clearer with an example.

DB table Z_Process:

Key ProcessUUID : UUID;
Process : char10;
Property1 : ...;
...
  • ProcessUUID
    represents the technical key and is assigned automatically (`read only, numbering : managed')
  • Process
    represents the semantic key and is to be drawn from a number range when saving

(similar/like travel_uuid and travel_id -> Example SAP Help )

When the determination is executed and the number range is updated, a dump occurs if strict mode 2 is active.
determination internalSetNextId on save { create; }