on 03-30-2023 1:44 PM
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)
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 : ...;
...
(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; }
User | Count |
---|---|
77 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.