[ABAP] Konvertierung einstelliges SAP-Sprachenkürzel <-> zweistellige ISO-Sprache

sy-langu -> ISO

* Variante 1 (CONVERSION_EXIT_ISOLA_OUTPUT)
DATA: lv_iso_lang TYPE laiso.

CALL FUNCTION 'CONVERSION_EXIT_ISOLA_OUTPUT'
  EXPORTING
    input  = sy-langu
  IMPORTING
    output = lv_iso_lang.

WRITE: / |{ sy-langu } -> { lv_iso_lang }|.

* Variante 2 (cl_i18n_languages)
DATA(lv_iso_lang) = cl_i18n_languages=>sap1_to_sap2( im_lang_sap1 = sy-langu ).
WRITE: / lv_iso_lang.

ISO -> sy-langu

* Variante 1 (CONVERSION_EXIT_ISOLA_INPUT)
DATA: lv_iso_lang TYPE laiso VALUE 'DE'.
DATA: lv_lang_r3 TYPE sy-langu.

CALL FUNCTION 'CONVERSION_EXIT_ISOLA_INPUT'
  EXPORTING
    input  = lv_iso_lang
  IMPORTING
    output = lv_lang_r3.

WRITE: / |{ lv_iso_lang } -> { lv_lang_r3 }|.

* Variante 2 (cl_i18n_languages)
DATA(lv_lang_r3) = cl_i18n_languages=>sap2_to_sap1( im_lang_sap2 = 'DE' ).
WRITE: / |{ lv_lang_r3 }|.