How to Record Zero Balance Adjustment

Purpose of Document

This note is to explain possible way to implement ZBA (Zero Balance Adjustment) through Report Design Aid.

DISCLAIMER
The following is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle's products remains at the sole discretion of Oracle.

Through this note,

Business Scenario:
Possibly, enter purchase order with quantity of 504,000 GM at purchase unit price of $1438.0531, which computes extended price of 724,778.76 (= $1438.0531 x 504000 / 1000) where Transaction UOM is equal to GM (same as primary) whereas Purchasing UOM is equal to KG
Through P4116 (Inventory Reclassification), transfer good received above to another branch plant with quantity 504,000 at $1.4381 (=724,802.40), which cause outstanding amount of $23.64 where quantity is zero.
[As - Is Transaction in F4111 - Cardex]

2nd Item Number Business Unit Trans UM Transaction Explanation Reason Code Trans QTY Unit Cost Extended Cost/Price Program ID
ZBAITEM M30 GM Inventory Receipt 504,000 1.4381 724,778.76 EP4312
ZBAITEM M30 GM Reclassification -504,000 1.4381 -724,802.40 EP4116

: Outstanding balance 23.64 contribute average cost change


Considerations:


Related transaction file master business function:
X4114Z1 handled transaction as below,

Function Name Description Template Name Usage
F4114BeginDocument F4114 Begin Document DXT4114Z1B This function is used by Inventory Adjustments and Inventory Issues and is used to edit subledger and subledger type fields and the From Branch of an Inventory Transfer.
F4114EditLine F4114 Edit Line DXT4114Z1C This function is called for an Inventory Adjustment or an Inventory Issue. Inventory Issues has edits very specific to it, specifically involving the Transaction Reference field (TREF). F4111EditLine is called to perform the majority of the edits. This function will edit fields that are specific to a transaction for correct information; all UDC edits are performed. Records will be written to the detail work file (F41UI001) if no errors are found. If a record already exists in the work file, the record will be retrieved and updated with the changes.
F4114EndDocument F4114 End Document DXT4114Z1E This function calls F4111EndDoc to process records to be written to the database for an Inventory Adjustment or an Inventory Issue. The F0911EndDoc and F0911SummarizeDoc are called from this function. This function is called from F4111EndDoc(XT4111Z1) and passes the GENLNG for each stacked record.
F4114ClearDetailStack F4114 Clear Detail Stack DXT4114Z1I Clean up call stacks. This can be called independantly or through end doc routine


Relationships:
XT4114Z1

: Review relationship among master business functions

After transaction:

2nd Item Number Business Unit Trans UM Transaction Explanation Reason Code Trans QTY Unit Cost Extended Cost/Price Program ID
ZBAITEM M30 GM Inventory Receipt 504000 1.4381 724,778.76 EP4312
ZBAITEM M30 GM Reclassification -504000 1.4381 -724,802.40 EP4116
ZBAITEM M30 GM Zero Balance Adjustment - GL RND 0 23.64 R59ZBA

Doc Co Do Ty Document Number G/L Date JE Line Number Batch Number Bth Ty Account Number Cur Cod Amount Explanation Alpha Name Explanation -Remark- Program ID
00200 IA 298 19-02-12 1 26561 N 200.1411 USD 23.64 Zero Balance Adjustment - GL ZBAITEM R59ZBA
00200 IA 298 19-02-12 2 26561 N M10.6310 USD 23.64- Zero Balance Adjustment - GL ZBAITEM R59ZBA




Detail Implementation:
This is just an example, so try to understand this as how EnterpriseOne handled transactional cache. If possible, capture callobject kernel log (namely jdedebug.log) and analyze it
1. Go to OMW (Object Management Workbench)
2. Add a report
3. Create section using a business view (for instance, V4111B - Item Ledger Detail)
4. Set Sequence by LITM, MCU, LOCN and LOTN and set Level Break for same sequence. This is to summarize quantity (F4111.TRQT) and amount (F4111.PAID) at level break footer
5. Create Level Break Footer and Aggregate for columns F4111.TRQT (QuantityTransaction) and F4111.PAID (AmtExtendedCost)
6. Define variables to handle among master business functions (for this implemenation below variables are defined) as below,


