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

split month, date and year

Former Member
0 Likes
2,599

How to split month,date and year from date field ? is there any standard function module.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,316

You can do this.




data: year(4) type c,
      month(2) type c,
      day(2) type c.

year = sy-datum(4).
month = sy-datum+4(2).
day = sy-datum+6(2).

write:/ year.
write:/ month.
write:/ day.


Regards,

Rich Heilman

How to split month,date and year from date field ? is there any standard function module.

3 REPLIES 3
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,317

You can do this.




data: year(4) type c,
      month(2) type c,
      day(2) type c.

year = sy-datum(4).
month = sy-datum+4(2).
day = sy-datum+6(2).

write:/ year.
write:/ month.
write:/ day.


Regards,

Rich Heilman

Read only

suresh_datti
Active Contributor
0 Likes
1,316

CACS_DATE_GET_YEAR_MONTH

~Suresh

Read only

Former Member
0 Likes
1,316

Try this FM:

HR_IN_GET_DATE_COMPONENTS

<i><b>

Points are always welcome!!</b></i>