cancel
Showing results for 
Search instead for 
Did you mean: 

Function Module to get BEGIN and END date of a month?

Former Member
0 Kudos

Hello everybody,

Is there any function module to get BEGIN and END date of a month

GIVEN EITHER THE CURRENT SYSTEM DATE or MONTH?

Regards,

Sanghamitra.A.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

<b>data date like sy-datum.

data date1 like sy-datum.

select-options: s_date for mkpf-budat.

initialization.

CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'

EXPORTING

iv_date = sy-datum

IMPORTING

EV_MONTH_BEGIN_DATE = date

EV_MONTH_END_DATE = date1

.

s_date-option = 'EQ'.

s_date-sign = 'I'.

s_date-low = date.

s_date-high = date1.

append s_date.</b>

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

Use the FM HR_JP_MONTH_BEGIN_END_DATE.

CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'

EXPORTING

iv_date = sy-datum

IMPORTING

EV_MONTH_BEGIN_DATE = f_date

EV_MONTH_END_DATE = l_date.

Thanks,

Vijay

<b>PLZ reward points if helpful</b>

Former Member
0 Kudos

hi

CALL FUNCTION 'PA03_PERIODDATES_GET'

EXPORTING

f_abkrs = p_abkrs1

IMPORTING

f_permo = wf_permo

f_current_begda = wf_begda

f_current_endda = wf_endda

CHANGING

f_current_period = wf_pabrp

f_current_year = wf_pabrj

EXCEPTIONS

pcr_does_not_exist = 1

abkrs_does_not_exist = 2

period_does_not_exist = 3

OTHERS = 4.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

this is the function module to get the first date and last date of a particular month

if u have any doubts ask

regads

karthik

reward points if useful