Sunday, November 25, 2007

Convert date from internal to external format

The function CONVERSION_EXIT_PDATE_OUTPUT should be used to convert a date
from its internal to external format. It automatically takes the user's
date type for the external format (i.e. 20071013 -> 10/13/2007).

data: lv_date_im TYPE d,
lv_date_ex(10).
lv_date_im = xyz-Datum.

CALL FUNCTION 'CONVERSION_EXIT_PDATE_OUTPUT'
EXPORTING
INPUT = lv_date_im
IMPORTING
OUTPUT = lv_date_ex.

xyz-Datum = lv_date_ex.

No comments: