F3313InitializeDateArray

F3313, Initialize Capacity Load Date Array

Minor Business Rule

Object Name: B3300250

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose
The purpose of this function is to load date values into the Date Array based on Work Center, Unit Of 
Measure, Capacity Mode and Start Date values entered.


1.2Setup Notes and Prerequisites


1.3Special Logic


2.Technical Specifications

WkNoOfDates = 0
If NumberPastDueDates <> 0, 1, or 2

NumberPastDueDates = 0

End


Allocate memory for the Capacity Load Date Array (max of NumberOfDates elements)

If the memory allocation fails

Exit the function with an error return code

End


WkStartDate = Start Date


Open Table F3313.

If open table fails

Exit the function with an error return code

End


If NumberPastDueDates > 0

Use the F3313 index which has CRSTRT sorted in descending order.

Select records from F3313 using key values Capacity Mode, Work Center, Unit of Measure,

Capacity Type = 10, and Start Date <= WkStartDate.
Fetch the first selected record.

If the fetch is successful

WkStartDate = CRSTRT from F3313 record

Fetch the next record

If the fetch is successful

WkStartDate = CRSTRT from F3313 record
If NumberPastDueDates = 2

Fetch the next record

If the fetch is successful

WkStartDate = CRSTRT from F3313 record

End

End

End
End
End


Select records based on the input values for Work Center, Unit of Measure, WkStartDate(ascending 

order)
, Capacity Mode, and Capacity Type = 10.

While fetch is successful

Fetch the next record from F3313

If the fetch is successful

Load DateArray with STRT from F3313
Increment Array Pointer

WkNoOfDates = WkNoOfDates +1
End

End While

Close Table F3313


^

Data Structure

D3300250 - F3313, Initialize Capacity Load Date Array


Data Item Data Structure DescriptionI/ORequiredNotes

MCU            Work Center                        IY

STRT            Start Date                        I

UM              Unit Of Measure                   IY

CAPM            Capacity Mode                  IY

INT01            Number Of Dates                  I/OY      Input the max number of dates 

to load 

                                                                        into the array.  The program 

returns 

                                                                        the actual number of dates 

loaded.

INT02             Number Past Due Dates            IN      Allowed values are 0, 1, and 

2.

                                                                        Default is 0.

GENLNG      Capacity Load Date Array PointerOY

SUPPS            Suppress Error Message            IY      '1' = Suppress error messages 


                                                                        ' ' = Allow error messages

DTAI             Error Message ID                  OY      ' ' = success 

                                                                        '3143' = Table access error 

                                                                        '4374' = Memory allocation 

failed


^

Parameter NameData ItemData TypeReq/OptI/O/Both
szWorkCenterMCUcharNONENONE

An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
might be a warehouse location, job, project, work center, branch, or plant. You can assign a business unit to a document, entity, or person for 
purposes of responsibility reporting. For example, the system provides reports of open accounts payable and accounts receivable by 
business unit to track equipment by responsible department. Business unit security might prevent you from viewing information about business units 
for which you have no authority.

jdStartDateSTRTJDEDATENONENONE

The start date for the order. You can enter this date manually, or have the system calculate it using a backscheduling routine. The routine 
starts with the required date and offsets the total leadtime to calculate the appropriate start date.

szUnitOfMeasureUMcharNONENONE

A user defined code (00/UM) that identifies the unit of measurement for an amount or quantity. For example, it can represent a barrel, box, 
cubic meter, liter, hour, and so on.

cCapacityModeCAPMcharNONENONE

A code indicating which planning is being used. Valid values are:     1    Resource Requirements Planning     2    Rough Cut Capacity 
Planning     3    Capacity Requirements Planning

nNumberOfDatesINT01integerNONENONE

Number of Days in Future to Query for Responses Due. 

idDateArrayPointerGENLNGIDNONENONE

General purpose ID variable.

cSuppressErrorMessageSUPPScharNONENONE

A flag indicating whether or not runtime error messaging will occur when an error message is issued from a business function.        0 = allow 
runtime error message handling.        1 = suppress runtime error message handling.

szErrorMessageIDDTAIcharNONENONE

A code that identifies and defines a unit of information. It is an alphanumeric code up to 8 characters long that does not allow blanks or 
special characters such as %, &, or +. You create new data items using system codes 55-59. You cannot change the alias.

nNumberPastDueDatesINT02integerNONENONE

Number of Days in the Past to Query for Quote Requests Received. 

szWorkcenterBranchWMCUcharOPTNONE

This is the branch/plant to which the work center belongs and must exist in the business unit master (F0006) and branch plant constants file 
(F41001).

Related Functions

None

Related Tables

F3313 Capacity Load Table