*** Continued ... ***
SECTION: On Lot/SN [GROUP SECTION] ()
EVENT: Initialize Section

7. Call B9800181 - GetLocalComputerId as below,
Get Local Computer ID
VA rpt_szComputerID_CTID <- BF szMachineKey *** Now machine ID of client is returned, which is to be used in Edit Line and End Doc routine ***
: Put this event where it gets called only once

EVENT: Do Section

8. Assign Previous Columns to Report Variable to print out (in case you do not need any output this step is not needed)
RV 2nd Item Number = PC 2nd Item Number (F4111)(LITM)
RV Business Unit = PC Business Unit (F4111)(MCU)
RV Location = PC Location (F4111)(LOCN)
RV Lot/SN = PC Lot/Serial Number (F4111)(LOTN)

9. Compute Amount to Adjust by multiplying (-1) to zero Total Amount
RV mnAmtToAdj = [RV Summary_Extended Cost/Price]*-1

10. (Optional) call B4100730 - AccumulateItemQuantities (F41021 Get Item Quantities) per level you want to segregate. Now you can compare on hand quantity from F41021 (Item Location File) with Total F4111.TRQT

11. Step 5 has aggregated quantity and amount so now we can use it to determine whether to proceed transaction or not. Handle data only when total quantity is zero BUT total amount is not zero

If RV Transaction Quantity is equal to <Zero> And RV Summary_Extended Cost/Price is not equal to <Zero>

12. Assign document depends on variance returned (e.g., Negative then need to write positive amount which is equivalent to Inventory adjustment)

If RV Summary_Extended Cost/Price is greater than <Zero>
VA sec_szDocumentType_DCT = "II"
Else
VA sec_szDocumentType_DCT = "IA"
End If

13. Set Explanation for Inventory Transaction (i.e., how to F4111.TREX gets written). For this example, this value is to be overriden by Explanation Code for GL

VA sec_szExplanation_DL01 = "Zero Blance Adjustment - Custom"

14. Call XT4114Z1 - F4114BeginDocument (F4114 Begin Document)
F4114 Begin Document
: Below table is to show how the value is assigned/returned based on data structure DXT4114Z1B : F4114 Begin Document - Functional Server

Structure Member Name Type Alias Req Parameter I/O Used for
cDocumentAction JCHAR ACTN
szComputerID[16] JCHAR CTID VA rpt_szComputerID_CTID I Based on returned value in Step 7
cErrorConditions JCHAR EV02 VA sec_cBeginDocError_EV01 O Return value of Begin Doc routine
0 = No Error
1 = Error
szBranchPlant[13] JCHAR MCU RV Business Unit I Branch/plant information F4111.MCU since this routine is at level break footer PC value is used
mnBatchNumber mn ICU
jdBatchDate JDEDATE DICJ VA sec_jdDateBatch_DICJ O To get batch date from this routine
mnLastJELineNumber mn JELN VA sec_mnJELineNo_JELN O This value will be always 0 because a new document gets created
szDocumentKeyCompany[6] JCHAR KCO VA sec_szCompanyKeyOr_KCOO O KCO value based on MCU above
szDocumentType[3] JCHAR DCT VA sec_szDocumentType_DCT I Document type hard coded in Step 12
mnDocumentNumber mn DOC
jdGLDate JDEDATE DGL VA sec_jdDtGLAndVouch1_DGL I/O Either set specific GL date and validate or let this routine returns today's date
jdTransactionDate JDEDATE TRDJ VA sec_jdDateTransa_TRDJ I/O Either set specific date or return system date
szGLExplanation[31] JCHAR DL01 VA sec_szExplanation_DL01 I To set F4111.TREX




15. Check whether Begin Doc returns error (then exit from routine) else continue to call Edit Line which validates/creates cache for Inventory (F41UI001) and GL (I09UI002, I09UI003)

If VA sec_cBeginDocError_EV01 is not equal to "1"

