‎2006 Sep 28 8:46 AM
hi all,
how to convert the date format for ex.
i have date yyyymmdd but i want to change to ddmmyyyy . hw can possible.
regards.
amjad
‎2006 Sep 28 9:23 AM
U can either use the given fm by others or simply use a write statement.
WRITE ldate to lfdate ddmmyyyy.
ldate -> variable containing the date in yyyymmdd format
lfdate -> output with date in ddmmyyyy format.
Regards
Anurag
‎2006 Sep 28 8:51 AM
Hi,
Use Function module Convert_date_format for this. This will work.
‎2006 Sep 28 8:52 AM
‎2006 Sep 28 8:52 AM
Hi,
use the Function module <b>CONVERT_DATE_TO_EXTERNAL</b>
See the below link for more Date converstions:-
http://www.sap-basis-abap.com/sapab015.htm
Regards
Sudheer
‎2006 Sep 28 8:55 AM
Hi ,
USE THE FOLLOWING CODE to convert the date into ur required format.
DATA : date1(10) value sy-datum.
data: l_f_date(10).
write date1 to l_f_date dd/mm/yyyy.
hope it will solve your problem .
regards,
‎2006 Sep 28 8:55 AM
USE FOLLOWING EXAMPLE
data : ld_date(10) type c.
write irecord-datab to ld_date dd/mm/yyyy.
data : ld_date1(10) type c.
write irecord-datub to ld_date1 dd/mm/yyyy.
IT WILL WORK .
THANKS
Maheedhar.T
‎2006 Sep 28 9:08 AM
Hello,
Do not use any function module or some "concatenate" statement. I guess you want to switch from system date format to european format (ddmmyyyy).
Date and amount format are defined in IMG for all country, then if a user wants a specific format, this is set up in his own user settings. Do not re-create what SAP already did.
If you want to determine format based on a country, process as below:
set country <country code>
write <my_variable_date> to <my_variable_string>
or
write:/001 <my_variable_date>
If you want to use user own settings then process as below:
write <my_variable_date> to <my_variable_string>
or
write:/001 <my_variable_date>
As you can see statement "set country <country code>" is used to get data from table t005x (where country code format are defined) otherwise if you don't use it, the "write" statement will use format that has been defined in t.code SU3 (user specific)
Let me know if you need additional informations,
Mehdi
‎2006 Sep 28 9:23 AM
U can either use the given fm by others or simply use a write statement.
WRITE ldate to lfdate ddmmyyyy.
ldate -> variable containing the date in yyyymmdd format
lfdate -> output with date in ddmmyyyy format.
Regards
Anurag
‎2011 Sep 27 2:50 PM