‎2008 Apr 25 2:42 AM
Hi All,
I got a problem using edit mask.
My code is as below:
data: lv_temp(50) type c.
write sy-datum to lv_temp using edit mask 'DD/MM/YYYY'.
My result when I run the program is DD/MM/YYYY instead of coming out the value of '24/04/2008'.
If I dont use the edit mask, my result is '24.01.2008'.
May I know why the edit mask function is not working overhere?
Thanks.
‎2008 Apr 25 4:52 AM
Hi Justin,
See the below code ...
Modify it as per ur requirement...
use underscor instead of DD MM YYYY
DATA : date1 TYPE char8,
time TYPE char6,
var10 TYPE char10,
var8 TYPE char8.
date1 = sy-datum.
time = sy-timlo.
WRITE date1 USING EDIT MASK '____/__/__' TO var10.
WRITE time USING EDIT MASK '__:__:__' TO var8.
write :/ var10 DD/MM/YYYY.
write :/ var10 , ' ' , var8.
Better use offset and get the individual DD MM and YYYY using offset...
and then use concatenate to get ur desired value...
Set user date setting from SU01...
Hope it will solve ur problem..
Reward points if useful...
Thanks & Regards
ilesh 24x7
‎2008 Apr 25 4:27 AM
Hi,
The date format depends on your user master setting.
Regards
Pole
‎2008 Apr 25 4:52 AM
Hi Justin,
See the below code ...
Modify it as per ur requirement...
use underscor instead of DD MM YYYY
DATA : date1 TYPE char8,
time TYPE char6,
var10 TYPE char10,
var8 TYPE char8.
date1 = sy-datum.
time = sy-timlo.
WRITE date1 USING EDIT MASK '____/__/__' TO var10.
WRITE time USING EDIT MASK '__:__:__' TO var8.
write :/ var10 DD/MM/YYYY.
write :/ var10 , ' ' , var8.
Better use offset and get the individual DD MM and YYYY using offset...
and then use concatenate to get ur desired value...
Set user date setting from SU01...
Hope it will solve ur problem..
Reward points if useful...
Thanks & Regards
ilesh 24x7
‎2008 Apr 25 6:06 AM
hi,
data date type d.
date = sy-datum.
write: date,
/(8) date using EDIT MASK '__/__/__'.