‎2008 Feb 14 4:26 PM
Hello Experts,
I have a scenario where in i need to convert a string which contains date into date format.
ex.
data : l_var1 type string,
l_var2 type dats.
l_var1 = '00.00.0000' " this value depends on the data format setting of the users profile in this ex the date format set by the user is DD.MM.YYYY.
i want to convert the contents of l_var2 to be '00000000'.
My objective is to find out the content of l_var1 is initial which according to my logic is only via convertion to a date/dats format.
Regards,
Om
‎2008 Feb 14 5:11 PM
Hello,
you can use the function CONVERT_DATE_TO_INTERNAL.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
DATE_EXTERNAL = L_VAR1
IMPORTING
DATE_INTERNAL = L_VAR2
EXCEPTIONS
DATE_EXTERNAL_IS_INVALID = 1
OTHERS = 2.
regards,
Kim Werner
‎2008 Feb 14 5:11 PM
Hello,
you can use the function CONVERT_DATE_TO_INTERNAL.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
DATE_EXTERNAL = L_VAR1
IMPORTING
DATE_INTERNAL = L_VAR2
EXCEPTIONS
DATE_EXTERNAL_IS_INVALID = 1
OTHERS = 2.
regards,
Kim Werner
‎2008 Feb 15 5:44 AM