16. Set flag for cWriteWorkFile, TREX, TRNO, FRTO and TRUM (explanation in detail parameter)


VA sec_cWriteWorkFile_EV01 = " "
VA sec_szExpla_TREX = "Zero Balance Adjustment - GL"
VA sec_mnTransactionLineNr_TRNO = "1.000"
If RV Summary_Extended Cost/Price is greater than <Zero> *** Positive amount then target amount is negative ***
VA sec_cFromTo_FRTO = "F"
Else
VA sec_cFromTo_FRTO = "T"
End If
VA sec_szUnitOfMeTransact_TRUM = PC Unit of Measure - Transaction (F4111)(TRUM)

17. Call XT4114Z1 - F4114EditLine (F4114 Edit Line). For this example, Edit Line gets called only once. In case you need to create multiple inventory cache you need to check change of company, document type and call Edit Line routine for each rows. Note below are shown only parameters assigned. So reveiw Edit Line routine if needed, you can populate more parameters.

F4114 Edit Line
: Below table shows parameters mapped based on Data Structure: DXT4114Z1C : F4114 Edit Line - Functional Server

Structure Member Name Type Alias Req Parameter I/O Used for
cLineAction JCHAR ACTN
szComputerID[16] JCHAR CTID VA rpt_szComputerID_CTID I Same machine name returned from Step 7 this is important to have unique cache for both Inventory and GL
cErrorConditions JCHAR EV03 VA sec_cEditLineError_EV02 O To check whether Edit Line routine contains error or not
0 = SUCCESS
1 = FAIL
cRecordWrittenToWorkFile JCHAR EV04 VA sec_cWriteWorkFile_EV01 I Hard code with a space because it does not unitilize Work File in this routine
mnLineNumber mn LNID VA sec_mnOrderLineNumber_LNID I/O 1.000 because a single row record is to be created into F4111
jdGLDate JDEDATE DGL VA sec_jdDtGLAndVouch1_DGL I/O GL Date validated/returned from Begin Doc
szGLExplanation[31] JCHAR DSC1 VA sec_szExpla_TREX I Any meaningful description to write TREX column
cUpdateQuantityOnHand JCHAR EV01 <Zero> I Hard Code: Not to update On Hand Quantity
cSuppressErrorMessage JCHAR EV01
cAllowQtyOverAvailable JCHAR EV01 <Zero> I Hard Code: No quantity is involved
mnParentShortItemNumber mn KIT
szAccountNumber[30] JCHAR ANI
szSubledger[9] JCHAR SBL
cSubledgerType JCHAR SBLT
szPhase[5] JCHAR WR01
szAssetID[27] JCHAR ASII
mnPreviousLinenumber mn LNID VA sec_mnPrevLine_LNI I/O Previous line number for G/L so this is to be 0.0000
szAgreementNumber[13] JCHAR DMCT
mnAgreementSupplement mn DMCS
cContractBalancesUpdate JCHAR BALU
mnAgreementSequence mn LDSQ
mnTransactionLineNumber mn TRNO VA sec_mnTransactionLineNr_TRNO I Hard Code: 1.000 the first row into F4111
cFromTo JCHAR FRTO VA sec_cFromTo_FRTO I
  • F (From) when you need to write Negative
  • T (To) when you need to write Positive
