[ABAP] Profilparameter auslesen

Variante 1 (SXPG_PROFILE_PARAMETER_GET)

DATA: lv_par TYPE tpfyvalue-value.
DATA: lv_ret TYPE i.

CALL FUNCTION 'SXPG_PROFILE_PARAMETER_GET'
  EXPORTING
    parameter_name  = 'DIR_GLOBAL'
  IMPORTING
    parameter_value = lv_par
    ret             = lv_ret.

IF lv_ret = 0.
  WRITE: / lv_par.
ELSE.
  WRITE: / 'Access not allowed.'.
ENDIF.

Variante 2 (TH_GET_PROFILE_VALUE)

DATA: lv_par_value type tpfyvalue-value.

CALL FUNCTION 'TH_GET_PROFILE_VALUE'
  EXPORTING
    name           = 'DIR_GLOBAL'
    server         = space
  IMPORTING
    value          = lv_par_value
  EXCEPTIONS
    internal_error = 1
    too_large      = 2
    not_found      = 3
    OTHERS         = 4.

IF sy-subrc = 0.
  WRITE: / lv_par_value.
ENDIF.