Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Data Interfaces and Communication Interfaces 

System Class for UUIDs

The methods CREATE_... of the class CL_SYSTEM_UUID create UUIDs with a length of 16 bytes in the following formats:

  • 16-character byte-like representation
  • 22-character character-like representation in Base64
  • 26-character character-like representation in Base32
  • 32-character character-like hexadecimal representation

The methods CONVERT_... convert these formats to each other.

The methods are defined in interfaces like IF_SYSTEM_UUID.

Other versions: 7.31 | 7.40 | 7.54


Example

Creates a 16-character byte-like UUID and converts it to other formats. The program DEMO_UUIDS executes this source code and displays the result.

DATA(system_uuid) = cl_uuid_factory=>create_system_uuid( ). 
TRY. 
    DATA(uuid_x16) = system_uuid->create_uuid_x16( ). 
    system_uuid->convert_uuid_x16( EXPORTING 
                                    uuid = uuid_x16 
                                  IMPORTING 
                                    uuid_c22 = DATA(uuid_c22) 
                                    uuid_c26 = DATA(uuid_c26) 
                                    uuid_c32 = DATA(uuid_c32) ). 
  CATCH cx_uuid_error. 
    ... 
ENDTRY.