‎2008 Jul 16 2:04 AM
Hi all,
i have a flat file with a date field(YYYYMMDD),
how can i convert this into user defined format.
Regards
Hema
‎2008 Jul 16 4:42 AM
Hi,
Take the date from your flat file into an internal table along with all other fields and then Make use of FM CONVERT_DATE_TO_EXTERNAL .
This should solve your problem.
Pls reward if useful.
Regards,
lalit
‎2008 Jul 16 4:19 AM
e.g. The write statement will convert the internal format into the user defined date format.
Either do a write / date_field.
Or write date_field to other_field.
Hope that helps,
Michael
‎2008 Jul 16 4:24 AM
‎2008 Jul 16 4:42 AM
Hi,
Take the date from your flat file into an internal table along with all other fields and then Make use of FM CONVERT_DATE_TO_EXTERNAL .
This should solve your problem.
Pls reward if useful.
Regards,
lalit
‎2008 Jul 16 4:45 AM
‎2008 Jul 16 5:41 AM
Hello Hema,
The write statement will work for you.
write w_date1 to w_date2.
(where w_date2 is your required format.)
Regards
Indu.
‎2008 Jul 16 5:42 AM
Hi
You can try the following ways and check.
1. Write:/ date1 DD/MM/YYYY.
2. Using Concatenate Statement you can achieve the desired format.
Hope this would help you.
Murthy
‎2008 Jul 16 6:01 AM
Use
WRITE Date_variable TO Date_variable
USING EDIT MASK '__/__/____'.
"USING EDIT MASK ........... use the format desired.
‎2008 Jul 16 6:01 AM
Hi Hema.
I would like to suggest a few,
You can try---> using Edit mask statement.
or
Concatenation date with offsets.
or
use: source to target conversion DD/MM/YYYY or vice versa.
or
Try using function modules------->
DATE_CONV_EXT_TO_INT - Conversion of dates to SAP internal format (Check sy-subrc)
PDOT_DATE_CONVERT Convert date (yyyymmdd >dd.mm.yyyy)
CONVERT_DATE_TO_INTERN_FORMAT Converts a date to internal format
CONVERT_DATE_TO_EXTERNAL Conversion: Internal to external date (like screen conversion)
CONVERT_DATE_TO_INTERNAL Conversion: External to internal date (like screen conversion)
Hope that's usefull.
Good Luck & Regards.
Harsh Dave
Edited by: Harsh Dave on Jul 16, 2008 10:34 AM