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

Former Member
0 Likes
611

Hi All,

Is there is any standard function module for getting finacial month and year , if we pass current date as input.

Regards,

Nikhil

4 REPLIES 4
Read only

Former Member
0 Likes
571

FM - 'FI_PERIOD_DETERMINE'

CALL FUNCTION 'FI_PERIOD_DETERMINE'

EXPORTING

I_BUDAT =

  • I_BUKRS = ' '

  • I_RLDNR = ' '

  • I_PERIV = ' '

  • I_GJAHR = 0000

  • I_MONAT = 00

  • X_XMO16 = ' '

  • IMPORTING

  • E_GJAHR =

  • E_MONAT =

  • E_POPER =

  • EXCEPTIONS

  • FISCAL_YEAR = 1

  • PERIOD = 2

  • PERIOD_VERSION = 3

  • POSTING_PERIOD = 4

  • SPECIAL_PERIOD = 5

  • VERSION = 6

  • POSTING_DATE = 7

  • OTHERS = 8

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Regards

vasu

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
571

Sure, you will need to pass the company code, or a calendar id as well.



report zrich_0001 .

data: period like t009b-poper,
      year like bkpf-gjahr.

call function 'FI_PERIOD_DETERMINE'
     exporting
          i_budat = sy-datum
          i_bukrs = '0010'
     importing
          e_gjahr = year
          e_poper = period.

write:/ period, year.

Regards,

RIch Heilman

Read only

0 Likes
571

Hi Rich Heilman

I only want to pass the date

Regards,

Nikhil

Read only

0 Likes
571

Unfortunately, if you are looking for FI period, these are always tied to a company code, and/or fiscal year variant. This funciton module works from this, if you provide the company code, it will find the specific fiscal year variant that it needs to determine the fiscal period/year, if you provide the fiscal year variant directly, it will simply use that fiscal year variant to determine the period.

The fiscal year variants are stored in table T001 specific to the company code.

Regards,

RIch Heilman