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

date field conversion

Former Member
0 Likes
679

hi gurus! can someone give me a tip on a date field conversion.

I have a field that comes YYYYMMDD but i want to convert to DD.MM.YYYY

Can someone help me on this

Thk, Regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
654

u can use the below statemnet

data: l_date(10).
data  = sy-datum.
write date to l_date using edit mask '__.__.____'.

5 REPLIES 5
Read only

Former Member
0 Likes
655

u can use the below statemnet

data: l_date(10).
data  = sy-datum.
write date to l_date using edit mask '__.__.____'.

Read only

Former Member
0 Likes
654

make use of keyword

<b>write to</b>

Regards

Prabhu

Read only

Former Member
0 Likes
654
data : v_date1 like sy-datum,
         v_date2(10).

v_date1 = sy-datum.

concatenate v_date1+6(2) v_date1+4(2) v_date1+0(4) into v_date2 separated by '.'.

write : v_date2.
Read only

Former Member
0 Likes
654

Hi Joao,

Try this function Module, ' CONVERT_DATE_TO_INTERN_FORMAT '.

This will helps to change the format of the date as you wish.

Thanks.

reward If Helpful.

Read only

Former Member
0 Likes
654
REPORT  Z_82235_TEST4                           .

data:  date1(8) type c,
       date2(10) type c.

       date1 = 'YYYYMMDD'.

CONCATENATE date1+6(2) date1+4(2) date1(4) INTO date2 separated by '.'.

.....................

you pass your date to date1 in place of 'yyyymmdd' and you will gate ur desired output on date2.