‎2007 Mar 21 3:53 PM
I have a date dd.mm.yyyy
I need to convert it to 6 digits and display it
should i use format_date(6) type i ?
how do i do the conversion
‎2007 Mar 21 4:39 PM
Hi,
You need to use offset and store the final result to your variable.
data: v_date(6) type c.
v_date+0(2) = sy-datum+4(2).
v_date+2(2) = sy-datum+6(2).
v_date+4(2) = sy-datum+2(2).
write: / v_date.
move v_date to ...
or
write: / sy-datum MMDDYY to v_date.
Any update on this issue?
Regards,
Ferry Lianto
‎2007 Mar 21 3:55 PM
hi,
Use offset for that
data : v_date type sy-datum value '20070101'.
v_date = v_date+0(6).
write v_date.
Regards,
Santosh
‎2007 Mar 21 3:57 PM
‎2007 Mar 21 3:58 PM
data : v_date(10) value '21.03.2007',
v_date1(6),
v_int type i.
concatenate v_date+3(2) v_date+0(2) v_date+8(2) into v_date1.
v_int = v_date1.
write : v_int.Message was edited by:
Chandrasekhar Jagarlamudi
‎2007 Mar 21 4:01 PM
isnt there some built in function that i can use
so regardless of the format of the input date, my output is mmddyy
‎2007 Mar 21 4:02 PM
Hi,
Please try this.
data: v_date(6) type c.
v_date+0(2) = sy-datum+4(2).
v_date+2(2) = sy-datum+6(2).
v_date+4(2) = sy-datum+2(2).
write: / v_date.
or
write: / sy-datum MMDDYY.
‎2007 Mar 21 4:02 PM
then do this way ..
data : v_date(10) type c value '10.10.2007 '.
concatenate v_date+0(2) v_date+3(2) v_date+8(2) into v_date
write v_date.
‎2007 Mar 21 4:30 PM
data: v_date(6) type c.
v_date+0(2) = sy-datum+4(2).
v_date+2(2) = sy-datum+6(2).
v_date+4(2) = sy-datum+2(2).
write: / v_date.
or
write: / sy-datum MMDDYY.I am looking for something like the last write statement
But I need to be able to save it in a variable
‎2007 Mar 21 8:59 PM
Hi ,
you can use get it into a variable with the following statement
write sy-datum MMDDYY to v_date.
if current date is 03/21/2007
the value in v_date will be 030207.
-Kalyan
‎2007 Mar 21 9:07 PM
This is all you need to do.
DATA: v_date(6).
WRITE sy-datum TO v_date.
WRITE: v_date.
This will write the date into v_date based on the user profile.
‎2007 Mar 21 4:39 PM
Hi,
You need to use offset and store the final result to your variable.
data: v_date(6) type c.
v_date+0(2) = sy-datum+4(2).
v_date+2(2) = sy-datum+6(2).
v_date+4(2) = sy-datum+2(2).
write: / v_date.
move v_date to ...
or
write: / sy-datum MMDDYY to v_date.
Any update on this issue?
Regards,
Ferry Lianto