Application Development and Automation 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: 
Read only

Date range using Fiscal Year

Former Member
0 Likes
2,801

Hi,

Please tell me the function module to get this data.

My input is Fiscal Year -2008(for eg).

I need the output with

f_day = 01.04.2008

l_day = 31.03.2009

How to get this?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,859

Hi,

Please tell me the function module to get this data.

My input is Fiscal Year -2008(for eg).

I need the output with

f_day = 01.04.2008

l_day = 31.03.2009

How to get this?

10 REPLIES 10
Read only

andreas_mann3
Active Contributor
0 Likes
1,859

try:

concatenate p_year '0401' into f_day.

l_day = f_day - 1.

add 1 to l_day(4).

A-

Edited by: Andreas Mann on Jan 19, 2009 8:30 AM

Read only

andreas_mann3
Active Contributor
0 Likes
1,859

.

Read only

Former Member
0 Likes
1,860
Read only

0 Likes
1,859

I tried with that function module already.it gives only 1 month.I want all the 12 months to be included.it should give last date as 31.03.2009 not 31.04.2008.

Read only

0 Likes
1,859

try FMs:

FIRST_AND_LAST_DAY_IN_YEAR_GET

or

/IBS/RB_FIRST_LAST_DAY_FYEAR

Read only

arpit_shah
Contributor
0 Likes
1,859

Hi,

Try like this,

DATA : date like sy-datum,date1 like sy-datum,str(8) type c,str1(8) type c.

PARAMETERS YEAR(4) type c.

CONCATENATE YEAR '04' '01' into str.

CONCATENATE YEAR1 '03' '31' into str1.

date = str.

date1 = str1.

and put condition,

select <data> from <table> into <table>

where date(date field) ge date and date(date field) le date1.

Regards,

Arpit

Read only

Former Member
0 Likes
1,859

Hi,

I think SAP considers fiscal year from 01.01.2008 to 31.12.2008

And FM for this is 'HR_E_GET_FISC_YEAR_DATES'

So what u can do this is create an Z-FM and paste code as in Standard FM which is given above

In code the changes will be

FISC_FECINI = FISC_YEAR.

FISC_FECINI+4(4) = '0401'.

FISC_FECFIN = FISC_YEAR.

FISC_FECFIN+4(4) = '0331'.

Let me know further.

Cheers,

Parth Parikh

Read only

Former Member
0 Likes
1,859

Hi,

Try with this FM - FIRST_AND_LAST_DAY_IN_YEAR_GET with Year as 2008 and Fiscal year Variant as 'V3' (or according to your configuration), your desired out put will be diaplyed, please check.

Regards,

CK

Read only

Former Member
0 Likes
1,859

Hi,

You can Try with the function Module :

HRGPBS_CLASS_GET_YEAR_DATES

You have to pass the year for eg : 2009

It would give the output as

date range : 01.04.2008 - 31.03.2009

See if it can help you..

Regards,

Bhavika

Read only

0 Likes
1,858

FM: HRGPBS_CLASS_GET_YEAR_DATES is working fine

If Input is only Fiscal Year like 2011

and Expected Output is like 01.04.2010 - 31.03.2011

then Go for HRGPBS_CLASS_GET_YEAR_DATES function Module.

Regards,

Gaurav