Application Development 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: 

Dateformat

Former Member
0 Kudos
182

I have the current date (sy-datum)that needs to be stored in 'mmddyy'not in anyother format in the variable. I do not want to output the date directly(because I know 'mmddyy' format option is available for WRITE statement.

Therefore i want the date stored in this format because I need to concatenate this with other data and then output it. Can anyone help me in this regard.

Thanks

Moved to the right forum.

Message was edited by: Mark Finnern

1 ACCEPTED SOLUTION

Former Member
0 Kudos
59

You should post your question in the ABAP forum you'll get a very quick response there.

3 REPLIES 3

Former Member
0 Kudos
60

You should post your question in the ABAP forum you'll get a very quick response there.

Former Member
0 Kudos
59

Hi Santhosh,

You can actually use the WRITE statement to copy one variable to another whilst applying formatting.

Check out the following code snippet:


DATA: w_char_date(6)   type c,
      w_other_char(40) type c.

WRITE: sy-datum to w_char_date mmddyy.

CONCATENATE 'This is the date: ' w_char_date into w_other_car.

I have given a similiar answer in another thread, check out:

Cheers,

Brad

Former Member
0 Kudos
59

or you can simply do this

data: v_char_date(6).

concatenate sy-datum+4(2)

sy-datum+6(2)

sy-datum+2(2)

into v_char_date.

Srinivas