[ABAP] Datum in formatierten String konvertieren

DATA: l_dat TYPE nlei-ibgdt.
DATA: l_str TYPE rn1datum-datex.

l_dat = sy-datum.

CALL FUNCTION 'FORMAT_DATE_4_OUTPUT'
  EXPORTING
    datin  = l_dat
    format = 'YYYY-MM-DD'
  IMPORTING
    datex  = l_str.

WRITE: / l_str.