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: 

Need FM to find starting n ending dates from a Posting period and Fiscal yr

Former Member
0 Kudos

Hi Friends,

I need a function Module wherein

The available Inputs are

Fiscal Year :eg 2007

Period :eg 04

Fiscal Year Variant :eg 'ZB' ie from December to November of a year

For the set of inputs (2007, 04, ZB) I need the <b>Starting and Ending dates of the period</b> ie 01.03.2007 and 31.03.2007.

Points would be rewarded for helpful answers.

Thanks and Regards,

Atin

2 REPLIES 2

aaron_morden2
Contributor
0 Kudos

The starting date of the period will always be the 1st.

To get the end date, call FM <b>LAST_DAY_OF_MONTHS</b>

Example Code:


DATA: start_date TYPE sy-datum,
      end_date   TYPE sy-datum.

DATA: input_fiscal_year(4) TYPE c VALUE '2007',
      input_period(2)      TYPE c VALUE '08'.

start_date+0(4) = input_fiscal_year.
start_date+4(2) = input_period.
start_date+6(2) = '01'.

CALL FUNCTION 'LAST_DAY_OF_MONTHS'
  EXPORTING
    day_in            = start_date
  IMPORTING
    last_day_of_month = end_date.

WRITE: / start_date.
WRITE: / end_date.

Former Member
0 Kudos

You can use these 2 FMs to get the start and end date

FIRST_DAY_IN_PERIOD_GET

LAST_DAY_IN_PERIOD_GET

For Fisrt and last day of the fiscal year use

FIRST_AND_LAST_DAY_IN_YEAR_GET

Reward Points if helpful