10-14-2008 1:13 PM
I have extracted date in format MMYYYY.Now I want to display it in reverse.
ex. 112004. I want to display it in format 200411.
the variable which I m using is of type character.
How should I do it?
10-14-2008 1:15 PM
10-14-2008 1:58 PM
112008 = x.
200811 = y.
u have to use the offset concept.
y = x2(4) + x0(2).
10-14-2008 2:05 PM
hi Reshma,
THe simplest way would be to use Offsets and Concatenate statement
For eg.
v_date = '20081014'.
something like:
CONCATENATE v_date6(2) '.' v_date4(2) '.' v_date+0(4) INTO v_new_date
hope it may help u.
thanks
Sachin
10-14-2008 3:02 PM
10-14-2008 3:08 PM
Data i_date TYPE sy-datum.
Data e_date(10).
i_date = '23082009'.
CONCATENATE i_date+0(2) '.'
i_date+2(2) '.'
i_date+4(4) INTO e_date.
There is no other way to do this otherwise use FM module CONVERT_DATE_TO_EXTERNAL.
there might be some setting issue some times for that
Go to System==> User Profile ==>Own data==>Defaults==>Date Format.
10-14-2008 3:28 PM
Do like......
DATA:
VAR(6) TYPE C VALUE '112008'.
SHIFT var CIRCULAR by 2 places.
It will give u 200811 as a result.