LoadLotExpirationDateAndDefaults

Load Lot Expiration Date And Defaults

Minor Business Rule

Object Name: B4100540

Parent DLL: COPBASE

Location: Client/Server

Language: C

Functional Description
Purpose
This function will load the lot expiration date if zero from the shelf life days.  It will also 
default the lot description, grade, potency, and supplier lot number from the Lot Master (F4108) if blank


Setup Notes and Prerequisites

None

Special Logic

None

Technical Specifications

Related Tables 
Table Table Description
F4108Lot Master



2.3Related Business Functions

Source NameFunction Name
GetLotMasterByLotNumberB4000610

ConvertDateToJulianB9800210

ConvertJulianToDateB9800210

VerifyAndGetItemLocationXF41021



2.4Processing 


If   Default From Lot Number is '1', '2'

Call GetLotMasterByLotNumber(B4000610)
Short Item Number (ITM)<=Short Item Number
Branch/Plant (MCU)<=Branch/Plant

Lot Number (LOTN)<=Lot Number

Return Record<='1'

GENLNG=>Lot Master Record


If  Record is not Found
If  Suppress Error Message is not '1'

Issue an Error '3559'

Else

Call VerifyAndGetItemLocation (XF41021)

Short Item Number<=Short Item Number
Branch/Plant<=Branch/Plant

LocationO

Lot Number=>Primary Location Lot

Return Record<='0'

Suppress Error Msg<='1'

Index<='4'

Keys<='3'

End

End


End

If   ( Record is not in F4108 AND Primary Location Lot is not blank )
Call GetLotMasterByLotNumber(B4000610)
Short Item Number (ITM)<=Short Item Number
Branch/Plant (MCU)<=Branch/Plant

Lot Number (LOTN)<=Primary Location Lot
Return Record<='1'

GENLNG=>Lot Master Record

End


//  Load the following fields if blanks from the GENLNG retrieved
If  Lots is Blank

Move LOTS (From Lot Master) into Lot Status Code ( LOTS)

If Lot Description equals blanks

Move LDSC(From Lot Master)  into Lot Description (LDSC)

If Lot Grade equals blanks

Move LOTG(From Lot Master) into Lot Grade (LOTG)

If Lot Potency equals blanks

Move LOTP(From Lot Master) into Lot Potency (LOTP)

If Supplier Lot Number equals blanks

Move RLOT(From Lot Master) into Supplier Lot Number (RLOT)

If Memo Lot Edit = '1' AND Memo Lot 1 passed in is Blanks

Memo Lot 1 passed in = F4108::LOT1

Else

If  F4108::LOT1 is not blank
Memo Lot 1  passed in = F4108::LOT1

End

End

If  Memo Lot Edit = '1' AND Memo Lot 2 passed in is Blanks

Memo Lot 2  passed in = F4108::LOT2

Else

If  F4108::LOT2 is not blank

Memo Lot 2  passed in = F4108::LOT2

End

End

If  Memo Lot Edit = '1' AND Memo Lot 3 passed in is Blanks

Memo Lot 3  passed in = F4108::LOT3

Else
If  F4108::LOT3 is not blank

Memo Lot 3  passed in = F4108::LOT3

End

End


If  Expiration Date Edit Mode = '1' AND Expiration Date passed in is Blanks
Expiration Date   passed in = F4108::MMEJ

Else

If  F4108::MMEJ  is not blank

Expiration Date  passed in = F4108::MMEJ

End

End


//  This will calculate the lot expiration date based on the shelf life days from the Item Branch.  
Will need to roll over into the correct year.


If Lot Expiration Date equals zeros  AND Expiration Date Edit Mode equals '1'

AND Shelf Life Days (SLD) greater than zero

call ConvertDateToJulian(...) with TransactionDate as the parameter.

Add SLD to the returned Julian Date.

Call ConvertJulianToDate(..) with the added Julian Date as the 

parameter.

