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 to calculate the last day of an year

Former Member
0 Kudos
157

HI all,

Is there any FM to calculate the last day of an year. Please help.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
104

Try FM's:

BAPI_CCODE_GET_LASTDAY_FYEAR

FIRST_AND_LAST_DAY_IN_YEAR_GET

4 REPLIES 4

Former Member
0 Kudos
105

Try FM's:

BAPI_CCODE_GET_LASTDAY_FYEAR

FIRST_AND_LAST_DAY_IN_YEAR_GET

former_member585060
Active Contributor
0 Kudos
104

DATA:last_day TYPE sy-datum.

CALL FUNCTION 'FIRST_AND_LAST_DAY_IN_YEAR_GET'

EXPORTING

I_GJAHR = '2008' "the year for which u want the last day

I_PERIV = 'K1' "K1 here indicates the calender year

IMPORTING

  • E_FIRST_DAY =

E_LAST_DAY = last_day

  • EXCEPTIONS

  • INPUT_FALSE = 1

  • T009_NOTFOUND = 2

  • T009B_NOTFOUND = 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.

WRITE:/ last_day.

0 Kudos
104

or

Write a custome code using the FM

HR_JP_MONTH_BEGIN_END_DATE

Former Member
0 Kudos
104

To Get First Date and Last Date of a year Call FM FIRST_AND_LAST_DAY_IN_YEAR_GET

I_PERIV = C1 for Calender Year,

I_PERIV = IN for Indian Fiscal Year