Tuesday, August 30, 2016

Create GUID aka UUID with ABAP

GUIDs or UUIDs can be created with the class cl_system_uuid.


try.
    data(lv_uuid)
= cl_system_uuid=>if_system_uuid_static~create_uuid_c22( ).
  catch cx_uuid_error into data(lo_x).
    message lo_x->get_text( ) type 'E'.
endtry.


The function module GUID_CREATE is no longer supported.

1 comment:

  1. " For raw16 guids
    DATA l_uuid_x16 TYPE sysuuid_x16.
    l_uuid_x16 = NEW cl_system_uuid( )->if_system_uuid~create_uuid_x16( ).

    ReplyDelete

SAP ABAP: Determine Timezone for Plant

    DATA:       lt_tzone TYPE STANDARD TABLE OF tznzone WITH DEFAULT KEY,       l_tzone  TYPE tznzone.     " get time zone for plant   ...