Convert date to internal format

Convert date to internal format

With 7.40 :


DATA : lw_date_ext TYPE char10,
       lw_date TYPE datum.

lw_date = |{ lw_date_ext+6(4) }{ lw_date_ext+3(2) }{ lw_date_ext(2) }|.

With FM :


DATA : lw_date_ext TYPE char10,
       lw_date     TYPE datum.

  CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
    EXPORTING
      date_external = lw_date_ext    " ==> 10.10.2017
    IMPORTING
      date_internal = lw_date        " ==> 20171010
    EXCEPTIONS
      date_external_is_invalid = 1.

See also Convert date to external format.

About the author

fjourneau administrator

Hi, I'm Florian Journeau, SAP ABAP R3 Freelance, based in Toulouse, France. You want to know more about me, have a look on my CV : cv.fjourneau.net.

Leave a Reply