Move Converted Date  to Lot Expiration Date (in MMDDYYYY format)


//  Issue an error if the lot expiration date equals zero and the shelf life days does not


If Lot Expiration Date equals zero 

AND Shelf Life Days not equal zero

AND From Side of Transfer not equal '1'

Issue Error '0004


If  Lot Expiration Edit Mode equals '1' and Lot Expiration Date equals zero
Issue Error '0004' 

// Check to see if the Memo lot fields are required


If Memo Lot 1 (LOT1) equals blanks AND SRNR GE '4' AND SRNR LE '5'

If SRCE EQ '1' OR '2' OR '3' OR '5' OR '6' OR '7' AND EV02 (Default from Primary) 
NE '1' OR LOTN NE blanks

Set on Error '4773' and highlight the LOT1 field

end

end


If Memo Lot 2 (LOT2) equals blanks AND SRNR EQ '5'

If SRCE EQ '1' OR '2' OR '3' OR '5' OR '6' OR '7' AND EV02 (Default from Primary) 
NE '1' OR LOTN NE blanks

Set on Error '4773' and highlight the LOT2 field

end

end




^

Data Structure

D4100540 - Load Lot Expiration Date And Defaults

Parameters:
Data Item Data Structure DescriptionI/ORequired
ITMShortItemNumberIY

MCUBranchPlantIY

LOTNLotNumberIY

LOTGLotGradeI/ON

LOTPLotPotencyI/ON

LDSCLotDescriptionI/ON

LOTSLotStatusCodeON

MMEJExpirationDateI/ON

RLOTSupplierLotNumberI/ON

SLDShelfLifeDaysIN

EV01FromSideOfTransferIN

TRDJTransactionDateIN

EV02DefaultFromLotMasterIN

EV01SuppressErrorMsgIN

SRCELotProcessTypeIN

SRNRSerialNumberRequiredIN

LOT1MemoLot1IN

LOT2MemoLot2IN

LOT3MemoLot3IN

EV03ExpirationDateEditModeIN

EV05MemoLotEditModeIN

LOTNPrimaryLocationLotIN



^

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

szBranchPlantMCUcharNONENONE

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.

szLotNumberLOTNcharNONENONE

A number that identifies a lot or a serial number. A lot is a group of items with similar characteristics.

szLotGradeLOTGcharNONENONE

A code that indicates the grade of a lot. The grade is used to indicate the quality of the lot. Examples include the following:    A1   Premium 
grade    A2   Secondary grade  The grade for a lot is stored in the Lot Master table (F4108).

mnLotPotencyLOTPMATH_NUMERICNONENONE

A code that indicates the potency of the lot expressed as a percentage of active or useful material (for example, the percentage of alcohol 
in a solution). The actual potency of a lot is defined in the Lot Master table (F4108).

szLotDescriptionLDSCcharNONENONE

A brief description of a specific lot.

cLotStatusCodeLOTScharNONENONE

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.

jdExpirationDateMMEJJDEDATENONENONE

The date on which a lot of items expires. The system automatically enters this date if you have specified the shelf life days for the item on 
Item Master Information or Item Branch/Plant Information. The system calculates the expiration date by adding the number of shelf life days to 
the date that you receive the item. You can commit inventory based on the lot expiration date for items. You choose how the system commits 
inventory for an item on Item Master Information or Item Branch/Plant Information.

szSupplierLotNumberRLOTcharNONENONE

The supplier's lot number for the item.

mnShelfLifeDaysSLDMATH_NUMERICNONENONE

The number of days that an item can remain in inventory before it expires. The system adds this number to the date that the item is received 
to determine the expiration date for the item. If you do not enter a value here, you must enter an expiration date each time you receive the lot 
item.

cFromSideOfTransferEV01charNONENONE

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

jdTransactionDateTRDJJDEDATENONENONE

The date that an order was entered into the system. This date determines which effective level the system uses for inventory pricing.

