‎2007 Feb 19 7:58 AM
Hi Everybody,
I want to change the Date format like MM-DD-YYYY to YYYY-MM-DD using the Function Module "CONVERT_DATE_TO_INTERN_FORMAT ". I tried using this function module. But It doesn't work. Anubody help me.
Thanks in advance.
‎2007 Feb 19 8:00 AM
use Fm
CONVERT_DATE_TO_INTERNAL
YYYYMMDD "system internal format
it will not be
YYYY-MM-DD .
regards,
vijay
‎2007 Feb 19 8:01 AM
Hi,
check this,
data: yymmdd(6) type c value '070109'.
data: yyyymmdd type sy-datum.
data: mmddyy(6) type c.
mmddyy0(2) = yymmdd2(2).
mmddyy2(2) = yymmdd4(2).
mmddyy4(2) = yymmdd0(2).
call function 'CONVERT_DATE_TO_INTERN_FORMAT'
exporting
datum = mmddyy
dtype = 'DATS'
importing
ERROR =
idate = yyyymmdd
MESSG =
MSGLN =
.
write:/ yyyymmdd.
Cheers,
SImha.
‎2007 Feb 19 8:02 AM
Hi Vijay,
Try this FM <b>CONVERT_DATE_TO_INTERNAL</b>
reward if useful.
‎2007 Feb 19 8:11 AM
Hi,
U can convert
DATA: v_year(4) type c,
v_month(2) type c,
v_days(2) type c.
*
SELECT-options: FROMDATE FOR SY-DATUM
DEFAULT SY-DATUM.
v_month = fromdate-low+4(2).
v_year = fromdate-low+0(4).
v_days = fromdate-low+6(2).
CONCATENATE v_year '-' v_month '-' v_days INTO fromdate-low.Hope u can try this way.
‎2007 Feb 19 8:32 AM
Hi,
Use the following FM:
DATE_CONV_EXT_TO_INT - user formatted date is converted to system date
Hope this helps.
Reward if helpful.
Regards,
Sipra
‎2007 Feb 19 8:38 AM
What do you want to do with this YYYY-MM-DD date? What data type has the MM-DD-YYYY date?
‎2007 Feb 19 8:51 AM
vijay,
one way is
1.ws_year = sy-datum+0(4).
ws_mon = sy-datum+4(2).
ws_day = sy-datum+6(2).
concatenate ws_year ws_mon ws_day into ws_date separated by '.' .
pls. mark if useful
‎2007 Feb 19 8:54 AM
Hi
Use FM:
CONVERT_DATE_TO_INTERNAL
which can convert the date of sap formatt to user defined formatt.
Regards,
kumar