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: 

converting date in finantial year format

Former Member
0 Kudos

hi,

I have to convert date in finantial year format

e.g if the date range is 01.01.2007 to 31.03.2008 then o/p -


> 2007-2008

if the date range is 01.04.2006 to 31.03.2007 then o/p----


>2006-2007

is there any FM to convert this.......

1 ACCEPTED SOLUTION

former_member387317
Active Contributor
0 Kudos

GET_CURRENT_YEAR Get the current fiscal year.

Example:

CALL FUNCTION 'GET_CURRENT_YEAR'

EXPORTING

BUKRS = '1000' " Company Code

DATE = SY-DATUM " Date to find fiscal year for

IMPORTING

CURRM = w_currm " Current Fiscal Month

CURRY = w_curry " Current Fiscal Year

PREVM = w_prevm " Previous Fiscal Month

PREVY = w_prevy. " Previous Fiscal Year

===================================

Try out below as well

GM_GET_FISCAL_YEAR

ME_DETERMINE_GJAHR

Thanks & Regards

ilesh 24x7

3 REPLIES 3

naimesh_patel
Active Contributor
0 Kudos

Hello Sagar,

Use FM GM_GET_FISCAL_YEAR

You need to give:

I_DATE = your date

I_FYV = 'V3' .......... this is the fiscal year variant for April to March months.

FM will return fiscal year in E_FY

You need to use the FM 2 times to get both years.

Regards,

Naimesh.

Former Member
0 Kudos

Hi,

Try like this:

select-options: v_date for sy-datum.

data: d1yy(4) type N,

d2yy(4) type N,

fyy(10) type C.

d1yy = v_date-low+0(4).

d2yy = v_date-high+0(4).

concatenate d1yy '-' d2yy into fyy.

write: d1yy,

d2yy,

fyy.

Regards,

Bhaskar

former_member387317
Active Contributor
0 Kudos

GET_CURRENT_YEAR Get the current fiscal year.

Example:

CALL FUNCTION 'GET_CURRENT_YEAR'

EXPORTING

BUKRS = '1000' " Company Code

DATE = SY-DATUM " Date to find fiscal year for

IMPORTING

CURRM = w_currm " Current Fiscal Month

CURRY = w_curry " Current Fiscal Year

PREVM = w_prevm " Previous Fiscal Month

PREVY = w_prevy. " Previous Fiscal Year

===================================

Try out below as well

GM_GET_FISCAL_YEAR

ME_DETERMINE_GJAHR

Thanks & Regards

ilesh 24x7