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?

Table of Contents

Note:


 

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:

Section   Level Break Detail Data Action to Take Others
Level Break Header MCU01 by 99998   Initialize Cache (1)  
  Main   PL to CR     Add record to Cache (2)  
      CR to BX     Add record to Cache (2')  
      BX to EA     Add record to Cache (2'')  
Level Break Footer MCU01 by 99998   Verify Sequence Number (3)  
        Calculate CNV1 (4)  
        Commit Cache to Table(5)  
        (Terminate Cache (6)) this is performed by 5
Level Break Header MCU02 by 99999   Initialize Cache (1)  
  Main BX to PC     Add record to Cache (2)  
      PC to EA     Add record to Cache (2')  
Level Break Footer MCU02 by 99999   Verify Sequence Number (3)  
        Calculate CNV1 (4)  
        Commit Cache to Table(5)  
        Terminate Cache (6)  

Detail implementation:

Initialize Cache

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:

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.