‎2007 Nov 16 11:17 PM
Hi guys,
i am working on one report in which i am getting date from the selection screen.
i defined
parameters: p_datum like sy-datum.
i am getting it in the format YYYYMMDD.
now i want to convert it to MMDDYYYY.
the problem is i am looking for any function module which will convert date from YYYYMMDD to MMDDYYYY.
i tried CONVERT_DATE_TO_INTERNAL and CONVERT_DATE_TO_external .
but nothing is working for MMDDYYYY formt .
the second problem is i am using this program for different country and all have different format of date so i want one way which will convert date for any country.
Thanks,
Jack
‎2007 Nov 16 11:22 PM
Hi Jack,
do like this
date = sy-datum.
Concatenate date4(2) date6(2) date+0(4) into new_date.
Reward if this helps,
Satish
‎2007 Nov 16 11:53 PM
You can do it also..
data: l_char(8) type c.
write: l_date to l_char MMDDYYYY.Regards,
Naimesh Patel
‎2007 Nov 17 3:10 AM
Hi,
try this,
parameters: p_datum like sy-datum.
write : p_datum MMDDYYYY.
For more date formats look at this link,
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/write_op.htm
‎2007 Nov 17 3:57 AM
Hi JACK,
Why it is not working <b>?</b>... it should work ...
try to pass accurate parameters in FMs...
use below Function modules to solve ur problem...
<b>CONVERT_DATE_TO_EXTERNAL</b>
<b>CONVERSION_EXIT_PDATE_OUTPUT</b>
data: lv_date type sydatum,
e_calc_date type sydatum.
lv_date = sy-datum.
lv_year = lv_date(4).
lv_month = lv_date+4(2).
lv_day = lv_date+6(2).
concatenate lv_month lv_day lv_year into E_CALC_DATE.
Hope it will solve ur problem..
<b>Reward points if useful</b>
Thanks & Regards
ilesh 24x7
‎2007 Nov 17 4:42 AM