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

Former Member
0 Likes
564

Hi expert,

How can i pick up Month value from the given date ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
544

hi Murugan

You can do this way,

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.

Thru function module...

HR_IN_GET_DATE_COMPONENTS

Regards,

Jayant..

4 REPLIES 4
Read only

rahulkavuri
Active Contributor
0 Likes
544

u need to have a variable

var = sy-datum+4(2).

Read only

Former Member
0 Likes
544

hii,

you can pic up every single value like if

date = 12062007 and 06 is month then write

month = date+2(2)

you will get the month

reward if helpful

thanks

vikaas

Read only

Former Member
0 Likes
544

What is the date format that u r getting??

data : v_date like sy-datum,
         v_mon(2).

v_date = sy-datum.

v_mon = v_date+4(2).

write : v_mon.

Read only

Former Member
0 Likes
545

hi Murugan

You can do this way,

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.

Thru function module...

HR_IN_GET_DATE_COMPONENTS

Regards,

Jayant..