2005 May 12 3:55 PM
I have the date in 'yyyy/mm/dd' format but I want the date in 'mm/dd/yy' format and to be stored in the variable in this format. Is there is any function module or code that enable me to do it.
2005 May 12 3:58 PM
Hi Santhosh,
Try the write statement:
WRITE: f to g DD/MM/YY.
This should work fine.
Brad
2005 May 12 3:58 PM
Hi Santhosh,
Try the write statement:
WRITE: f to g DD/MM/YY.
This should work fine.
Brad
2005 May 12 4:09 PM
Thanks. I think you can help me out here.I know that it works with the write statement but I need to store the date in this form in a variable and concatenate it with other variables and then use the write statement.
2005 May 12 4:25 PM
Hi Santhosh,
You can do something like:
DATA: w_date type d value '20050512',
w_char_date(8) type c,
w_other_string(100) type c,
WRITE: w_date to w_char_date DD/MM/YY.
CONCATENATE 'Other text' w_char_date into w_other_string.
WRITE: w_other_string.
That should do it.
Brad
Message was edited by: Brad Williams
2005 May 12 4:30 PM
Thank you Brad!!! I got it.It really helped.Just alittle more help would be just great. Now I have got 'Todate'by using sy-datum in the format 'mm/dd/yy' and I have to set the 'fromdate' i.e to the firstday of the month(just need to change the date part. i tried the OFFSET command and set it to '01' I am not getting it. if you could help me that would just great.
Thanks
Santhosh
2005 May 12 4:36 PM
So,
Try manipulating the string:
DATA: w_date type d value sy-datum,
w_from_date(8) type c,
w_to_date(8) type c,
w_other_string(100) type c,
WRITE: w_date to w_to_date DD/MM/YY.
w_from_date = w_to_date.
w_from_date+0(2) = '01'.
CONCATENATE w_from_date ' to ' w_to_date into w_other_string.
WRITE: w_other_string.
That should be fine.
Please remember to award points to posts that have been useful to you.
Brad
2005 May 12 5:03 PM
Thanks a lot Brad,It really solved my problem. I have awarded points for your help. Have a great week end.
Santhosh
2005 May 12 4:24 PM
How about using at first write and at second step concatenate?