on ‎2025 Mar 05 2:30 PM
I have a database table with a field GUID as primary key (TYPE RAW16). Now, I want to insert a row, and therefore I use cl_system_uuid=>create_uuid_x16_static( ) in order to create the key.
I am looking for the best approach to deal with the exception CX_UUID_ERROR. My current thought is not to handle it at all! So, if the creation of the GUID failed, a dump would occur. Not nice, but what is a better alternative?
Of course, I could catch the exception, but I have no proper idea what to do in the handler. Setting an initial value for the GUID before the INSERT e.g. doesn't seem to be a good solution either...
Any recommendations?
By the way, I am wondering why SAP has inherited from CX_STATIC_CHECK instead of CX_NO_CHECK...
data: ls_row type zmy_table.
* Omit exception handling on purpose...
ls_row-guid = cl_system_uuid=>create_uuid_x16_static( ).
ls_row-field1 = 'any content'.
insert zmy_table from ls_row.
...
Request clarification before answering.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 6 | |
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.