on 11-19-2007 12:28 PM
function module to convert date format from yyyymmdd to mmddyyyy format
Hi Rajitha,
Do like this
Data: Var1 type sy-datum,
var2(8) type c.
var1 = sy-datum.
Concatanate var1+4(2) var1+6(2) var1+0(4) into var2.
write var2.
Reward Points if this helps,
Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Satish Panakala wrote:
Hi Rajitha,
Do like this
Data: Var1 type sy-datum, var2(8) type c. var1 = sy-datum. Concatanate var1+4(2) var1+6(2) var1+0(4) into var2. write var2.
Reward Points if this helps,
Satish
OMG, this solution is SO wrong. Date formatting depends on the country, the calendar and the user's preferences! THIS only works for a few countries in the world! I can't believe, that Satish gots reward points for this bad solution.....
CONVERT_DATE_TO_EXTERNAL works better, which you can see after setting your date formatting preferences in your User Settings!
Hi,
Use FM CONVERT_DATE_TO_INTERNAL
Reward if helpful.
Regards,
Harini.S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Just try the following syntax,
write a MMDDYYYY.
where,
a- variable containing the date.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.