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: 

FM takes year and month as input and give firstdate and lastdate as output

Former Member
0 Kudos

Hi,

Can any one tell me any <b>function modules which takes year and month as inputs and gives first date and last date of that month as outp</b>uts.

Regards,

Gurprit Bhatia

Message was edited by:

GURPRIT BHATIA

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

use the function module 'RP_LAST_DAY_OF_MONTHS' to get the last day..and first day is always 01.

OR

use the function module 'HR_JP_MONTH_BEGIN_END_DATE'

Thanks

Naren

4 REPLIES 4

Former Member
0 Kudos

Hi,

use the function module 'RP_LAST_DAY_OF_MONTHS' to get the last day..and first day is always 01.

OR

use the function module 'HR_JP_MONTH_BEGIN_END_DATE'

Thanks

Naren

Former Member
0 Kudos

Hi Gurprit,

Please try the FMs 'MC_PERIO_GET_FIRST_AND_LASTDAY' and 'MC_PERIO_GET_FIRST_AND_LASTDAY'.

Although there is no documentation available for this FM but the import and export parameters suggest that this could fit it wth you requirements.

In case you have any further clarifications,do let me know.

Regards,

Puneet Jhari.

Former Member
0 Kudos

Hello ,

check this ......

RS_VARI_V_L_LAST_MONTH

RS_VARI_V_1_ACTUAL_MONTH

With Regards,

Sagar

Former Member
0 Kudos

Hi Gurprit,

You can use this.

data : ws_date type sy-datum.,

ws_edtae type sy-datum.

constants : c_01 value '01'.

CONCATENATE ws_date c_01 INTO ws_stdate.

CALL FUNCTION 'HR_JP_ADD_MONTH_TO_DATE'

EXPORTING

iv_monthcount = ws_01 (1)

iv_date = ws_stdate ( eg :01.01.2007)

IMPORTING

ev_date = ws_edate. (eg : 31.01.2007)

Reward if useful.

Regards,

Chitra