Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Edit Mask command

Former Member
0 Likes
12,429

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.

1 ACCEPTED SOLUTION
Read only

Former Member
3,555

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

3 REPLIES 3
Read only

pole_li
Active Participant
0 Likes
3,555

Hi,

The date format depends on your user master setting.

Regards

Pole

Read only

Former Member
3,556

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

Read only

Former Member
0 Likes
3,555

hi,

data date type d.

date = sy-datum.

write: date,

/(8) date using EDIT MASK '__/__/__'.