Functional Description
Purpose
Use this function to get the total period sales amount (AS01 - AS14) and total cost amount (CI01 - 
CI14) for a certain period/fiscal year/century range in the Sales Summary History table (F4229).  The 
function will take the specified record, total up all the period sales and period cost amounts that fall 
within the given period/fiscal year/century range and then return these two totals.
Setup Notes and Prerequisites
 Before calling this function, you will need to call the "Return Period Number, Fiscal Year and 
Century" business function for both the starting and ending range values.  This function will return the 
correct period, fiscal year and century for that range.
 When calling this function,  you will need to pass over the Business Unit  (MCU), Address Number 
(AN8), Order Type (DCTO), Item Number - Short (ITM), Line Type (LNTY), Sales Catalog Section (SRP1), Sub 
Section (SRP2), Sales Category Code3 (SRP3), Sales Category Code4 (SRP4) and Fiscal Year (FY) as the 
key to find the correct F4229 record..
 You will also need to pass over the beginning and ending periods, fiscal years and centuries that 
make up the range to do the totals on.
 You will also need a dictionary item work field for each value that you will need returned from the 
function; total sales, total cost.~
Special Logic
None.
Technical Specification
BF will compute the total period sales amount (AS01 - AS14) and total cost amount (CI01 - CI14) for a 
certain period/fiscal year/century range in the Sales Summary History table F4229.
 Related Tables
 Table Table Description
 F4229Sales Summary History
 
Find the Correct F4229 Record
1.Use the MCU, AN8, DCTO, ITM, LNTY, SRP1, SRP2, SRP3, SRP4 and FY Data Items passed in 
to find the correct record in the F4229 file. 
Process and Total the Sales and Cost Amounts
1.  If the Starting Century = Ending Century
         If  Starting Year = Ending Year Total from the corresponding values in (AS01..AS14 and 
CI01..CI14) from the Starting Period to the Ending Period.  
         elseif Starting Year <> Ending Year
              If Starting Year > Fiscal Year < Ending Year
                  Add all 14 periods for sales and cost.
              elseif Fiscal Year = Starting Year
                  Add Starting Period to 14 period amounts for sales and cost
              else  
 //Fiscal Year = Ending Year
                  Add 1 to Ending Period amounts for sales and cost
      else  
    //Starting Century <> Ending Century
         If Century = Starting Century     
   // Century here is the Century (CRTY) field in the F4229 record
              If Fiscal Year > Starting Year
                  Add all 14 period amounts for sales and cost
              else  
 // Fiscal Year = Starting Year
                  Add Starting Period to 14 amounts for sales and cost
         else  
   // Century = Ending Century    
   // Century here is the Century (CRTY) field in the F4229 record
              If Fiscal Year < Ending Year
                  Add all 14 periods for sales and cost
              else  
 // Fiscal Year = Ending Year
                  Add 1 to Ending Period amounts for sales and cost
Examples:
      Each record will have 14 period sales amount and period cost amount bins.
 AS01 .. AS14 = 14 period sales amounts
 CI01 .. CI14 = 14 period cost amounts
For the following examples there will be four records in the F4229 file that will be found by passing 
in a certain key combination.  For the first record (Record1), the Century (CTRY) will be 19 and the 
Fiscal Year (FY) will be 97.  For the second record (Record2), the Century (CTRY) will be 19 and the 
Fiscal Year (FY) will be 98.  For the third record (Record3), the Century (CTRY) will be 20 and the 
Fiscal Year (FY) will be 01.  And the fourth record (Record4) will have a Century (CTRY) of 20 and a 
Fiscal Year (FY) of 02.
Example 1: Starting Century = 19, Ending Century = 19, Staring Year = 97, Ending Year = 97, Starting 
Period = 4, Ending Period = 10
 Record3 and Record4 will not be calculated because they are in the wrong century.  Record2 
will not calculate because it lies in the wrong year. And Record1 will have AS04 through AS10 and CI04 
through CI10 calculated.
Example 2:  Starting Century = 19, Ending Century = 19, Staring Year = 97, Ending Year = 98, Starting 
Period = 5, Ending Period = 11
 Record3 and Record4 will not be calculated because they fall within the wrong Century.  
Record1 will have from AS05 to AS14 and CI05 to CI14 calculated.  And Record2 will have from AS01 to AS11 
and CI01 to CI11 calculated.  The reason for this is the Starting Period starts in the fifth period of 
1997 and the ending period is the eleventh period of 1998.  So the range of periods to calculate runs 
from the fifth period of 1997 all the way through the end of 1997 (fourteenth period)  and it then 
runs from the beginning of 1998 (first period) all the way to the eleventh period of 1998.
Example 3:  Starting Century = 19, Ending Century = 20, Staring Year = 98, Ending Year = 01, Starting 
Period = 6, Ending Period = 9~  
Starting Century/Starting Fiscal Year combination (19/97 < 19/98).  Record4 will not be calculated 
because its Century/Fiscal Year combination is after the Starting Century/Starting Fiscal Year 
combination (20/02 > 20/01).  Record2 will have from AS06 to AS14 and CI06 to CI14 
calculated.  And Record3 will have from AS01 to AS09 and CI01 to CI09 calculated.  The reason for this 
is the Starting Period starts in the sixth period of 1998 and the ending period is the ninth 
period of 2001.  So the range of periods to calculate runs from the sixth period of 1998 all the 
way through the end of the 19th century (including the fourteenth period of 1998) and it then 
runs from the beginning of  the 20th century (including the first period of 2001) all the way 
to the ninth period of 2001.
2.  Return the total Period amounts for that record in the Sales Totals and Cost Totals variables.
D4200620 - Calculate F4229 Period Sales Cost
Special Input Expected
Parameters:
Data Item Data Structure DescriptionI/O Required   Notes
 
