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: 

Function Module for How many Days are there in given month

Former Member
0 Kudos

hi all,

can anyone help me to find how many days are there for given period that I enter

pls help me on this

points will be rewarded

thanxs & Regards

Rajan Mehta

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello,

Check thsi sample:

DATA: G_F_DIFF TYPE I.

CLEAR G_F_DIFF.

CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'

EXPORTING

I_DATUM_BIS = ENDATE

I_DATUM_VON = STARTDATE IMPORTING

E_TAGE = G_F_DIFF

EXCEPTIONS

DAYS_METHOD_NOT_DEFINED = 1

OTHERS = 2.

Cheers,

Vasanth

6 REPLIES 6

Former Member
0 Kudos

HI,

THIS MIGHT HEALP YOU OUT

HR_AUPBS_MONTH_DAY

Calculate the years, months, days & cal days between 2 dates.

Former Member
0 Kudos

Hello Raja,

Use the Function Module

"NUMBER_OF_DAYS_PER_MONTH_GET" for your query.

And you can use "HR_E_NUM_OF_DAYS_OF_MONTH" also

Reward If Helpful.

Regards

--

Sasidhar Reddy Matli.

Edited by: Sasidhar Reddy Matli on Jan 25, 2008 3:48 PM

Former Member
0 Kudos

hi,

SD_DATETIME_DIFFERENCE

Give the difference in Days and Time for 2 dates

Hope this is helpful, Do rewad.

ravishankar_reddy2
Active Participant
0 Kudos

Hi Rajan,

Please look into this, In this FM u can get Days, months and years.

HR_SGPBS_YRS_MTHS_DAYS

regards,

ravi shankar reddy

Edited by: Ravi Shankar Reddy S on Jan 25, 2008 3:56 PM

Former Member
0 Kudos

Hello,

Check thsi sample:

DATA: G_F_DIFF TYPE I.

CLEAR G_F_DIFF.

CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'

EXPORTING

I_DATUM_BIS = ENDATE

I_DATUM_VON = STARTDATE IMPORTING

E_TAGE = G_F_DIFF

EXCEPTIONS

DAYS_METHOD_NOT_DEFINED = 1

OTHERS = 2.

Cheers,

Vasanth

Former Member
0 Kudos

Hi Rajan

this function module tells yoy the last day of month

means automatically you get how many days in month

RP_LAST_DAY_OF_MONTHS

code:

data: date like sy-datum,

date1 like sy-datum.

date = sy-datum.

CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'

EXPORTING

day_in = date

IMPORTING

LAST_DAY_OF_MONTH = date1

EXCEPTIONS

DAY_IN_NO_DATE = 1

OTHERS = 2

.

write: date1.