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: 

Conversion of date of 8 (dd/mm/yyyy) to type 6 (yyyy/mm)

Former Member
0 Kudos

how to convert date in select-options field which is of 8 (dd/mm/yyyy) to type 6 (yyyy/mm).

2 REPLIES 2

Former Member
0 Kudos

Rocky,

This what you need?


DATA: datein(10)   TYPE c.
DATA: dateout(7)   TYPE c.

WRITE sy-datum TO datein MM/DD/YYYY.

CONCATENATE datein+6(4) '/' datein+0(2) INTO dateout.

WRITE:/ datein, dateout.

Output


05/01/2008 2008/05         

Former Member
0 Kudos

select-options: s_date for .. " type date.

data: begin of it_date,

date type dats,

end of it_date.

data: wa_date like line of it_date.

loop into s_date.

CONCATENATE s_date-low6(4) '/' s_date-low0(2) INTO wa_date.

append wa_date to it_date.

endloop.

the table it_date will have the date of all selected date in the select options field in the required format.

Hope it helps.

Thanks,

Imran.