[ABAP] Unicode Codepoint in Char wandeln

* Unicode Codepoint (UCCP) als 4Char-Hex in Char (akt. Codepage) wandeln
TRY.
    DATA: lv_uccp_c4 TYPE char4 VALUE '0041'.
    WRITE: / cl_abap_conv_in_ce=>uccp( lv_uccp_c4 ).
  CATCH cx_root.
ENDTRY.

TRY.
    DATA: lv_uccp_x2 TYPE x LENGTH 2.
    lv_uccp_x2 = '0042'.
    WRITE: / cl_abap_conv_in_ce=>uccp( lv_uccp_x2 ).
  CATCH cx_root.
ENDTRY.

* Unicode Codepoint (UCCPI) als Integer in Char (akt. Codepage) wandeln
TRY.
    DATA: lv_uccpi TYPE i VALUE 65.
    WRITE: / cl_abap_conv_in_ce=>uccpi( lv_uccpi ).
  CATCH cx_root.
ENDTRY.

Weiterführende Infos: Link

[ABAP] Konvertierung Integer (ASCII) HEX CHAR

Variante 1 (Integer (ASCII) -> HEX -> Char)

DATA: ascii_hex TYPE x.
DATA: char TYPE c.

DO 26 TIMES.
* INT -> HEX
  ascii_hex = 64 + sy-index.

* HEX -> CHAR
  cl_abap_conv_in_ce=>create( encoding = 'UTF-8' )->convert( EXPORTING input = ascii_hex
                                                             IMPORTING data  = char ).

  WRITE: / sy-index, '->', ascii_hex, '->', char.
ENDDO.

Variante 2 (Char -> Hex -> Integer (ASCII))

DATA: char TYPE c VALUE 'A'.
DATA: ascii_hex TYPE xstring.
DATA: ascii_int TYPE i.

DATA(o_conv) = cl_abap_conv_out_ce=>create( encoding = 'UTF-8' endian = 'L' ).
o_conv->write( data = char ).

* CHAR -> HEX
ascii_hex = o_conv->get_buffer( ).

* HEX -> INT
ascii_int = ascii_hex.

WRITE: / char, '->', ascii_hex, '->', ascii_int.