‎2007 Apr 13 4:58 PM
I am gathering date as yymmdd
How do I format this date to sy-datum format yyyymmdd and the store it into a variable.
‎2007 Apr 13 5:09 PM
v_dat(6) type c
v_datum like sy-datum
v_datum = yyyymmdd of v_dat
thats what i need to do
‎2007 Apr 13 5:02 PM
hi,
do this way ..
data : v_datum like sy-datum value sy-datum.
concatenate v_datum+0(4) v_datum+4(2) v_datum+6(2) into v_date.
write : v_date.Regards,
Santosh
‎2007 Apr 13 5:09 PM
v_dat(6) type c
v_datum like sy-datum
v_datum = yyyymmdd of v_dat
thats what i need to do
‎2007 Apr 13 5:22 PM
If I understood ur requirement correctly, the code below should work
data:
v_dat(6),
v_date(10).
v_dat = '070413'.
concatenate '20' v_dat(2) v_dat2(2) v_dat+4(2) into v_date.
write:v_date.
<b>Note</b>:i've <b>hard coded</b> the value '20', change that according to ur requirement
‎2007 Apr 13 5:25 PM
Hi Megan,
Simple code:
data : v_dat(6) type c value '070413',
v_datum like sy-datum.
concatenate '20' v_dat0(2) v_dat2(2) v_dat+4(2) into v_datum.
write v_datum.
Hope this helps.
Thanks,
Srinivasa
‎2007 Apr 13 5:50 PM
concatenate '20' v_dat+(2) v_dat+2(2) v_dat+4(2) into v_date.What does 20 stand for here ?
‎2007 Apr 13 5:51 PM
Hi Megan,
20 stands for the first characters of the year.
This year is 2007 know, so 20 is the first two characters in the year.
So, when 20 is concatenating with 07, it becomes 2007 which is the current year.
Thanks,
Srinivasa
‎2007 Apr 13 5:52 PM
'20' stands for the first 2 characters of the century, i.e., '20'07, if the date is in 20th century then u've to use '19'...