1.Functional Description
This business function will read the Sales Order table (F4211) and write Open Quantities to the MRP
Item Quantity Cache in the primary unit of measure. Calculate quantities are written to the cache with
Quantity Type 'SOU' (Sales Order Unadjusted).
1.1Purpose
This function is used to obtain data from the F4211 table for the MRP Planning Program P3482. The
function will return error codes necessary. Adjustments to order quantities according to time fence rules
will be performed in the B3400400 BsFn.
1.2Setup Notes and Prerequisites
The MRP Item Quantity Cache must be created using Business Function B3401270.
Note: When this function is called from in $$CONS = '2', it will also write 'SOT' quantities. These
'SOT' quantities are used in B3400400 to adjust sales orders qtys. They will be used in place of 'SOU'
quantities in B3400400.
What are 'SOT' qtys? They are sales order quantities but if the Sales Order has a related order
number and type, we will search the F3411 table for the related order and use the MMTRQT value from F3411
as the 'SOT' qty.
1.3Special Logic
None
2.Technical Specifications
The following actions have to be performed by the Business Function.
1.Open Tables
Open tables F4211 and F4108
If Error in Opening the Tables, Exit the function with an Error code = '1'
2. Load the Sales Order Data in the Cache
Switch (Input Number of Past Due Periods $PDUE)
Case 0
If Input Forecast Consumption Flag($$FCP) = '1'
Wk From Date = Input Forecast Beginning Date($$FBDT)
Else
Wk From Date = Input Begin Date ($$BEG)
End If
Branch(SVMCU), and Wk From Date <= SDPDDJ <= Input Thru Date($$ENDD)
If Input Forecast Consumption Flag($$FCP) = '1'
Branch(SVMCU), and Input Forecast Beginning Date($$FBDT) <= SDPDDJ <= Input Thru Date($$ENDD)
Branch(SVMCU) and SDPDDJ <= Input Thru Date ($$ENDD)
Case 2
Branch(SVMCU) and SDPDDJ <= Input Thru Date ($$ENDD)
Wk Exit Flag = '0'
If Input Consolidation Branch = " "
Wk Cache Branch = Input Branch
Else
While Wk Exit flag <> '1'
Fetch the record from F4211
If Fetch Failed
Break
Endif
If SDPDDJ = 0 then
Continue
End If
SDDCTO, SDLNTY, and SDNXTR.
Continue
EndIf
Wk Quantity = SDUORG - SDQTYT - SDSOCN
If SDUOM <> Input Primary UOM1 Or SDUOM4 <> SDUOM Or Input Potency Control flag
= 'Y'
Convert Wk Quantity from SDUOM to Input Primary UOM1 using B4000520.
Endif
If Input Potent Unit <> '1' and Input Potency Control = 'Y'
Get F4108 row using SDITM, SDMCU and SDLOTN as keys.
If Found and Input Standard Potency <> 0
Wk Quantity = (Wk Quantity * IOLOTP)/Input Standard Potency
Endif
Endif
If Wk Quantity <= 0
Continue
EndIf
Branch, SDPDDJ, and Quantity Type = 'SOU'.
Add Wk Quantity to the record Quantity and,
Call B3401290 in 'UPDATE' mode to update the record.
Else
Branch, SDPDDJ, 'SOU', and Wk Quantity
If Input Consolidation Method = '2' then
If SDRORN <> 0 And SDRCTO <> " " then
While Wk Exit 2 <> '1'
Wk Qty 2= Wk Quantity
Call B3401270 in mode '9' using Input Date Branch and
SDPDDJ and Comparison = 'B'.
Wk SDPDDJ = Date from B3401270.
Wk Skip = ' '
Read F3411 using MMDOCO=SDRORN and MMDCTO=SDRCTO.
If Read Fails
Exit While Wk Exit 2 loop
End If
If MMMSGT = 'M' Or MMKCOO <> SDRKCO Or MMLNID <> SDRLLN
Continue
End If
MMDCTO=SDDCTO, MMHCLD='A', MMUSER, MMPID, MMUPMJ, MMJOBN, MMLNID=SDLNID,
MMVEND=SDAN8, MMSTRT=0, MMRSTJ=0.
* Decrease
MMMSGT='A'
Wk Qty 2 = MMTRQT
MMDRQJ= Wk SDPDDJ, MMRRQJ=0, MMDSC1=Input Decrease
SO Qty Desc
If Input Warning Msg Flag = '1' And MMTRQT <> 0
then
Write to F3411and Increment Input F3411 UKID.
Input Display Code = '2'
End If
End Case
Case MMMSGT = 'G'
* Increase
MMMSGT='A'
Wk Qty 2 = MMTRQT
MMDRQJ= Wk SDPDDJ, MMRRQJ=0, MMDSC1=Input Increase
SO Qty Desc
If Input Warning Msg Flag = '1' And MMTRQT <> 0
then
Write to F3411and Increment Input F3411 UKID.
Input Display Code = '2'
End If
End Case
Case MMMSGT = 'D'
* Defer
MMMSGT='A'
Wk Offset = MMRRQJ - MMDRQJ
MMDRQJ= Wk SDPDDJ, MMDSC1=Input Defer SO Desc
Wk SDPDDJ = Wk SDPDDJ + Wk Offset
MMTRQT = Wk Qty 2
and Wk SDPDDJ and Comparison Flag = 'B'
MMRRQJ = Date from B3401270
then
Write to F3411and Increment Input F3411 UKID.
Input Display Code = '2'
End If
End Case
Case MMMSGT = 'C'
* Cancel
Wk Skip = '1'
MMMSGT = 'A'
MMTRQT = Wk Qty 2
MMDRQJ = Wk SDPDDJ
MMRRQJ=0
MMDSC1 = Input Cancel SO Desc
If Input Warning Msg Flag = '1' And MMTRQT <> 0
then
Write to F3411and Increment Input F3411 UKID.
Input Display Code = '2'
End If
End Case
Case MMMSGT = 'E'
*Expedite
MMMSGT='A'
Wk Offset = MMDRQJ - MMRRQJ
MMDRQJ= Wk SDPDDJ, MMDSC1=Input Expedite SO Desc
Wk SDPDDJ = Wk SDPDDJ - Wk Offset
MMTRQT = Wk Qty 2
and Wk SDPDDJ and Comparison Flag = 'B'
MMRRQJ = Date from B3401270
then
Write to F3411and Increment Input F3411 UKID.
Input Display Code = '2'
End If
End Case
End While
Else
Wk Skip = ' '
Wk Qty 2 = Wk Quantity
Wk SDPDDJ = SDPDDJ
End If
* Write the 'SOT' quantity into the cache.
If Wk Skip <> '1'
record using Wk Cache Branch, Wk SDPDDJ, and Quantity Type = 'SOT'.
using the Wk Cache Branch, SDPDDJ, 'SOT', and Wk Qty 2
End If
EndWhile
3 Close all Tables
Close all Tables
Exit the function with Error Code = 0
^
D3400390 - MRP, Write Sales Order Qty To Cache
Data Item Data Structure DescriptionI/ORequiredNotes
JOB Job Number IY Used when accessing cache
bsfn.
ITM Short Item Number IY SVITM
MCU Branch IY SVMCU
EFFF Begin Date IY Loaded with $$BEG
DATE04 Forecast Beginning Date IY Loaded with $$FBDT
EFFT Thru Date IY @DT[$PND] = $ENDD
OT1Y Potency Control flag IY From Item Bal IBOT1Y
STDP Standard Potency Value IY From Item Bal IBSTDP
EV01 Potent Unit flag IY $$PUFG
UOM1 Primary UOM1 IY From F4101 IMUOM1
EV01 Suppress Error Message I ' ' - Display Errors '1' -
Suppress
Error Messages
ERRC Error Code O '0' - Success (Default) '1' -
Error
in Function
DTAI Error Message ID O Blanks - Success '3143' -
Errors
TFLA Std UOM Conversion IY SVTFLA
INT01 Number of Past Due Periods I $PDUE, which is the integer
representation of $$PSTD.
EV03 Forecast Consumption Flag I '1' if FC is On, $$FCP
EV02 Consolidation Method I '2' to write 'SOT'
quantities.
DSC1 Decrease SO QtyDesc I VTX field - Required if
Consolidation
Method is '2'
DSC1Increase SO QtyDesc I "VTX field - Required if
Consolidation Method is '2'
DSC1Defer SODesc I VTX field - Required if
Consolidation Method is '2'
DSC1Cancel SO Desc I VTX field - Required if
Consolidation Method is '2'
DSC1Expedite SO Desc I VTX field - Required if
Consolidation Method is '2'
EV01Warning Msg Flag I $@A - Required if
Consolidation Method is '2'
UKIDF3411 Unique ID I/O $SKUID - Required if
Consolidation Method is '2'
MRPDMRP Display Code I/O $$MRPD - Required if
Consolidation Method is '2'
MCUDate Branch I Branch to get dates from. If
$$CONS = '1', it must equal to
Consolidation Branch
PIDProgram ID I Required if Consolidation
Method is '2'
MCUConsolidation Branch I $CMCU
^
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
| ||||
jdBeginDate | EFFF | JDEDATE | NONE | NONE |
A date that indicates one of the following:
o When a component part goes into effect on a bill of material
o When a routing step goes into
| ||||
cPotencyControlFlag | OT1Y | char | NONE | NONE |
A code that indicates whether you control the item by potency. | ||||
mnStandardPotencyValue | STDP | MATH_NUMERIC | NONE | NONE |
The percentage of active ingredients normally found in an item. | ||||
cPotencyUnitFlag | EV01 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
szPrimaryUom1 | UOM1 | char | NONE | NONE |
A user defined code (00/UM) that identifies the unit of measure that the system uses to express the quantity of an item, for example, EA
| ||||
cSuppressErrorMessage | EV01 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
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
| ||||
szStandardUOMConversion | TFLA | char | NONE | NONE |
Allows you to bypass the item-specific unit of measure and use the standard unit of measure. Valid values are:
blank Use the item-specific
| ||||
szJobNumber | JOB | char | NONE | NONE |
Job Number | ||||
jdThruDate | EFFT | JDEDATE | NONE | NONE |
A date that indicates one of the following:
o When a component part is no longer in effect on a bill of material
o When a routing step is no
| ||||
jdForecastBeginningDate | DATE04 | JDEDATE | NONE | NONE |
Event point for JDE Date. | ||||
nNumberPastDuePeriods | INT01 | integer | NONE | NONE |
Number of Days in Future to Query for Responses Due. | ||||
cForecastConsumptionFlag | 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,
| ||||
cConsolidationMethod | EV02 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
szDecreaseSOQtyDesc | DSC1 | char | NONE | NONE |
Brief information about an item; a remark or an explanation. | ||||
szIncreaseSOQtyDesc | DSC1 | char | NONE | NONE |
Brief information about an item; a remark or an explanation. | ||||
szDeferSODesc | DSC1 | char | NONE | NONE |
Brief information about an item; a remark or an explanation. | ||||
szCancelSODesc | DSC1 | char | NONE | NONE |
Brief information about an item; a remark or an explanation. | ||||
szExpediteSODesc | DSC1 | char | NONE | NONE |
Brief information about an item; a remark or an explanation. | ||||
cWarningMsgFlag | EV01 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
mnF3411UniqueID | UKID | MATH_NUMERIC | NONE | NONE |
This field is a unique number used to identify a record in a file. | ||||
cMRPDisplayCode | MRPD | char | NONE | NONE |
This code may be used as an additional field to select Item information to print on reports. Once values are loaded into this field, The
| ||||
szDateBranch | 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
| ||||
szProgramId | PID | char | NONE | NONE |
The number that identifies the batch or interactive program (batch or interactive object). For example, the number of the Sales Order Entry
| ||||
szConsolidationBranch | 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
| ||||
mnUniqueKeyIDOffset | MATH01 | MATH_NUMERIC | OPT | NONE |
- - - Good Performance Low Value. | ||||
cSalesOrderIncluded | EV01 | char | OPT | NONE |
An option that specifies the type of processing for an event. | ||||
cProjectPlanning | EV01 | char | OPT | NONE |
An option that specifies the type of processing for an event. | ||||
mnSequenceNumber | SEQN | MATH_NUMERIC | OPT | NONE |
A number used to organize the table into a logical group for online viewing and reporting. | ||||
mnCustomerNumber | AN8 | MATH_NUMERIC | OPT | NONE |
A number that identifies an entry in the Address Book system, such as employee, applicant, participant, customer, supplier, tenant, or
| ||||
cMode | EV01 | char | OPT | NONE |
An option that specifies the type of processing for an event. | ||||
cCustomerAddressRltnship | FCCR | char | OPT | NONE |
|
B3401270 Cache, Process MRP Bucketless Dates | ||||
B3401290 Cache, Process MRP Item Quantities | ||||
B3401300 Cache, Process MRP Inclusion Rules | ||||
B4000520 Get Item UoM Conversion Factor |
F3411 MPS/MRP/DRP Message File | ||||
F4108 Lot Master | ||||
F4211 Sales Order Detail File |