szParentLotNumber[31] JCHAR PLOT
mnLastJELine mn JELN VA sec_mnJELineNo_JELN I/O For this example, only 1 and 2
cDefaultFromPrimaryLocation JCHAR EV01
cAllowHeldLots JCHAR EV01 1 I Hard Code: 1 - to create even for Held Lots
jdTransactionDate JDEDATE TRDJ VA sec_jdDateTransa_TRDJ I/O Date returned from Begin Doc
szDocumentType[3] JCHAR DCT VA sec_szDocumentType_DCT I Depends upon sign of value either 'IA' or 'II'
jdBatchDate JDEDATE DICJ VA sec_jdDateBatch_DICJ I Date returned by Begin Doc
mnBatchNumber mn ICU VA sec_mnBatchNumber_ICU I/O This routine creates batch header so unique batch number is to be assigned
cBatchStatus JCHAR IST VA sec_cBatchStatus_IST I/O Based on Batch Status in Begin Doc and assign it and let it validated
szBranchPlant[13] JCHAR MCU RV Business Unit I/O F4111.MCU, for this example, PC column value because this routine is runnning in level break footer section
szItemNumber[27] JCHAR UITM RV 2nd Item Number I/O F4111.LITM same with above
mnShortItemNumber mn ITM
szDisplayedLocation[21] JCHAR LOCNE1
szLocation[21] JCHAR LOCN RV Location I/O Same with above
szLotNumber[31] JCHAR LOTN RV Lot/SN I/O Same with above
szTransactionUOM[3] JCHAR TRUM VA sec_szUnitOfMeTransact_TRUM I F4111.TRUM same with above
mnTransactionQty mn TRQT <Zero> I Hard Code: <Zero> because this note is for ZBA - Zero Balance Adjustment
mnTransactionUnitCost mn UNCS <Zero> I Hard Code: <Zero>
mnExtendedAmount mn PAID RV mnAmtToAdj I/O Actual amount to adjust
mnTransactionProcessType mn MATH01 2.00 I Refer below table Valid value for nTransaction (=mnTransactionProcessType)
mnLotPotency mn LOTP
szLotGrade[4] JCHAR LOTG
cLotStatusCode JCHAR LOTS
jdLotExpirationDate JDEDATE MMEJ
mnDocumentNumber mn DOC
szSupplierLotNumber[31] JCHAR RLOT
szLotDescription[31] JCHAR LDSC
szReasonCode[4] JCHAR RCD RND I Optional to choose proper reason code to write F4111.RCD
mnCycleCountNumber mn CYNO
mnTagNumber mn TGG
cGetNextCountDate JCHAR EV01
mnF0911JobNumber mn JOBS VA sec_mnJobnumberA_F0911_JOBS I/O To return Job Number for GL, this is to be used in End Doc
szKeyCompany[6] JCHAR KCO VA sec_szCompanyKeyOr_KCOO I/O A specific document company in writting F0911 from Begin Doc based on F4111.MCU
cStockingType JCHAR STKT
mnInvJobNumber mn JOBS VA rpt_mnJobnumberA_JOBS I/O To return Job Number for Inventory Transaction (F4111) this is to be used in End Doc
szMemoLot1[31] JCHAR LOT1
szMemoLot2[31] JCHAR LOT2
szMemoLot3[31] JCHAR LOT3
cCostEntered JCHAR ENTC <Zero> I Hard code <Zero> to indicate there is no cost override
mnWMSLineNumber mn MATH02
cAgreementSearchMethod JCHAR EV01
cMultipleAgreementFound JCHAR EV05
cProcessJE JCHAR EV01 1 I Hard Code '1' to Process G/L Cache through F4111EditLine routine
szGLMBFVersion[11] JCHAR TREF
szTransactionReference[9] JCHAR VER
mnSecondaryQty mn SQOR
szSecondaryUOM[3] JCHAR UOM2
cDualCycleCountGLOffset JCHAR EV01
jdBasedOnDate JDEDATE BODJ
jdOnHandDate JDEDATE OHDJ
jdLotEffectivityDate JDEDATE DLEJ
jdSellByDate JDEDATE SBDJ
jdBestBeforeDate JDEDATE BBDJ
jdUserLotDate1 JDEDATE U1DJ
jdUserLotDate2 JDEDATE U2DJ
jdUserLotDate3 JDEDATE U3DJ
jdUserLotDate4 JDEDATE U4DJ
jdUserLotDate5 JDEDATE U5DJ
szUniqueConfigurationID[33] JCHAR CFGSID
szLotGroup[31] JCHAR LOTGRP
szFromLicensePlateNumber[41] JCHAR LPNU
cLocationInCache JCHAR MODE



