Former Member

# Date function

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

10|10000 characters needed characters exceeded

### Related questions

Former Member
Posted on Sep 30, 2005 at 05:57 AM

Hi,

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

10|10000 characters needed characters exceeded
• Former Member

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.

ravi

• Former Member
Posted on Sep 30, 2005 at 05:49 AM

hi,

try with this FMs

HR_SEN_CALE_DAYS_DATE ( for 1 & 3)

LAST_DAY_OF_MONTHS (2)

10|10000 characters needed characters exceeded
• Former Member
Posted on Sep 30, 2005 at 05:58 AM

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