MCU      Business Unit                  I    Y         Business Unit of
                                                               F4229 record
AN8      Address Number                 I    Y         Sold to Customer                       
                                         Number for F4229                                             
                   record
DCTO        Order Type                    I    Y         Order Type for                         
                                        F4229 record
ITM      Item Number - Short            I    Y         Item Number - Short                    
                                            of F4229 record
LNTY      Line Type                    I    Y         Line Type of F4229                     
                                           record
SRP1      Sales Catalogue Section        I    Y         Sales Catalogue                        
                                        Section of F4229                                              
                  record
SRP2      Sub Section                    I    Y         Sub Section of                         
                                       F4229 record
SRP3      Sales Category Code3           I    Y         Sales Category                         
                                       Code3 of F4229                                                 
               record
SRP4      Sales Category Code4       I    Y         Sales Category                         
                                       Code4 of F4229                                                 
               record
FY      Fiscal Year                   I    Y         Fiscal Year of                         
                                       F4229 record
CRPR      Starting Period             I    Y         Period where                           
                                     starting range                                                   
                                                                            begins
CRPR      Ending Period             I        Y         Period where ending                    
                                            range ends
FY      Starting Year             I    Y         Fiscal year                            
                                    starting range                                                    
            begins in
FY      Ending Year                   I    Y         Fiscal year ending                     
                                           range ends in
CTRY      Starting Century             I    Y         Century starting                       
                                         range begins in
CTRY      Ending Century             I    Y         Century ending                         
                                       range ends in.
Special Output Returned
Parameters:
Data Item Data Structure DescriptionI/ORequiredNotes
AM0      Sales Totals             O   N      Total of all period                       
                                      sales totals falling                                            
                 in the starting and                                                             
ending range
AM0      Cost Totals                   O    N      Total of all period                       
                                      costs totals falling                                            
                 in the starting and                                                                  
                                                       ending range.
^
| Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both | 
|---|---|---|---|---|
| szBusinessUnit | MCU | char | NONE | NONE | 
An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
  | ||||
| mnAddressNumber | AN8 | MATH_NUMERIC | NONE | NONE | 
A number that identifies an entry in the Address Book system, such as employee, applicant, participant, customer, supplier, tenant, or 
  | ||||
| szOrderType | DCTO | char | NONE | NONE | 
A user defined code (00/DT) that identifies the type of document. This code also indicates the origin of the transaction. J.D. Edwards has 
  | ||||
| mnShortItemNumber | ITM | MATH_NUMERIC | NONE | NONE | 
An inventory item number. The system provides three separate item numbers plus an extensive cross-reference capability to other item 
  | ||||
| szLineType | LNTY | char | NONE | NONE | 
A code that controls how the system processes lines on a transaction. It controls the systems with which the transaction interfaces, such as 
  | ||||
| szSalesCatalogueSection | SRP1 | char | NONE | NONE | 
  | ||||
| szSubSection | SRP2 | char | NONE | NONE | 
  | ||||
| szSalesCategoryCode3 | SRP3 | char | NONE | NONE | 
  | ||||
| szSalesCateqoryCode4 | SRP4 | char | NONE | NONE | 
  | ||||
| mnFiscalYear | FY | MATH_NUMERIC | NONE | NONE | 
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 
  | ||||
| mnStartingPeriod | CRPR | MATH_NUMERIC | NONE | NONE | 
This week or month. This is usually a number between 1 and 52 that designates the relative position in the year. For example, on a 
  | ||||
| mnEndingPeriod | CRPR | MATH_NUMERIC | NONE | NONE | 
This week or month. This is usually a number between 1 and 52 that designates the relative position in the year. For example, on a 
  | ||||
| mnStartingYear | FY | MATH_NUMERIC | NONE | NONE | 
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 
  | ||||
| mnEndingYear | FY | MATH_NUMERIC | NONE | NONE | 
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 
  | ||||
| mnStartingCentury | CTRY | MATH_NUMERIC | NONE | NONE | 
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 
  | ||||
| mnEndingCentury | CTRY | MATH_NUMERIC | NONE | NONE | 
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 
  | ||||
| mnSalesTotals | AM0 | MATH_NUMERIC | NONE | NONE | 
Everest Parent Data Item  | ||||
| mnCostTotals | AM0 | MATH_NUMERIC | NONE | NONE | 
Everest Parent Data Item  | ||||
| szSalesCategoryCode5 | SRP5 | char | OPT | NONE | 
One of ten category codes to be used for sales coding purposes.  These codes can represent such classifications as color, material 
  | ||||
| B4000460 Free Ptr To Data Structure | 
| F4229 Sales Summary History File |