FiscalYearBeginEndDates

Fiscal Year Begin & End Dates

Minor Business Rule

Object Name: N0800030

Parent DLL: CHRM

Location: Client/Server

Language: NER

Functional Description

This NER returns the begin and end dates for a fiscal year.  The current fiscal year can also be returned if a value is not passed in.  Either the Home 

Business Unit or the Company is required input.  All error conditions are returned in cErrorCode; no hard errors are generated 


SetUp Notes


Technical Specifications


Parameters


Data Item Data Structure Description I/O     RequiredTableNotes

HMCU                 szCostCenterHome             IRequired if CO not passed in.

CO                           szCompany                           I/ORequired if HMCU not passed in. Will be                                                       

                                                                                                                                                                                                                                                                                

                                                                                                                                                                                                                                                                                

                                                                                                                                                                                                                                                                                

                                                                                                                                                                                                                                                                                

          set to value from HMCU record if HMCU was

                                                                                                                                passed in.

BDOWLD        jdFromDate                                O

EDOWLD jdThruDate                                O

ERRC                cErrorCode                                O*see below

FYOW    szFiscalYear                          I/OOutput (optional) - current year passed back if                                             

                                                                                                                                                                                                                                                    null passed in.


cErrorCode values:

Equivalent

Error Code

0 = no errors; program processed successfully 

1 = Home Business Unit record could not be read2017

2 = Company record could not be read0024

3 = Unable to retrieve fiscal date pattern0168

4 = Fiscal year is not numeric (sent in as string and tested for validity)2297

Related Tables 


Table Table Description

F0006Cost Center Master

F0008Date Fiscal Patterns

F0010Company Constants



Processing 


if szCostCenterHome is not blank

read the F0006 record and return the value for company in szCompany
if unsuccessful read 

  cErrorCode = 1
end if

if cErrorCode = zero

if szCompany <> blank

read the F0010 record and return fiscal date pattern and date fiscal year begins

if unsuccessful read

DefaultCompany = "00000"

read the F0010 record (using DefaultCompany as id) and return fiscal date pattern 
and date fiscal year begins

if unsuccessful read

cErrorCode = 2

end if

end if
else

cErrorCode = 2

end if

end if


if cErrorCode = zero

if szFiscalYear is not blank

check string is numeric

if string not numeric

cErrorCode = 4

end if

end if

end if


if cErrorCode = zero

if szFiscalYear = blank

select the F0008 (Date Fiscal Patterns) records with the same "fiscal date pattern" and "date

fiscal year begins" as what was read from F0010 record

read the first record from the F0008 select and return first period end date and the begin & end 

dates
if unsuccessful read

cErrorCode = 3

else

extract year from the first period end date (this is the fiscal year)
convert numeric fiscal year from F0008 to string and place in szFiscalYear

end if

else

convert input fiscal year value to numeric and store in temp variable

select the F0008 (Date Fiscal Patterns) records with the same "fiscal date pattern" as was read 
from F0010 
read the first record from the F0008 select and return first period end date and the fiscal year 

begin and end dates
extract year from the first period end date (this is the fiscal year)
while year from end of first period <> passed in fiscal and file i/o status = success

read the next record from the F0008 select and return first period end date and the

fiscal year begin and end dates
extract year from the first period end date (this is the fiscal year)
end while

if unsuccessful read

cErrorCode = 3

end if

end if

end if




Data Structure

DN0800030 - Fiscal Year Begin & End Dates

Parameter NameData ItemData TypeReq/OptI/O/Both
szCostCenterHomeHMCUcharNONENONE

The number of the business unit in which the employee generally resides.

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.

jdFromDateBDOWLDJDEDATENONENONE

The beginning date of the range in a search. If you do not specify a beginning date, the system uses the current date.

jdThruDateEDOWLDJDEDATENONENONE

The ending date for the period that you want to review. If you leave this field blank, the system uses the ending date of the current period 
specified for the company.

cErrorCodeERRCcharNONENONE

This error code indicates if any errors occurred during the creation of the Trip Document Detail (F4914) records by the Delivery Document 
Set Server program (XT4914).

szFiscalYearFYOWcharNONENONE

A four-digit number that identifies the fiscal year. You can enter a number in this field or leave the field 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, 2005, and ends September 30, 2006. The end of the first period is October 31, 2005. Specify the 
year 2005 rather than 2006.

Related Functions

None

Related Tables

None