MRPWriteOnHandLotQtyToCacheA

MRP, Write On Hand And Lot Qty To Cache

Minor Business Rule

Object Name: B3400370

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description
This business function will write the total On Hand Qty from Location Master F41021 and, optionally, 
the Lot Quantity by Expiration Date into the MRP Item Quantity Cache.  The quantity information is 

written to the cache with Quantity Type "BAU" (Beginning Available Unadjusted) and "LXU" (Lot Expired 

Unadjusted). 


1.1Purpose
This function is used to obtain data from the F41021 and F4108 table for MRP Planning Program P3482. 
The function will return error codes necessary. 


1.2Setup Notes and Prerequisites

The MRP Item Quantity Cache is managed by business function B3401290.
This function emulates S005B. (In P3483, this function emulates S005 when $IBCK=' ')


1.3Special Logic
None

2.Technical Specifications
The following actions have to be performed by the Business Function.
1. Open tables

Open tables F41021 and F4108
If Consolidation Method = '1' Or '2'

Open F35UI001

End If

If WriteBAUQtyToUI is '1' then
Open F34UI005

End If

If Error in Opening, Exit the Function with Error Code = '1'

 

2. Load the Required Data from the F41021 table

Select Records from F41021 Using LIITM = Input Item(SVITM), LIMCU = Input Branch(SVMCU), and 
((LILOTS = " ") Or (LILOTS = Any of the 5 Input Lot Statuses))


If Input Consolidation Method = '1' then

Wk Cache Branch = Input Consolidation Branch

Else

Wk Cache Branch = Input Branch

End If


Wk Exit Flag = '0'

While Wk Exit flag <> '1'
Fetch the record from F41021

If Fetch Failed

Break

Endif

Get F4108 record using LIITM, LIMCU and LILOTN as keys

If Input $$LEXP = '1' and IOMMEJ < Input First Date and IOMMEJ <> 0

IOMMEJ = Input First Date

Endif

Wk Qty = LIPQOH

If  Input Transit flag = '1'

Wk Qty = Wk Qty + LIQTTR.

Endif.

If  Input Inspect flag = '1'

Wk Qty = Wk Qty + LIQTIN.

Endif.

If  Input Other1 flag = '1'

Wk Qty = Wk Qty + LIQTO1.

Endif.

If  Input Other2 flag = '1'

Wk Qty = Wk Qty + LIQTO2.

Endif.

If IOMMEJ <> 0 and SVOT1Y = 'Y' and $$PUFG <> '1' and SVSTDP > 0

 Wk Qty = Wk Qty * Lot Potency (IOLOTP) / Stand Potency (SVSTDP)

Endif 

If Input $$LEXP = '1' and IOMMEJ <> 0 and IOMMEJ <= Input Last Date

Call B3401290 in 'GET' mode to fetch from Item Quantity Cache using keys 
Wk Cache Branch, IOMMEJ, and QuantityType = 'LXU'

If Cache Error Code = '0'

Add Wk Qty to the Quantity from the cache record and 

Call B3401290 in 'UPDATE' mode to Update the cache record
Else

Call B3410290 in 'ADD' mode to Add a new record to the cache 
using Wk Cache Branch, IOMMEJ, 'LXU', and Wk Qty

EndIf
Endif

Wk Total Qty = Wk Total Qty + Wk Qty

EndWhile

If Consolidation Method = '1' Or '2'

Update F35UI001 using Input JOBS, Input CTID, and Input Branch and set Qty On 
Hand = Wk Total Qty and Transaction Qty = Wk Total Qty.

End If


If Input Safety Stock flag = '1'

Wk Total Qty = Wk Total Qty - Input SAFE

Endif


If Input Consolidation Method <> '1'

Call B3401290 to add a record to the Item Quantity cache using Branch, First Date, 
'BAU', Wk Total Qty

If WriteBAUQtyToUI = '1' then

Insert a record with 'BAU', Input First Date  and Wk Total Qty into 

F34UI005.

End If

Call B3401290 to add a record to the Item Quantity cache using Branch, First Date, 
'BA', Wk Total Qty

End IF


Close all Tables

Exit the function with Error Code = 0



Data Structure

D3400370A - MRP, Write On Hand And Lot Qty To Cache


Data Item Data Structure DescriptionI/ORequiredNotes

JOB            Job Number                        IY      Used when accessing cache 

bsfn.

ITM            Item Number                        IY      SVITM

MCU           Branch                              IY      SVMCU

OT1Y            Potency Control flag            IY      From Item Bal IBOT1Y

STDP            Standard Potency Value            IY      From Item Bal IBSTDP

SAFE            Safety Stocks                  IY      From Item Bal IBSAFE

DRQJ            First Date                        IY      @DT[1]

DRQJ            Last Date                        IY      @DT[$PND] = $$ENDD
EV01            Potent Unit flag                  IY      $$PUFG
EV02            Transit flag                  I           '1' - Include Transit Qty

EV03            Inspect flag                  I       '1' - Include Inspect Qty

EV04            Other1 flag                        I         '1' - Include Other1 Qty

EV05            Other2 flag                         I         '1' - Include Other2 Qty

EV06            Lot Expiration flag            I       $$LEXP

LOTS            Lot Status Code 1             I      $LSTS1

LOTS            Lot Status Code 2              I      $LSTS2

LOTS            Lot Status Code 3                  I      $LSTS3

LOTS            Lot Status Code 4                I      $LSTS4

