1.Functional Description
This business function will read the Supply and Demand Work table (F4021W) and calculate available to
promise (ATP) values based on the supply and demand records it contains. New records will be written
to the table with calculated ATP values as required.
1.1Purpose
This function is used to calculate and write ATP records to the F4021W table for Supply and Demand
Report. This function will return error codes as necessary.
1.2Setup Notes and Prerequisites
None
1.3Special Logic
None.
2.Technical Specifications
Wk Last Seq No = 0
Wk ATP Date = 0
Wk ATP Qty = 0
Wk ATP Seq No = 0
Wk Supply Qty = 0
Wk Demand Qty = 0
Wk Lot Demand Qty = 0
Skip Flag = ' '
Exit Flag = ' '
Open the F4021W table
If the table open failed
Set Error Code to '1'
Set Error Message ID to '3143'
Exit the function
Endif
While Exit Flag <> '1'
Read F4021W table sequentially using Item and Branch as partial keys
If not found
Exit Flag = '1'
Write ATP record with ITM, MCU, MMCU, Wk ATP Date, Wk ATP Seq No + 5, M5NUMR, and
Wk ATP Qty
Else
Skip Flag = ' '
If M5BSEQ = 0 and Input Summary Flag = '1'
Skip Flag = '1'
Endif
Wk Supply Qty= M5TRQT
Wk Demand Qty= M5SOQS
If M5BSEQ < 70
If Wk Last Seq < 70 and Wk ATP Date = M5DRQJ
Wk ATP Qty = Wk ATP Qty + Wk Supply Qty
Wk ATP Seq No = M5BSEQ
Else
Write ATP record with ITM, MCU, Wk ATP Date, Wk ATP Seq No + 5, M5NUMR, and
Wk ATP Qty
Wk ATP Date = M5DRQJ
Wk ATP Seq No = M5BSEQ
If ATP Flag = '2'
If M5BSEQ = 10
Wk ATP Qty = Wk ATP Qty - Wk Demand Qty
Else
Wk ATP Qty = Wk ATP Qty + Wk Supply Qty
Endif
Else
Wk ATP Qty = Wk Supply Qty
Endif
Endif
Else
If M5BSEQ <> 80/* changed 04/30/96, Forecast Typ = 80 not 70 */
Wk ATP Qty = Wk ATP Qty - Wk Demand Qty
Endif
Endif
If M5BSEQ = 10
If Wk Lot Demand Qty < M5SOQS
M5SOQS = M5SOQS - Wk Lot Demand Qty
Wk Lot Demand Qty = 0
Else
Skip Flag = '1'
Endif
Endif
If M5BSEQ >= 70
Wk Lot Demand Qty = Wk Lot Demand Qty + M5SOQS
Endif
If Skip Flag <> '1'
Wk Last Seq = M5BSEQ
Endif
Endif
EndWhile
Close the F4021W table and exit the function
D3400320 - Calculate And Write ATP Records
Data Item Data Structure DescriptionI/ORequiredNotes
ITM Short Item Number IY
MCU Branch IY
EV01 ATP Flag IY '1' - Calculate and write ATP
records '2' - Calculate and
write cumulative
ATP records
EV02 Item Location Summary Flag IY ' ' - Do not summarise item
location records '1' -
Summarize item location records
EV03 Suppress Error Message I ' ' - Display Errors '1' -
Suppress
Error Message
ERRC Error Code O '0' - Success (Default) '1' -
Errors in processing table
DTAI Error Message ID O ' ' - Success '3143' - Errors
^
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
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
| ||||
szBranch | 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
| ||||
cATPFlag | EV01 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
cItemLocationSummaryFlag | EV02 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
cSuppressErrorMessages | EV03 | char | NONE | NONE |
A radio button that specifies the level at which trace/track result is to be displayed. Select the Detail to display all transactions except IB, IX,
| ||||
cErrorCode | ERRC | char | NONE | NONE |
This error code indicates if any errors occurred during the creation of the Trip Document Detail (F4914) records by the Delivery Document
| ||||
szErrorMessageID | DTAI | char | NONE | NONE |
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
| ||||
szUserId | USER | char | OPT | NONE |
The code that identifies a user profile. | ||||
szComputerID | CTID | char | OPT | NONE |
szJobNumber | JOB | char | OPT | NONE |
Job Number |
None |
None |