‎2005 Dec 17 9:37 AM
Hi everybody...
In my input file ,DATE field having 3 different formats
that are <b>dd/mm/yyyy</b> , <b>dd.mm.yyyy </b> and
<b>dd-mm-yyyy.</b>
my doubt is ,how to convert above mentioned date formats into <b>yyyymmdd</b> format .
‎2005 Dec 17 9:40 AM
use the Function module
CONVERT_DATE_TO_INTERNAL
to convert dd/mm/yyyy to yyyymmdd.
regards
vijay
‎2005 Dec 17 9:40 AM
use the Function module
CONVERT_DATE_TO_INTERNAL
to convert dd/mm/yyyy to yyyymmdd.
regards
vijay
‎2005 Dec 17 9:47 AM
replace '.' with '/' dd.mm.yyyy
replace '-' with '/' dd-mm-yyyy
REPLACE ALL OCCURRENCES OF '.' IN date WITH '/'.
REPLACE ALL OCCURRENCES OF '-' IN date WITH '/'.
and use this fm <b>CONVERT_DATE_TO_INTERNAL</b>
make sure you should move the date to char 10 and do replace...
regards
vijay
‎2005 Dec 17 9:54 AM
Hi
In all formats you have the date is always:
DDsMMsYYYY
where s is a separatore and it can be /,. or -, but this isn't important for you, because where the numbes (days, month and year) of day should be important.
The first second positions are always the day, fourth and fifth positions are the month and the last four positions are the year.
So you can always to do:
DATA: DAY_OUT LIKE SY-DATUM.
WRITE: DAY_IN+6(4) TO DAY_OUT(4),
DAY_IN3(2) TO DAY_OUT4(2),
DAY_IN(2) TO DAY_OUT+6(2).
or also:
CONCATENATE DAY_IN6(4)DAY_IN3(2)DAY_IN(2)INTO DAY_OUT.
Max
‎2005 Dec 18 2:52 AM
If it is always in <b>DD</b>x<b>MM</b>x<b>YYYY</b> format then you can simply do:
<b>concatenate input_date+6(4) input_date+3(2) input_date(2) into output_date.</b>