02-12-2008 5:34 AM
if the given date format is mmddyy.if the required date format is 20yymmdd then what is the code.
ex:----
given date 021208
req date 20080212
what is the code?
02-12-2008 5:37 AM
Hi,
The format u require is of the sy-datum format.
USe concatenate statemnt to get the required one.
Reward if useful.
Regards,
Mansi.
02-12-2008 5:45 AM
TABLES: T247.
DATA: V_DATE TYPE SYDATUM.
DATA: V_STRING(20).
V_DATE = SY-DATUM.
SELECT SINGLE * FROM T247
WHERE SPRAS = SY-LANGU
AND MNR = V_DATE+4(2).
IF SY-SUBRC = 0.
CONCATENATE V_DATE+6(2) '-' T247-KTX '-' V_DATE(4)
INTO V_STRING.
WRITE: / V_STRING.
ENDIF.
or
make use of this FM
CONVERSION_EXIT_IDATE_OUTPUT
and see its documentation.
or
/: SET DATE MASK = 'DD-MMM-YYYY'
&DATE&
check with this.
if it is not working try to give space between DD and MMM and YYYY
all of the three work...choose whichever suits u
or----
FMs
'CONVERSION_EXIT_LDATE_OUTPUT'
CONVERSION_EXIT_SDATE_OUTPUT
Reward if useful
Narendra
02-12-2008 5:57 AM
Dear Bharath,
Try out with this.
data: d(6) type n value '120208'.
data: i1 type i,
i2 type i,
i3 type i,
i4(8) type n.
write:/ 'date:', d.
i1 = d+0(2).
i2 = d+2(2).
i3 = d+4(2).
concatenate '20' d4(2) d2(2) d+0(2) into i4.
write:/ 'date after formatting', i4.
reward points if u success with this.
02-12-2008 6:05 AM
Hi,
try this code,
Sy-datum contains 021208. Then use this statement
Concatenate 20 sy-datum4(2) sy-datum0(2) sy-datum+2(2).
Reward points,if it is useful.
Thanks,
chandu.
02-12-2008 6:16 AM
Hi Bharath
check out this function module ...
it wil be useful for u...
CONVERT_DATE_TO_INTERNAL
this function module will convert the format ddmmyy into yyyymmdd.
Regards,
Sivappriya.
02-12-2008 7:16 AM
use the function module
CONVERT_DATE_TO_INTERNAL
pass date as 021208
you will get out put as 20080228
check for the system internal date format.