cDefaultFromLotMasterEV02charNONENONE

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

cSuppressErrorMsgEV01charNONENONE

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

cLotProcessTypeSRCEcharNONENONE

A code that indicates whether lot or serial number is assigned. Lot and serial number processes use the Lot Master table (F4108). Valid 
codes are:    0   Lot assignment is optional. You can manually assign numbers. Quantity can be greater than one. (Default)    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.    3   Lot assignment is 
required. You must manually assign numbers. Quantity can be greater than one.    4   Serial number assignment is optional except during shipment 
confirmation. Quantity must not exceed 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.    7   Serial number assignment is required. You must manually assign numbers. 
Quantity must not exceed one.

cSerialNumberRequiredSRNRcharNONENONE

A code that specifies whether you must attach a serial number to this item at receipt or sale for basic serial number processing, or whether 
memo lot information is required for advanced serial number processing. Advanced serial number processing allows you to use a serial 
number to track an item through purchasing and sales. For basic serial number processing, valid values are: Y Yes, the system requires a serial 
number for all transactions pertaining to this item in related inventory, sales, and purchase order programs. N No, the system does not require 
a serial number.  To specify lots for items with serial numbers, valid values are: 3 Supplier lot number is required (purchasing only). 4 Supplier 
lot number is required (purchasing only). Memo lot 1 is also required. 5 Supplier lot number is required (purchasing only). Memo lot 1 and 
memo lot 2 are also required. 6 Non-serialized item number (CSMS only). Values 3 through 5 specify whether lot assignment is required for items 
with serial numbers. You can require assignment of up to three lot numbers, including supplier lot, memo lot 1, and memo lot 2.

szMemoLot1LOT1charNONENONE

A higher classification or grouping of serial number or lot processed items,maintained within the Lot Master (F4108).

szMemoLot2LOT2charNONENONE

A higher classification or grouping of memo lot 1 maintained within the lot master (F4108).

szMemoLot3LOT3charNONENONE

A higher classification or grouping of memo lot 2 and memo lot 1 maintained within the lot master (F4108).

cExpirationDateEditModeEV03charNONENONE

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. 

cMemoLotEditModeEV05charNONENONE

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

szPrimaryLocationLotLOTNcharNONENONE

A number that identifies a lot or a serial number. A lot is a group of items with similar characteristics.

cInventoryLotCreationOT6YcharOPTNONE

A code that indicates whether the inventory transaction programs can create new lot or serial numbers in the system. If you leave this option 
blank, the system will not allow the inventory transaction programs to create new lot numbers in the system. If you check this option, the 
system allows the inventory transaction programs to create new lot numbers in the system.

cErrorCodeERRCcharOPTNONE

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

idF4102ItemBranchPtrGENLNGIDOPTNONE

General purpose ID variable.

mnTransactionTypeMATH01MATH_NUMERICOPTINPUT

- - - Good Performance Low Value. 

jdBasedOnDateBODJJDEDATEOPTBOTH

The date that the system uses in conjunction with the shelf life days to calculate the lot expiration date. You can enter this date during 
inventory completions. In addition to calculating the lot expiration date, the system uses the date that you enter in this field to calculate the following 
lot dates:   o Sell By Date   o Best Before Date   o Lot Effectivity Date   o User Lot Date 1   o User Lot Date 2   o User Lot Date 3   o User Lot Date 
4   o User Lot Date 5

jdOnHandDateOHDJJDEDATEOPTBOTH

The date when a lot is considered to be on hand in a branch/plant. The system determines the on-hand date by using the transaction date 
upon which the first inventory for a particular lot is determined to be on hand. The system automatically assigns this date to the Lot Master 
table (F4108).

jdLotEffectivityDateDLEJJDEDATEOPTBOTH

The date on which a lot becomes available. The system uses this date for availability and commitment processing to indicate that the lot is 
available on or after the date that you specify. You must complete this field when inventory first becomes an on-hand quantity for the lot. If you 
leave this field blank, the system calculates the effective date of the lot by using the value for Effective Days in the Item Branch File table 
(F4102) or the current date if the value for Effective Days is zero.

jdSellByDateSBDJJDEDATEOPTBOTH

The date by which a lot should be completely sold. The system uses this date as a "through" date for commitment processing. The system 
calculates the sell by date using the value in the Sell By Days field, which is contained in the Item Branch File table (F4102), when inventory 
becomes available on-hand.

jdBestBeforeDateBBDJJDEDATEOPTBOTH

The last date on which the products in a lot should be consumed. The system calculates the date by retrieving the value from the Best 
Before Days field in the Item Master program (P4101). You can also use this date as a "through" date for commitment processing. You can 
commit a lot by this date by using the Commitment Date Method field in the Item Branch program (P41026).

jdUserLotDate1U1DJJDEDATEOPTBOTH

A date that the system can use as a through date for commitment processing. The system stores this date in the Lot Master table (F4108). If 
you leave this field blank, the system can calculate the date by using the value for the User Lot Date 1 Default Days field, which is stored in 
the Item Branch File table (F4102).

jdUserLotDate2U2DJJDEDATEOPTBOTH

A user-defined date that can be used for commitment purposes and is stored in the Lot Master table (F4108). Similar to the Lot Expiration 
Date, User Lot Date 2 is a through date for commitment processing. The User Lot Date 2 commitment option is available in the Commitment 
Date Method in the Item Branch table (F4102). The system uses the User Lot Date 2 Default Days from the Item Branch table (F4102) to 
calculate User Lot Date 2 when inventory first goes on hand.

jdUserLotDate3U3DJJDEDATEOPTBOTH

A user-defined date that can be used for commitment purposes and is stored in the Lot Master table (F4108). Similar to Lot Expiration Date, 
User Lot Date 3 is a through date for commitment processing. The User Lot Date commitment option is available in the Commitment Date 
Method in the Item Branch table (F4102). The system uses the User Lot Date 3 Default Days from the Item Branch table (F4102) to calculate User 
Lot Date 3 when inventory first goes on hand.   

jdUserLotDate4U4DJJDEDATEOPTBOTH

A user-defined date that can be used for commitment purposes and is stored in the Lot Master table (F4108). Similar to Lot Expiration Date, 
User Lot Date 4 is a through date for commitment processing.   The User Lot Date commitment option is available in the Commitment Date 
Method in the Item Branch table (F4102). The system uses the User Lot Date 4 Default Days from the Item Branch table (F4102) to calculate 
User Lot Date 4 when inventory first goes on hand.

jdUserLotDate5U5DJJDEDATEOPTBOTH

A user-defined date that can be used for commitment purposes and is stored in the Lot Master table (F4108). Similar to Lot Expiration Date, 
User Lot Date 5 is a through date for commitment processing.   The User Lot Date 5 commitment option is available in the Commitment Date 
Method in the Item Branch table (F4102). The system uses the User Lot Date 5 Default Days from the Item Branch table (F4102) to calculate 
User Lot Date 5 when inventory first goes on hand.

cStockingTypeSTKTcharOPTNONE

A user defined code (41/I) that indicates how you stock an item, for example, as finished goods or as raw materials. The following stocking 
types are hard-coded and you should not change them:    0   Phantom item    B Bulk floor stock    C Configured item    E Emergency/corrective 
maintenance    F Feature    K Kit parent item    N Nonstock  The first character of Description 2 in the user defined code table indicates if the item 
is purchased (P) or manufactured (M).

mnSupplierNumberVENDMATH_NUMERICOPTNONE

The address book number of the preferred provider of this item.

Related Functions

B4000610 Get Lot Master By Lot Number
B4100210 Check Item Branch
B9800210 Convert From and To Julian Date from JDEDATE
XF41021 Update F41021 Locations

Related Tables

F4102 Item Branch File
F4108 Lot Master