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 function

Former Member
0 Likes
3,270

Dear All

Please let me the function modules for the following

1. calculate the no. of day between two dates.

2. derive the last day of a month.

3. geting a new date by adding or substracting no of days to a date.

4. extract day, month, year from the date field.

thanks

ravi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,141

Hi,

Please find those below

1. calculate the no. of day between two dates.

<b>DAYS_BETWEEN_TWO_DATES</b>

2. derive the last day of a month.

<b>RP_LAST_DAY_OF_MONTHS</b>

3. geting a new date by adding or substracting no of

days to a date.

<b>MONTH_PLUS_DETERMINE</b>

Note: For subtracting give <b>-ve</b> value for

MONTHS parameter .

4. extract day, month, year from the date field.

Data :w_date like sy-datum,

w_year(4) type c,

w_day(2) type c,

w_mon(2) type c.

w_date = sy-datum.

w_year = w_date+0(4).

w_mon = w_date+4(2).

w_day = w_date+6(2).

The above holds respective values.

Please reward points if this explanation useful.

Regards,

Siva

5 REPLIES 5
Read only

Former Member
0 Likes
3,141

hi,

try with this FMs

HR_SEN_CALE_DAYS_DATE ( for 1 & 3)

LAST_DAY_OF_MONTHS (2)

Read only

Former Member
0 Likes
3,142

Hi,

Please find those below

1. calculate the no. of day between two dates.

<b>DAYS_BETWEEN_TWO_DATES</b>

2. derive the last day of a month.

<b>RP_LAST_DAY_OF_MONTHS</b>

3. geting a new date by adding or substracting no of

days to a date.

<b>MONTH_PLUS_DETERMINE</b>

Note: For subtracting give <b>-ve</b> value for

MONTHS parameter .

4. extract day, month, year from the date field.

Data :w_date like sy-datum,

w_year(4) type c,

w_day(2) type c,

w_mon(2) type c.

w_date = sy-datum.

w_year = w_date+0(4).

w_mon = w_date+4(2).

w_day = w_date+6(2).

The above holds respective values.

Please reward points if this explanation useful.

Regards,

Siva

Read only

0 Likes
3,141

thanks all of you for quick anwser.

Read only

0 Likes
3,141

Dear Siva

What all parameters to be passed to DAYS_BETWEEN_TWO_DAYS function module to get the no. of days between the two days.

Please advice

ravi

Read only

Former Member
0 Likes
3,141

Hi Ravi,

Here are some FMs:

> 2. derive the last day of a month. NUMBER_OF_DAYS_PER_MONTH_GET

> 4. extract day, month, year from the date field.

You can do this as follows:

If the date (p_date) is 20050905,

p_year = p_date+0(4).

p_month = p_date+4(2).

p_day = p_date+6(2).

Sudha