LOTS            Lot Status Code 5                  I      $LSTS5

EV07            Safety Stock flag                  I      '1' Subtract Safety Stocks

EV09            Suppress Error Message            I      ' ' - Display Errors '1' - 

Suppress                                                                         Error Messages

ERRC            Error Code                        O      '0' - Success (Default) '1' - 

Errors                                                                         in function

DTAI            Error Message ID                  O         Blanks - Success '3143' - 

Errors

EV01            Consolidation Method                I         '1' or '2' or ' '

MCU            Consolidation Branch            I      Required if Consolidation 

Method is                                                                                                 

                                                                                                      

                  '1'

JOBS           Job Number for UI               I      Y

CTID            Computer ID                        I      Y

EV01              WriteBAUQtyToUI                  I Y      Always ' ' when called from 

R3483.                                                                         When called from R3482, 

pass in a '1'                                                                                          

                                                                                                      

                         ONLY when an item is a co product or                                         

                                a by product. 


^

Parameter NameData ItemData TypeReq/OptI/O/Both
mnShortItemNumberITMMATH_NUMERICNONENONE

An inventory item number. The system provides three separate item numbers plus an extensive cross-reference capability to other item 
numbers (see data item XRT) to accommodate substitute item numbers, replacements, bar codes, customer numbers, supplier numbers, and 
so forth. The item numbers are as follows:   o Item Number (short) - An eight-digit, computer-assigned item number     o 2nd Item Number - The 
25-digit, free-form, user defined alphanumeric item number     o 3rd Item Number - Another 25-digit, free-form, user defined alphanumeric item 
number

szBranchMCUcharNONENONE

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.

cPotencyControlFlagOT1YcharNONENONE

A code that indicates whether you control the item by potency.

mnStandardPotencyValueSTDPMATH_NUMERICNONENONE

The percentage of active ingredients normally found in an item.

mnSafetyStocksSAFEMATH_NUMERICNONENONE

The quantity of stock kept on hand to cover high-side variations in demand.

cPotentUnitFlagEV01charNONENONE

An option that specifies the type of processing for an event.

cTransitFlagEV02charNONENONE

An option that specifies the type of processing for an event.

cInspectFlagEV03charNONENONE

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, 
and IZ types.  Or, select Derivative Lots Only to display only those transactions that may have created new derivative lot. 

cOther1FlagEV04charNONENONE

PeopleSoft event point processing flag 04.

cOther2FlagEV05charNONENONE

A flag that indicates whether automatic spell check is turned on.

cLotExpirationFlagEV06charNONENONE

An option that specifies the type of processing for an event.

cLotStatusCode1LOTScharNONENONE

A user defined code (41/L) that indicates the status of the lot. If you leave this field blank, it indicates that the lot is approved. All other codes 
indicate that the lot is on hold. You can assign a different status code to each location in which a lot resides on Item/Location Information or 
Location Lot Status Change.

cLotStatusCode2LOTScharNONENONE

A user defined code (41/L) that indicates the status of the lot. If you leave this field blank, it indicates that the lot is approved. All other codes 
indicate that the lot is on hold. You can assign a different status code to each location in which a lot resides on Item/Location Information or 
Location Lot Status Change.

cLotStatusCode3LOTScharNONENONE

A user defined code (41/L) that indicates the status of the lot. If you leave this field blank, it indicates that the lot is approved. All other codes 
indicate that the lot is on hold. You can assign a different status code to each location in which a lot resides on Item/Location Information or 
Location Lot Status Change.

cLotStatusCode4LOTScharNONENONE

A user defined code (41/L) that indicates the status of the lot. If you leave this field blank, it indicates that the lot is approved. All other codes 
indicate that the lot is on hold. You can assign a different status code to each location in which a lot resides on Item/Location Information or 
Location Lot Status Change.

cLotStatusCode5LOTScharNONENONE

A user defined code (41/L) that indicates the status of the lot. If you leave this field blank, it indicates that the lot is approved. All other codes 
indicate that the lot is on hold. You can assign a different status code to each location in which a lot resides on Item/Location Information or 
Location Lot Status Change.

cSafetyStockFlagEV07charNONENONE

An option that specifies the type of processing for an event.

cSuppressErrorMessageEV09charNONENONE

An option that specifies the type of processing for an event.

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).

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.

szJobNumberJOBcharNONENONE

Job Number

jdFirstDateDATE01JDEDATENONENONE

Event point for JDE Date.

jdLastDateDATE01JDEDATENONENONE

Event point for JDE Date.

cConsolidationMethodEV01charNONENONE

An option that specifies the type of processing for an event.

szConsolidationBranchMCUcharNONENONE

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.

mnJobNumberJOBSMATH_NUMERICNONENONE

The job number (work station ID) which executed the particular job.

szComputerIDCTIDcharNONENONE

cSupplyDemandExistsEV01charOPTNONE

An option that specifies the type of processing for an event.

cProjectPlanningEV01charOPTNONE

An option that specifies the type of processing for an event.

cProjectSpecificItemEV01charOPTNONE

An option that specifies the type of processing for an event.

mnSequenceNumberSEQNMATH_NUMERICOPTNONE

A number used to organize the table into a logical group for online viewing and reporting.

Related Functions

B3401290 Cache, Process MRP Item Quantities

Related Tables

F41021 Item Location File
F410211 Project Commitment Detail Table
F4108 Lot Master