Valid value for nTransaction (=mnTransactionProcessType)
nTransaction Application Description
1 P4112 Inventory Issue
2 P4114 Inventory Adjustment
To have full list refer to <Document 1276239.1> - E1: 41: Inventory Transaction MBF XT4111Z1 Clarification


18. Continue to commit cache to tables (F4111, F0911 and so on) if Edit Line did not return Error

If VA sec_cEditLineError_EV02 is not equal to "1"

19. Call XT4114Z1 - F4114EndDocument (F4114 End Document) to commit cache created through Edit Line routine

F4114 End Document
: Below table is to show actual parameter mapped based on data structure DXT4114Z1E : F4114 End Document - Functional Server

Structure Member Name Type Alias Req Parameter I/O Used for
szProgramID[11] JCHAR PID "R59ZBA" I This is important to indicate the record is written through custom routine this value affects F4111.PID and F0911.PID
mnDocumentNumber mn DOC
szComputerID[16] JCHAR CTID VA rpt_szComputerID_CTID I Same machine ID returned through step 7 in accessing cache this is to be used as handle
cWriteCardex JCHAR EV01 1 I Hard Code: to write F4111 baesd on cache created in Edit Line routine
cDeleteCycleOrTag JCHAR EV01
szDocumentType[3] JCHAR DCT VA sec_szDocumentType_DCT I Document type assigned in Edit Line routine either II - Inventory Issue or IA - Inventory Adjustment
mnTransactionProcessType mn MATH01 2.00 I 1 for Inventory Issue for negative amount and 2 for Inventory Adjustment for positive value population
mnF0911Jobnumber mn JOBS VA sec_mnJobnumberA_F0911_JOBS I GL Job Number from Edit Line routine
mnBatchNumber mn ICU VA sec_mnBatchNumber_ICU I Batch Number created through Edit Line routine to close batch
cUpdateSalesHistory JCHAR EV01
cBatchStatus JCHAR IST VA sec_cBatchStatus_IST I Batch Status returned from Edit Line
cProcessCloseBatch JCHAR EV01 1 I Hard Code: 1 to close batch which update status 'A - Approved
cSummarizeF0911 JCHAR EV01
mnInvJobNumber mn JOBS VA rpt_mnJobnumberA_JOBS I Inventory Cache Job Number returned from Edit Line
szEDITransactionType[9] JCHAR TYTN


End If
End If

20. (Optional) call XT4114Z1 - F4114ClearDetailStack (F4114 Clear Detail Stack) based on Job Number returned from Edit Line. In case a certain transation has to be cancelled in a certain routine this function shall delete all caches created

F4114 Clear Detail Stack
: Below table is to show actual parameter mapped through data structure XT4114Z1 Clear Detail Stack - Functional Server

Structure Member Name Type Alias Req Parameter I/O Used for
szComputerID[16] JCHAR CTID VA rpt_szComputerID_CTID I Same machine ID returned by Step 7
mnFromLineNumber mn LNID
mnThruLineNumber mn LNID
cDeleteHeader JCHAR EV01 1 I To delete Inventory cache
cDeleteDetail JCHAR EV01 1 I To delete GL Cache
szDocumentType[3] JCHAR DCT VA sec_szDocumentType_DCT I Optional: Assigned Document Type
cProcessCloseBatch JCHAR EV01 1 I Optional: because End Doc routine will close batch
mnBatchNumber mn ICU VA sec_mnBatchNumber_ICU I Batch Number in case you have set cProcessCloseBatch
cBatchStatus JCHAR IST VA sec_cBatchStatus_IST I Batch Status returned from Edit Line
mnF0911Jobnumber mn JOBS VA sec_mnJobnumberA_F0911_JOBS I To indicate which cache to delete/terminate
mnInvJobNumber mn JOBS VA rpt_mnJobnumberA_JOBS I To indicate which cache to delete/terminate


End If



Reference:
<Document 625466.1> E1: 41: Zero Balance Adjustments
<Document 1276239.1> E1: 41: Inventory Transaction MBF XT4111Z1 Clarification
<Document 1265902.1> E1: BSFN: Master Business Function in EnterpriseOne


Note: