How to Upload Multiple UOM Data with CNV1 into F41002
Purpose of Document
How to mass load the UOM (F41002) from spreadsheet with CNV1 (Conversion Factor - Secondary to Primary) based on data of MCU, ITM, UM, RUM, CONV, USTR?
In certain industry, you may have huge UOM Conversion data to convert whenever you develop a new products (commonly the conversion rate can be vary per branch/plant)
Or, in a certain business model, these data may come from outside with excel or flat file format
Copy option through P41002 requires huge amount of modification of data
This document assumed that you have existing settings for all Unit Of Measure you defined in F41003 (Unit of Measure standard conversion)
It is simple work to upload MCU, ITM, UM, RUM and CONV except CNV1
Columns to reference,
MCU (Business Unit): this column can be optional depending on the parameter "Unit of Measure Conversion by Branch (BUMC)" Flag in System Constant of you Branch/Plant constant setup. The way it gets read conversion rate is always most detail (F41002) to most generic (F41003)
ITM (Item Number - Short): Target table F41002 (Item Unit of Measure Conversion Factors). In case inbound data do not have this value, you may need to get it from F4101 (Item Master)
UM (Unit of Measure) which is used From UOM
RUM (Related Unit of Measure) which is To UOM
CONV (Conversion Factor) conversion factor defined in converting 'From UOM' to 'To UOM'
USTR (Unit of Measure Structure):-
A code that determines the hierarchy of items in containers or pallets. For example: Unit of Measure - 1 Pallet = 24 Cases - structure code 1 - 1 Case = 12 Interpacks - structure code 2 - 1 Interpack = 3 Boxes - structure code 3 - 1 Box = 6 Eaches - structure code 4 Assign structure code 1 to the largest unit of measure, with smaller units assigned to codes 2, 3, and 4. Given the above structure example, when one item is stored in the warehouse the location detail (F4602) would have a structure of: 1 Pallet/ with 24 Cases on the Pallet/ with 12 Interpacks in each Case/with 3 Boxes in each Interpack/ with 6 Eaches in each Box NOTE: It is not necessary to define your primary unit of measure within a structure. It always defaults in as the lowest level. Or, if you are changing the structure in a program, the system verifies that the primary is present in the structure and is the lowest level.
CNV1 (Conversion Factor - Secondary to Primary): this is the value you want to compute using exiting business functions.
Functional Requirement
1. Identify structured inbound data
Example of input data:
MCU
ITM
UM
RUM
USTR
CONV
MUC01
99998
BX
EA
3
2.0000000
MUC01
99998
CR
BX
2
468.0000000
MCU01
99998
PL
CR
1
48.0000000
MCU02
99999
PC
EA
2
4.0000000
MCU02
99999
BX
PC
1
5.0000000
2. Create a temporary table to store it as SQL format data
3. Create a custom report to compute CNV1 and insert into F41002 (Item Unit of Measure Conversion Factors)
Technical Specification for sample Batch Application:
1. Initialize Line Number which is to be used in Do Section event of Main Section in calling Add records to Cache VA rpt_mnLineNumber_LNID = "0"
2. Get Job Number (Any Next Number defined is fine because this is to make a unique cache)
X0010 - Get Next Number (X0010, X0010GetNextNumber) "00" -> BF szSystemCode "10" -> BF mnNextNumberingIndexNo *** Note that NN 00|2 is to be used in P41002 *** VA rpt_mnJobnumberA_JOBS <- BF mnNextNumber001
3. Initialize cache
Cache, Update Unit Of Measure (B4000980, CacheUpdateUnitOfMeasure) BC Business Unit (F55XXXXX)(MCU) -> BF szBranchPlant BC Item Number - Short (F55XXXXX)(ITM) -> BF mnShortItemNumber VA rpt_mnJobnumberA_JOBS -> BF mnJobNumber "6" -> BF cActionCode
Note:
Available cActionCode (Action Code)
1 = Add ('A', 'a')
2 = Update ('U', 'u', 'C', 'c')
3 = Delete ('D', 'd')
4 = Delete All
5 = Verify that "From" UOM is not used as the "TO" UOM
6 = Clear the cache and reload cache from F41002 directly Cache (this calls jdeCacheInit () and jdeCacheAdd () with Cache Name B4000980A-mnJobNumber
Add a record into Cache
4. (In reading converted data from F55XXXXX) Add a record into Cache 4-1. Assign USTR into following function to create cache for all detail lilnes. You can assign line number increment like 1, 2, 3 and so on. VA rpt_mnLineNumber_LNID = [BC Unit of Measure Structure (F55XXXXX)(USTR)] 4-2. Call Cache function
Cache, Update Unit Of Measure (B4000980, CacheUpdateUnitOfMeasure) BC Business Unit (F55XXXXX)(MCU) -> BF szBranchPlant BC Item Number - Short (F55XXXXX)(ITM) -> BF mnShortItemNumber BC Unit of Measure (F55XXXXX)(UM) -> BF szFromUOM BC Related Unit of Measure (F55XXXXX)(RUM) -> BF szToUOM BC Conversion Factor (F55XXXXX)(CONV) -> BF mnConversionFactorFromtoTo VA rpt_mnJobnumberA_JOBS -> BF mnJobNumber *** This is to add a record into cache created in step 3 *** VA rpt_mnLineNumber_LNID -> BF mnLineNumber "2" -> BF cActionCode VA evt_szErrorMsgID_DTAI <- BF szErrorMessageID VA rpt_cErrorCode_ERRC <- BF cErrorCode BC Unit of Measure Structure (F55XXXXX)(USTR) -> BF cUOMStructureCode
Note: It is calling same business functions with different cActionCode.
Verify Sequence Number
5. Verify Sequence Number (Level Break Footer Section so PC column is assigned) : Verify the Sequence Number for a group and realign if not sequenced properly
Verify UOM Sequence Numbers (B4000980, VerifyUOMSequenceNumbers) VA rpt_mnJobnumberA_JOBS -> BF mnJobNumber PC Business Unit (F55XXXXX)(MCU) -> BF szBranchPlant PC Item Number - Short (F55XXXXX)(ITM) -> BF mnShortItemNo
Calculate CNV1
6. Calculate CNV1 (Conversion Rate to Primary UOM) 6.1. Get Primary UOM from Item Master
F4101 Get Item Master Information (B4001040, GetItemMasterDescUOM) PC Item Number - Short (F55XXXXX)(ITM) -> BF mnShortItemNumber VA evt_szUnitOfMeasurePrim_UOM1 <- BF szPrimaryUOM
6.2. Calcuate CNV1
Cache, Calculate Coversion Factor (B4000980, CacheCalculateConversionFactor) VA rpt_mnJobnumberA_JOBS -> BF mnJobNumber PC Business Unit (F55XXXXX)(MCU) -> BF szBranchPlant PC Item Number - Short (F55XXXXX)(ITM) -> BF mnShortItemNumber VA evt_szUnitOfMeasurePrim_UOM1 -> BF szPrimaryUOM VA evt_szErrorMsgID_DTAI <- BF szErrorMessageID VA rpt_cErrorCode_ERRC <- BF cErrorCode
Commit Cache to F41002
7. Commit Cache to Table
Cache, Update F41002 UOM (B4000980, CacheUpdateF41002UOM) VA rpt_mnJobnumberA_JOBS -> BF mnJobNumber PC Business Unit (F55XXXXX)(MCU) -> BF szBranchPlant PC Item Number - Short (F55XXXXX)(ITM) -> BF mnShortItemNumber VA evt_szErrorMsgID_DTAI <- BF szErrorMessageID VA rpt_cErrorCode_ERRC <- BF cErrorCode VA rpt_szProgramId_PID -> BF szProgramID
Note that this function does not return the value computed, which you can verify by opening table F41002.