10-21-2008 8:25 AM
Hi All,
I am comapring two date fields.
First is inverted date which i am converting to normal date through FM "CONVERSION_EXIT_INVDT_OUTPUT" and the output is in the format dd/mm/yyyy.
Second date is in format mm/dd/yyyy.
How can I compare these two dates ?
I can't convert these second date fromat, So please advice me on how to convert first date format dd/mm/yyyy to mm/dd/yyyy ?
Thanks,
Sri Arun Prian.
10-21-2008 8:27 AM
you have to define two variables with type d (format will be YYYYMMDD) and transform both dates into these variables and make comparison afterwards
10-21-2008 8:50 AM
No need to convert the first date, leave it as it is;
Do the following with the second date;
data : lv_date2(10) type c value '10/21/2008', "Date 2
lv_date1 type d value ' 20081020', " Date 1
lv_date2new type d. " date 2 in default format
lv_date2new(4) = lv_date2+6(4). " copy Year
lv_date2new+4(2) = lv_date2(2). " copy Month
lv_date2new+6(2) = lv_date2+3(2). " Copy Day
Now Check/compare the dates.
For example IF lv_date2new EQ lv_Date1 --- > will return False.
Regards
Karthik D
10-21-2008 9:53 AM
Hi,
use FM
FORMAT_DATE_4_OUTPUT
Ex:Import: datin : 20.10.2008
and format : MM/DD/YYYY.
output : 10/20/2008
Regards,
Sathish Reddy.