The audience for this note is someone with developer level knowledge.
In inventory transaction LOCN (Lot Number) can be populated on the fly. This document is to explain how it add/reverse lot information through inventory transaction. This is mainly handled by Inventory Transaction Master business function XT4111Z1.
First of all, to understand what a lot is and what factors affect lot information refer to <Document 642908.1> E1: 41: Lot and Serial Number Control.
Overview
Unlike other master file creation there is no routine for checking whether to write F4108 or not. So this is hard coded in routine based on nTransaction (or application ID) in calling X4111Z1 - Inventory Transaction.
Q1> What is routine to edit location and populate lot information?
Inventory Transaction handles input data or default data in following sequence:
Edit Location
Default from Primary Location
Edit Lot Number
Unload Quantity
Assign CFGSID
Validate Lot
Check Lot Duplication
Unload Lot Default
Unload Exp Date Info
Verify Effectivity Date
Assign Lot Status
Store Dates
Q2> What are the Action Code handled in Inventory Transaction?
There are two types of transactions:
'1' = Add
'3' = Reversal
Q3> What are transactions which creates Lot Master (F4108)?
So long as it meets below nTransaction it always update F4108:
Not bulk item (f4101.bpfg - Bulk/Packed Flag not equals 'B')
Input parameter cBulkGainLossTransaction is Blank
Or cBulkGainLossTransaction is NULL AND input parameter szReasonCode = "06" (=Disposition in L&D)
AND cFormatLocation flag is '1'
And not Blank Location
Then XT4111Z1 calls business function B4000310 - FormatLocationWithTemplate (F4100 Format Location With Template) because File Location and Display Location are different from each other as you have defined from Location Master (F4100).
Q5> What does format location function perform?
This function will convert the Display Format to File Format or File Format to Display Format. It also will validate the location with the F4100 and Convert it to parsed data depending on what is sent in cMode and cValidate.
Some parameters that will affect the output:
cMode
cMode 1 = will convert File Format to DisplayFormat.
cMode 2 = will convert Display Format to File Format and Change the Display format to have the correct number of spaces.
cValidate
cValidate = 1 will Validate the location with Location Master F4100
cValidate = 2 will Convert to Parsed Data (Asile, Bin, Location3 ...)
cValidate = 4 will do Neither.
Detail routines are:
Convert to File Format: Converts the Display to File format, remove the separators add spaces where needed.
Convert to Display Format: Changes the File format to Display format. Add separators and spaces etc.
Justify: Right or Left Justifys the String.
Convert To Parsed Data: Breakes the File location into its parts.(Aisle,Bin, Location03...).
If cSegmentControl is ON (where F41001.SCTL - Location Segment Control(Y/N) - Inv = Y) then it goes to routine CheckLocationMaster (B4000360)
Q6> How is the Primary Location defaulted?
Default to Primary Bin is handled as below:
If the location and lot number were passed in as blanks AND the processing option is set to default from a primary bin then retrieve primary location.
Blank (input) LOCN - Location, LOTN - Lot Number will be looked at first to see if it exist in F41021.
If it does not exist then a primary location will be retrieved.
as return value nDefaultLocnUsed flag is set to 1, so system can by-pass the lot number processing and do directly to F41021 record retrieval.
Q7> How is the lot number edited and validated?
Refer to E1: 41: Lot and Serial Number Control (Doc ID 642908.1). When non blank lot number is entered firstly it gets edited then it gets validated as below:
F4102.SRCE (Layer Code - Source) to indicate lot process type, which are 3 different groups,
Group 1 - Automatic lot/serial number assignment
1 Lot assignment is required. The system assigns numbers using the system date in YYMMDD format. Quantity can be greater than one.
2 Lot assignment is required. The system assigns numbers in ascending order using Next Numbers. Quantity can be greater than one.
5 Serial number assignment is required. The system assigns numbers using the system date in YYMMDD format. Quantity must not exceed one.
6 Serial number assignment is required. The system assigns numbers in ascending order using Next Numbers. Quantity must not exceed one.
Group 2 - Lot or serial number requirement checking ON
3 Lot assignment is required. You must manually assign numbers. Quantity can be greater than one.
7 Serial number assignment is required. You must manually assign numbers. Quantity must not exceed one.
Group 3 - Do not edit as it is optional
0 Lot assignment is optional. You can manually assign numbers. Quantity can be greater than one. (Default)
4 Serial number assignment is optional except during shipment confirmation. Quantity must not exceed one.
Note: Refer to <Document 1348247.1> - E1: 40: System Assigned Lot Number Format per Process Type (F4102.SRCE) for Lot Number assignment
Q8> When does a new lot number get added?
Case (F4102.SRCE IN (1, 2, 5, 6)
Input Lot Number is Blank
Not R41413 - Cycle Count
Input parameter of cLotProcessIndicator = 1 (Lot/serial number editing ON)
F41001.OT6Y (Inventory Lot Creation Y/N) = Y
Then call bsfn X41LOT - AssignLotNumber (F0002 Get Next Lot Number) to assign lot number
Case (F4102.SRCE IN (3, 7)
Input Lot Number is Blank
Not R41413 - Cycle Count
Input parameter of cLotProcessIndicator = 1 (Lot/serial number editing ON)
Input parameter of cSerialNumberProcess = 1
No default from primary location
then issue error 2745 - "Lot/Serial Number Must be Entered"
Case (F4102.SRCE IN (0, 4)
Do not validate
Case (R41413 - Cycle Count)
Cycle count update should not create a new lot number as cycle count is a process of counting the existing inventory
mnTransactionQuantity is not zero
F4102.SRCE IN (1, 2, 3, 5, 6, 7)
nDefaultLocnUsed = 0
then set error 2745 - "Lot/Serial Number Must be Entered"
Q9> What is detail Lot Data verification?
Verify Lot Potency, Lot Grade, Expiration Date through B4100300 - LotProcessing (Lots, Verify Lot Information) and VerifyLotDateRanges (Verify Lot Date Ranges).
Q10> How does quantity data get from F41021?
Item Location Quantity Unload (based on quantity accumulated) based on F41021 - Item Location:
If input parameter cDefaultLocationLotFromPrimary = 1 and Location and Lot are Blank then get information from F41021 based on ITM, MCU, LOTN, LOTN combination
Otherwise get data from F41021 based on ITM, MCU, PBIN (Primary Location (P/S)) = 'P'
Only when cDefaultLocationLotFromPrimary = 1 assign output location = F41021.LOCN and Lot Number = F41021.LOTN
Q11> When does CFGSID gets assigned/updated?
To Side Transaction:
F4101.STKT (Stocking Type) = C (Configured Item)
Lot or serial number requirement checking ON (Input parameter of cLotProcessIndicator)
To Side Transfer (in P4113)
Then based on from side CFGSID assign it to To Side CFGSID
From Side transaction:
F4101.STKT (Stocking Type) = C (Configured Item)
Lot or serial number requirement checking ON (Input parameter of cLotProcessIndicator)
Only when P31114 - Work Order Completion
Then assign CFGSID based on input parameter
Note:
The CFGSID is assigned during Sales Order Entry (P4210/P3210) or WO entry (P48013/P3210).
The CFGSID will be updated into the F41021 item location from the WO completion based on the order entered.
Q12> How does Lot Information default?
In validating lot, internally:
Get Lot Default value
Assign Lot Status
Check Lot duplication
If Lot Expiration Date is blank and Shelf Life Days is not zero calculate the LotExpirationDate based on Shelf Life Days.
Note: PrimaryLotNumber will be blank if the DefaultFromPrimary Location flag is turned off. PrimaryLotNumber is retrieved from Item Location record if the DefaultFromPrimary is turned on.
Parameter cDefaultFromLotMaster is defined as below:
0 = Retrieve F4108 with primary Lot Number.
1 = Retrieve F4108 with Lot Number passed in.
2 = Retrieve F4108 with Lot Number passed in first. If record is not found, then retrieve F4108 with Primary Lot Number if not blank.
And parameter cExpirationDateEditMode is defined:
0 = No expiration date retrieval or validation.
1 = Return F4108.mmej if it is not blank, else return calculated date using shelf life days. Set an error if expiration date is blank.
2 = Return F4108.mmej.
Then call B4100540 - LoadLotExpirationDateAndDefaults (F4108 Get Lot Expiration Date)
If the Lot exist already in Lot Master (F4108), the Expiration Date, Grade, Potency, Lot Description, Memo Lot 1, Memo Lot2, must be passed back. They cannot be override by the user.
To change those objects, user must use Lot Master Revision Application (P4108) to make the changes.
Except for Lot Status, this only the location change only.
A. cLotStatusCode = F4108.lots B. jdExpirationDate = F4108.MMEJ C. If jdOnHandDate is NULL then jdOnHandDate = jdTransactionDate D. If jdBasedOnDate is NULL then jdBasedOnDate = jdOnHandDate E. To get jdLotEffectivityDate
If input jdLotEffectivityDate is NULL then compuate it as below:
1st, Set special handling code:
nTransaction = 9, 10 or 11 then 'M'
nTransaction = 5 or 15 then 'P'
otherwise get it based on stocking type from UDC 41/I by reading the 1st character of Description 02
2nd, Compute mnEffectiveDays
When special handling code flag is 'M'
If F4102.LEDD (Lot Effective Default Days) is greater than 36500 mnEffectiveDays = 36500 (which is max value) Else mnEffectiveDays = F4102.LEDD (represented as Manufacturing Effective Days) End if
When special handling code flag is 'P'
If F4102.PEFD (Purchasing Effective Days) is greater than 36500 mnEffectiveDays = 36500 (which is max value) Else mnEffectiveDays = F4102.PEFD End if
If it fails to get data from F4102 get it from F4101 and repeat above routine
If input jdLotEffectivityDate is NOT NULL and jdLotEffectivityDate > jdOnHandDate: Error "492F - "Effective Date less than On Hand Date"
F. jdExpirationDate
If input mnShelfLifeDays > 36500 (100 years) mnEffectiveDays = 36500 Else mnEffectiveDays = mnShelfLifeDays End if
jdExpirationDate = mnEffectiveDays + jdBasedOnDate (when Vertical Feature of CPGLC is on from UDC 40/VF)
jdExpirationDate = mnEffectiveDays + jdTransactionDate (no lot enhancement)
Only when lot enhancement is on then below date is to be computed.
G. jdSellByDate
if F4102.SBDD > mnLimitedShelfLife (=36500 which is hard coded value for 10 years of shelf life days) mnEffectiveDays = 36500 Else mnEffectiveDays = F4102.SBDD End If
when F4102.sbdd > = 0, jdSellByDate = mnEffectiveDays + jdBasedOnDate
when F4102.sbdd < 0, jdSellByDate = mnEffectiveDays + jdExpirationDate
H. jdBestBeforeDate
If F4102.bbdd > mnLimitedShelfLife mnEffectiveDays = 36500 Else mnEffectiveDays = F4102.BBDD End If
If F4102.BBDD > 0, jdBestBeforeDate = mnEffectiveDays + jdBasedOnDate
If above values are not found from F4102 then same computation will be performed based on F4101. Refer to <Document 1053082.1> E1: 34: Lot Effective Dates - Manufacturing and Purchasing Days.
Q13> Check Lot Duplication
F4009.ulot IN (N, n, 1, 3) then No Duplicated Lot is allowed
If Allow Duplicate Lots Flag is equal to 'N', '1' or '3', then Fetch all records of the same Lot Number passed in.
Validate that retrieved records must have the same Item Number and BranchPlant as passed in.
If either the Item Number or BranchpPlant from retrieved records is not equal to the Item Number or BranchPlant passed in, assign '1' to an Error Code and set the error message on.
ULOT = '1' or 'N' - Lot Number is unique only for Item and Branch
ULOT = '3' - Lot Number is unique only to Item and shared across Branch/Plant
Q14> Assign Lot Status (F41021)
Application by application they way it assigns parameter cLostSatusCode can be vary in calling BSFN F4111 Edit Line. Depends on this parameter,
If input cLotStatusCode = Blank or NULL
Adding item location on the fly (alon = 1) AND Existing lot then lots F41021.LOTS = F4108.LOTS
Non-transfer transaction AND Adding item branch on the fly (abrn = 1) then lots F41021.LOTS = F4101.LOTS
Non-transfer transaction AND Existing Item Branch then lots F41021.LOTS = F4102.LOTS
Existing Item Location then lots F41021.LOTS = F41021.LOTS
If input cLotStatusCode NOT Blank or NULL then input lots = LotStatus
And check input parameter cAllowHeldLotsEdit. If this value is not 1 then disallow lot status by issuing error "0959 - Item Balance on Lot Hold"
To discuss information further with Oracle experts and industry peers, we encourage you to review, join or start a discussion in the JDE1 Distribution Community.
To look at upcoming or archived Advisor Webcasts please see Advisor Webcast Details (Doc ID 548764.1) if your topic is not currently scheduled please suggest it.