F0008BGetFiscalYearPeriodNumber

F0008B Get Fiscal Year Period Number

Major Business Rule

Object Name: X0903B

Parent DLL: CFIN

Location: Client/Server

Language: C

Functional Description

Purpose

The purpose of this function is to determine the Period Number , Fiscal Year, and Century using the 

Fiscal Date tables (F0008 and F0008B).



Technical Specifications


Processing 

1.Initialize the Error Code (ds-ERRC) to '0'.
2.If Fetch Company Constants (ds-EV01) is '1', or the Date Pattern (ds-DTPN) is blank, or the 

Fiscal Year Begin Date (ds-DFYJ) is null,

a.Initialize the following fields to zero:  G/L Period Number (ds-PN), Fiscal Year (ds-FY), and 
Century (ds-CTRY).

b.Fetch the Company Constant row (F0010) based upon the input Company (ds-CO).  If a row is not 

found, fetch the record based on the default Company (Company = '00000').  Only the Date Pattern 

(CCDTPN) and Fiscal Year Begin Date (CCDFYJ) are needed for processing.

c.Assign the Fetch Company Constants (ds-EV01) as '0' to indicate that the constants for the 

specified company have already been retrieved.

3.Assign the following keys for the Fiscal Patterns Date table for 52 Period Accounting (F0008B): 
 Fiscal Date Pattern (CDDTPN = ds-DTPN), Fiscal Year Begin Date (CDDFYJ = ds-DGJ), and Fiscal Quarter 

(CDFQ = blank).

4.Perform a fetch on the Fiscal Patterns Date table (F0008B) for the given keys.

5.If a record is not found or if the G/L Date (ds-DGL) falls outside the fiscal year date range, 

perform a fetch on the table for the given Date Pattern, where the Fiscal Year Begin Date falls within 

the fiscal year date range.  If a record is not found, assign the Continue Processing flag as False, 

and the Error Code (ds-ERRC) as '1'.

6.If the Continue Processing flag is set to True,

a.Assign the Period End Dates (CDDxxJ) returned from the Date Fiscal Pattern table (F0008B) to a 
54 element date array.

b.Loop through the Period End Date array to determine in which Period Number the G/L Date falls.

c.Perform a fetch on the Date Fiscal Patterns table (F0008) for the Date Pattern and Fiscal Year 

Begin Date.  Use the End of Period Date for period one to determine the Fiscal Year (ds-FY) and 

Century (ds-CTRY) to return.



Data Structure

DX0903B - Get Fiscal Year Period Number

Parameter NameData ItemData TypeReq/OptI/O/Both
szCompanyCOcharNONENONE

A code that identifies a specific organization, fund, or other reporting entity. The company code must already exist in the Company 
Constants table (F0010) and must identify a reporting entity that has a complete balance sheet. At this level, you can have intercompany 
transactions. Note: You can use company 00000 for default values such as dates and automatic accounting instructions. You cannot use company 00000 
for transaction entries.

jdGLDateDGJJDEDATENONENONE

A date that identifies the financial period to which the transaction will be posted. You define financial periods for a date pattern code that you 
assign to the company record. The system compares the date that you enter on the transaction to the fiscal date pattern assigned to the 
company to retrieve the appropriate fiscal period number, as well as to perform date validations.

mnGLPeriodNumberPNMATH_NUMERICNONENONE

A number indicating the current accounting period.  This number, used in conjunction with the Company Constants table (F0010) and the 
General Constants table (F0009), allows the user to define up to 14 accounting periods. See General Ledger Date.  The current period number 
is used to determine posted before and posted after cut off warning messages.  It is also used as the default accounting period in the 
preparation of financial reports.

mnFiscalYearFYMATH_NUMERICNONENONE

A number that identifies the fiscal year. Generally, you can either enter a number in this field or leave it blank to indicate the current fiscal 
year (as defined on the Company Setup form). Specify the year at the end of the first period rather than the year at the end of the fiscal period. 
For example, a fiscal year begins October 1, 1998 and ends September 30, 1999. The end of the first period is October 31, 1998. Specify the 
year 98 rather than 99.

mnCenturyCTRYMATH_NUMERICNONENONE

The calendar century associated with the year. Enter is the first two digits of the year. For example, 19 indicates any year beginning with 19 
(1998, 1999), 20 indicates any year beginning with 20 (2000, 2001), and so on.

cErrorCodeERRCcharNONENONE

Returns 0 for success, 1 for error.
^

cFetchCompanyConstantsEV01charNONENONE

1 = Fetch Company Constants from F0010.
0 = Bypass fetch of Company Constants. 

     (only a valid value if the Date Pattern and Fiscal Year                      Begin Date have 

been passed in).


^

cF0010FiscalDatePatternDTPNcharNONENONE

Required if no fetch on the Company Constants.
^

jdF0010FiscalYearBeginDateDFYJJDEDATENONENONE

Required if no fetch on the company constants.
^

Related Functions

None

Related Tables

F0008 Date Fiscal Patterns
F0008B Date Fiscal Patterns - 52 Period Accounting
F0010 Company Constants