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

Function Module For Fiscal Year

Former Member
0 Likes
3,265

Hi All,

I've three parameters

COMPANY CODE =1000

PERIOD = 05

YEAR = 1997

So please let me know function module for to get FISCAL YEAR in start date & end date.

With Regards

Navin K.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,974

Hi navin

Use this FM.

CALL FUNCTION 'GET_CURRENT_YEAR'

EXPORTING

bukrs = p_bukrs

date = sy-datum

IMPORTING

currm = v_currm

curry = v_curry

prevm = v_prevm

prevy = v_prevy.

Regards

Azad.

Reward if helpful.

8 REPLIES 8
Read only

Former Member
0 Likes
1,975

Hi navin

Use this FM.

CALL FUNCTION 'GET_CURRENT_YEAR'

EXPORTING

bukrs = p_bukrs

date = sy-datum

IMPORTING

currm = v_currm

curry = v_curry

prevm = v_prevm

prevy = v_prevy.

Regards

Azad.

Reward if helpful.

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
1,974

Hi,

Try FM's

CCODE_GET_FISCAL_YEAR_VARIANT

FKK_FM_GET_FISCAL_YEAR

Regards,

Sesh

Read only

Former Member
0 Likes
1,974

hi

<b>FM_FISCAL_YEAR_GET</b>

regards

ravish

<b>plz reward if useful</b>

Read only

Former Member
0 Likes
1,974

Hi,

Use GET_CURRENT_YEAR

Reward points if helpful.

Regards.

Srikanta Gope

Read only

Former Member
0 Likes
1,974

HI Navin,

check out the FM,

FKK_FM_GET_FISCAL_YEAR

Reward points if this helps,

Kiran

Read only

Former Member
0 Likes
1,974

Hi,

Check with this FM 'FI_PERIOD_DERTEMINE'.

GET_CURRENT_YEAR will give u the fiscal year

.use "GET_DATES_FROM_GJAHR" ,

<b>Reward points</b>

Regards

Read only

Former Member
0 Likes
1,974

Hi Navin,

To get a date from a given date +/- period. Input : Date & Period (No. of Days) Output : Calculated Date

Please go through the Function Module "RELATIVE_DATE_CALCULATE". Remember to enter the date in 'yyyymmdd' format in the start date field.

2.if the days variable is integer and other 2 like sy-datum, the math below yields the number of days to yo..

start date = '23.07.2003'

End date = '23.09.2003'

Days = enddate - Start date.

3. Please go through the Functions Module , it gives date as well as time difference, though U may have to enter time as well.

SD_DATETIME_DIFFERENCE

4. with this FM you can get dates between two dates : Function Module

RP_CALC_DATE_IN_INTERVAL

5. go into SE37 and search on 'difference between dates', one of these 3 keywords or a combination between the 3 will give you a function module.

6. Date Upper & Lower limit: the lower is obviously the 1st of the month. To get the upper use function module END_OF_MONTH_DETERMINE.

7. to get the logon user setting date dynamically : Using offsets move it into a date field,obviously in the format yyyymmdd. then move it into a char(10) field. U get the data in char(10) using the current user's setting.

ex:: w_date type d value '20030822',

w_char(10).

say logon user setting is mm/dd/yyyy.

write w_date to w_char. w_char will have the value 08/22/2003.

You can use the result of the move stmt in bdc table.

8. Check this FM

"/SAPDMC/LSM_DATE_CONVERT "

9.statements:

1. CONVERT DATE f1 INTO INVERTED-DATE f2.

2. CONVERT INVERTED-DATE f1 INTO DATE f2.

Calculates the nine's complement of the internal date format (YYYYMMDD - for more information about internal display, meaning and initial values of types and places it in the field f2.

For example, 19950511 ==> 80049488 or 80049488 ==> 19950511.

In the inverse date format, the most recent date has the numerically smallest value. You can make use of this effect when sorting dates.

10. GET TIME STAMP : returns the timestamp in short or long form. The short form contains the current date and time :

DATA:

s_tst TYPE timestamp,

l_tst TYPE timstampl,

tzone TYPE timezone.

GET TIME STAMP FIELD s_tst. "Short form

GET TIME STAMP FIELD l_tst. "Long form

tzone = 'UTC '. "Time zone

WRITE: / s_tst TIME ZONE tzone,

/ l_tst TIME ZONE tzone.

Then, The short form might then contain the value 19980204163520, while the long form has the value 19980204163520,1234560.

The time stamp can be converted by using CONVERT TIME STAMP and CONVERT DATE

<b>Reward pts if found usefull :)</b>

Regards

Sathish

Read only

Former Member
0 Likes
1,974

Hi,

Check the code as below :

data : a(20).

CALL FUNCTION 'GM_GET_FISCAL_YEAR'

EXPORTING

I_DATE = SY-DATUM

i_fyv = 'V3'

IMPORTING

E_FY = a.

  • EXCEPTIONS

  • FISCAL_YEAR_DOES_NOT_EXIST = 1

  • NOT_DEFINED_FOR_DATE = 2

  • OTHERS = 3

.

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 : a.

Reward points, if helpful,

Sandeep Kaushik