How to Troubleshoot issue in P4021 (Supply & Demand)

Purpose of Document

Question 1. What are the related Business Functions running P4021?

Answer 1. There are 2 BSFNs which may affect the results when viewing the P4021 inquiry:


Question 2. What is the sequence of Cache Action?

Answer 2. In running application P4021 it handles Supply Demand Cache as below:

1. CACHE_SD_ADD (cCacheActionCode = 2)
2. CACHE_SD_GET_NEXT (cCacheActionCode = 5)
3. CACHE_SD_UPDATE (cCacheActionCode = 3)
4. CACHE_SD_TERMINATE (cCacheActionCode = 6)
NOTE:
#define CACHE_SD_GET _J('1')
#define CACHE_SD_ADD _J('2')
#define CACHE_SD_UPDATE _J('3')
#define CACHE_SD_DELETE _J('4')
#define CACHE_SD_GET_NEXT _J('5')
#define CACHE_SD_TERMINATE _J('6')
#define CACHE_SD_CLOSE_CURSOR _J('7')
#define CACHE_SD_DEBUG _J('D')

Question 3. What is the sequence of computation in P4021?

Answer 3. Simplified sequence of the computation is:


The questions below are related with BSFN B3400310 - LoadSupplyAndDemandData (F4021W Calculate Supply and Demand).


Question 4. What flags are initialized when the B3400310 gets called with cMode = 1?

Answer 4. There are two different types of flags, one is from the parameters of processing option, and the other is computed based on transactional tables.

First, the Flags below are the IN parameters from Processing Options of P4021

Next are the flags which are returned through B3400310 - LoadSupplyAndDemandData (with cMode = '1')

Below flags are set internally (NOTE: each flag is self-explained)

a. If cPlannedOrderFlag (=PO cPOPlannedOrderFlag) is "1", then set "1" for below flags
. cTransFlag
. cPegOrderFlag
. cCoByPegFlag
b. If PO szForecastType1 through 5 is not Blank, then set "1" for
. cForecastFlag
c. If PO szScheduleType is not Blank, then set "1" for
. cRateFlag
d. Below are the other flags which determines which file to read:
. cPurchaseFlag
. cWorkOrderFlag
. cCrossDockingFlag
. cCoByOrderFlag
. cTransFlag
. cPartsFlag
. cRecRtgFlag
. cMfgFlag

: Based on the Flags defined/initialized here will determine which tables to access to fetch supply and demand data. For this the jdedebug.log will contain each flag with a value 0 (or Blank) and 1 (to process transactional data)

In mode 2 it reads Supply and Demand data and than creates cache.

cMode Purpose
1 Attempt to open all files used for Supply and Demand Inquiry. Set global flags based on the success of the file opens.
2 Call the routines to read the supply and demand data from the various tables and write it to the Cache
3 Call the routines to close the data tables

Question 5. What now is the sequence of reading and tables related?

Answer 5. It calls the internal BSFN in B3400310 as explained below:

Internal BSFN Usage Table(s) Description
1 I3400310_GetAndSelectLotQuantity All the data from F41021 F41021 and F4108 Location Master
2 I3400310_GetandSelectProjectInventory when mpm is ON F410211 Inventory Commitment Table
3 I3400310_GetAndSelectConfiguredComponentQuantity Not for Cross Docking F3215 Configurator Component Table
4 I3400310_GetAndSelectPurchaseOrders cPurchaseFlag is ON F4311 Purchase Order Detail File
5 I3400310_GetAndSelectWorkOrders cMfgFlag is ON F4801 and/or F4801T Work Order Master File/Work Order Master Tag File
6 I3400310_GetAndSelectCoByOrders cMfgFlag is ON F3111 Work Order Parts List
7 I3400310_GetAndSelectPartsList cMfgFlag is ON and no cCrossDockingFlag F3111 Work Order Parts List
8 I3400310_GetAndSelectPeggingOrders cPlannedOrderFlag is ON F3412 MPS/MRP/DRP Lower Level Requirements Table or Pegging Records
9 I3400310_GetAndSelectCoByPegging cPlannedOrderFlag is ON and F3002 contains data per (void *) &dsF3002Key8 F3412/F3002 MPS/MRP/DRP Pegging Records/Bill of Material Master File
10 I3400310_GetAndSelectCoByPegging cPlannedOrderFlag is ON and F3002 does not contains data per (void *) &dsF3002Key8 then search F3002 again after setting CObY='C' F3412 MPS/MRP/DRP Pegging Records Table
11 I3400310_GetAndSelectPlannedOrders cPlannedOrderFlag is ON and cCrossDockingFlag is OFF F3411 MPS/MRP/DRP Message File
12 I3400310_GetAndSelectForecast cCrossDockingFlag is OFF and cForecastFlag is ON F3460 Forecast File
13 I3400310_GetAndSelectSalesOrders F4211 Sales Order Detail File
14 I3400310_GetAndSelectRates cCrossDockingFlag is OFF and cRateFlag is ON F4801 Work Order Master File
NOTE: Based on the processing options and data used, some of the Internal BSFN may not be called (based on business requirements)

Question 6. Is there example of a query?

Answer 6. Below are examples of each query when all the flags are ON,

Query Remark
1 SQL> SELECT * FROM PRODDTA.F41021 WHERE ( LIITM = 1234 AND LIMCU = ' M30' ) AND ( LILOTS IN ( ' ',' ',' ',' ',' ',' ' ) ) ORDER BY LIITM ASC,LIMCU ASC,LILOCN ASC,LILOTN ASC
2 SQL> SELECT * FROM PRODDTA.F410211 WHERE ( PCMCU = ' M30' AND PCITM = 1234 ) ORDER BY PCMCU ASC,PCITM ASC,PCLOCN ASC,PCLOTN ASC
3 SQL> SELECT * FROM PRODDTA.F3215 WHERE ( CCMCU = ' M30' AND CCITM = 1234 AND CCSY = '42' AND CCWADL = '0' AND CCCFGID > 0.000000 ) ORDER BY CCCFGID ASC,CCCFGCID ASC,CCKIT ASC,CCCFGSID ASC
4 SQL> SELECT * FROM PRODDTA.F4311 WHERE ( PDITM = 1234 AND PDMCU = ' M30' ) AND ( PDLTTR <> '999' OR PDNXTR <> ' ' ) ORDER BY PDITM ASC,PDMCU ASC,PDPDDJ ASC
5 SQL> SELECT * FROM PRODDTA.F4801 WHERE ( WAITM = 1234 AND WAMMCU = ' M30' ) AND ( WASRST NOT IN ( '95','91','92','96','97','98','99' ) ) ORDER BY WAITM ASC,WAMMCU ASC,WADRQJ ASC
6 SQL> SELECT * FROM PRODDTA.F3111 WHERE ( WMCPIT = 1234 AND WMCMCU = ' M30' AND WMCOBY IN ( 'B' , 'C')) ORDER BY WMCPIT ASC,WMCMCU ASC,WMDOCO ASC,WMUORG DESC
7 SQL> SELECT * FROM PRODDTA.F3111 T0,PRODDTA.F4801 T1,PRODDTA.F4801T T2 WHERE ( T0.WMCPIT = 1234 AND T0.WMCMCU = ' M30' AND T1.WASRST NOT IN ( '95','91','92','96','97','98','99' ) AND T0.WMCOBY = ' ' ) AND ( T0.WMDOCO=T1.WADOCO AND T0.WMDCTO=T1.WADCTO AND T0.WMDOCO=T2.WADOCO ) ORDER BY T0.WMUKID ASC
8 SQL> SELECT * FROM PRODDTA.F3412 WHERE ( MWITM = 1234 AND MWMCU = ' M30' ) ORDER BY MWITM ASC,MWMCU ASC,MWDRQJ ASC
9 SQL> SELECT * FROM PRODDTA.F3002 WHERE ( IXCOBY = 'B' AND IXKIT = 1234 AND IXMMCU = ' M30' )
10 SQL> SELECT * FROM PRODDTA.F3002 WHERE ( IXCOBY = 'C' AND IXKIT = 1234 AND IXMMCU = ' M30' )
11 SELECT * FROM PRODDTA.F3411 WHERE ( MMITM = 1234 AND MMMCU = ' M30' ) ORDER BY MMITM ASC,MMMCU ASC,MMDRQJ ASC
SQL> SELECT * FROM PRODDTA.F3411 WHERE ( MMMMCU = ' M30' AND MMITM = 1234 ) ORDER BY MMMMCU ASC,MMITM ASC,MMDRQJ ASC
12 SQL> SELECT * FROM PRODDTA.F3460 WHERE ( MFITM = 1234 AND MFMCU = ' M30' ) ORDER BY MFITM ASC,MFMCU ASC,MFDRQJ ASC
13 SQL> SELECT * FROM PRODDTA.F4211 WHERE ( SDITM = 1234 AND SDMCU = ' M30' ) AND ( SDNXTR NOT IN ( '999','980' ) ) ORDER BY SDITM ASC,SDMCU ASC,SDPDDJ ASC,SDPDTT ASC
14 SQL> SELECT * FROM PRODDTA.F4801 WHERE ( WAITM = 1234 AND WAMMCU = ' M30' ) AND ( WADCTO = 'SC' ) ORDER BY WAITM ASC,WAMMCU ASC,WADRQJ ASC

Note:

Question 7. How internally does it differentiate Supply data from Demand Data?

Answer 7. Internally it is through mnBubbleSequence as below,

1. 0 or 10 (F41021 and F4108)
. jdLotEffectiveDate >= jdTodayDate: 0
. jdLotEffectiveDate < jdTodayDate: 0
. jdExpiryDate is not NULL AND mnOutstandingQuantity !=0: 10
2. 0 (F410211)
3. 70 (F3215)
4. 20 (F4311)
5. 30 or 85 (4801/F4801T)
. F4801T.wamwdh is equal to Blank or NULL: 30
. cProjectDemand is 1(Supply on Project End Item is equal to Project Demand): 85
6. 40 (F3111)
7. 100 (F3111)
8. 110 (F3411)
9. 60 (F3412/F3002)
10. 60 (F3412)
11. 50 (F3411)
12. 80 (F3460)
13. 70 (F4211)
14. 31 (F4801)
NOTE:

Question 8. How does the system compute the GC Promise Date?

Answer 8. By reading the Supply and Demand transactional files, it gets information as below:

1. I3400310_GetAndSelectLotQuantity
2. I3400310_GetandSelectProjectInventory: No Implementation
3. I3400310_GetAndSelectConfiguredComponentQuantity: jdPromisedDate from B3401730 - MRPProcessConfiguredComponent (MRP, Process Configured Component)
4. I3400310_GetAndSelectPurchaseOrders: F4311.PDDJ
5. I3400310_GetAndSelectWorkOrders: F4801.DPL
6. I3400310_GetAndSelectCoByOrders: F3111.DLEJ
7. I3400310_GetAndSelectPartsList: V3111JC.DRQJ
8. I3400310_GetAndSelectPeggingOrders: F3412.DRQJ
9. I3400310_GetAndSelectCoByPegging: F3412.DRQJ
10. I3400310_GetAndSelectCoByPegging: F3412.DRQJ
11. I3400310_GetAndSelectPlannedOrders: F3411.OEDJ
12. I3400310_GetAndSelectForecast: F3460.DRQJ
13. I3400310_GetAndSelectSalesOrders: F4211.PDDJ
14. I3400310_GetAndSelectRates: F4801.DRQJ
: Promise Date will be computed based on system date if mnBubbleSequence is 0

Question 9. What are columns, index for query?

Answer 9.

Internal function Table Index Columns Note
I3400310_VerifySupplyDemandRuleExists() F34004 Key1 (ID_F34004_VERSION_ORDERTYPE__A) MVER,DCTO,LNTY,TRTY
I3400310_GetAndSelectPOSequentially() F4311 Key4 (ID_F4311_ITEM_NUMBER__BRANCH____A) KCOO, DOCO, DCTO, SFXO,LNID, MCU, RORN, AN8,PDDJ, ITM, LOCN, LOTN,LNTY, NXTR, LTTR,UOM,UOPN, RTGC, PRJM, DLEJ
I3400310_GetSelectWOSequentially() F4801 Key4 (ID_F4801_ITEM_BRANCH) DCTO, DOCO, CO, SFXO, PARS, DL01, MMCU, LOCN, SRST, AN8, DRQJ, ITM, UORG, SOCN, SOQS, UOM, RTG, LOTN, DPL, RORN
I3400310_GetSelectPlannedOrdersSeq F3411 Key5 (ID_F3411_SHORT_ITEM__BRANCH___B) ITM, MCU, MMCU, MSGT, MSGA, HCLD, DOCO, DCTO, TRQT, VEND, DRQJ, OEDJ, PRJM
I3400310_GetAndSelectCoByOrdersSeq F3111 Key2 (ID_F3111_COMPITEMNO_COMPBRANCH__A) DOCO, DCTO, SFXO, COBY, BSEQ, CPIT, CMCU, LOCN, LOTN, AN8, DRQJ, UORG, TRQT, SOCN, UM, RTG, PARS, DLEJ
I3400310_GetAndSelectCoByPeggingSeq F3412 Key3 (ID_F3412_KIT_ITEM___KIT_BRANCH) KIT, MMCU, ITM, MCU, DRQJ, DOCO, DCTO, UORG
I3400310_GetOnHandQuantityInSequence F41021 Key1 (ID_F41021_ITEM__BRANCH___A) ITM, MCU, LOCN, LOTN, PBIN, LOTS, PQOH, QTTR, QTIN, QTO1, QTO2, SQOH
I3400310_GetSelectSalesOrdersSequentially F4211 Key6 (ID_F4211_SHORT_ITEM__BRANCH) KCOO, DOCO, DCTO, LNID, MCU, AN8, SHAN, PDDJ, ITM, LOCN, LOTN, LNTY, NXTR, UOM, UORG, SOCN, QTYT, XDCK, XPTY, PRJM, XKCO, XORN, XCTO, XLLN, XSFX,LTTR
I3400310_GetSelectTransferOrdersSeq F3411 Key7 (ID_F3411_SUPP_BRANCH__SHORT_ITEM___A) ITM, MCU, MMCU, MSGT, MSGA, HCLD, DOCO, DCTO, TRQT, VEND, DRQJ, STRT
I3400310_GetSelectPartsListSequentially F3111, F4801, F4801T V3111JC - JointF3111_F4801_F4801T
F3111.DOCO, F3111.DCTO, F3111.COBY, F3111.CPIT, F3111.CMCU, F3111.DSC1, F3111.LOCN, F3111.LOTN, F3111.AN8, F3111.DRQJ, F3111.UORG, F3111.UM, F3111.TRQT, F3111.QNTA, F3111.COMM, F4801.SRST, F4801.ITM, F4801.MMCU, F4801T.PRJM
Business View
I3400310_GetAndSelectPeggingSequentially F3412 Key1 (ID_F3412_SHORT_ITEM__BRANCH___A) ITM, MCU, DRQJ, DOCO, DCTO, UORG, KIT, MMCU, PRJM, SRDM
I3400310_GetAndSelectForecastSequentially F3460 Key 2 (ID_F3460_ITEM_NUMBER__BRANCH___A) ITM, MCU, DRQJ, AN8, FQT, TYPF, DCTO
GetReceiptRoutingData (B3400300) F43092 Key 3 (ID_F43092_ACTIVE_OP__ORDERNUMBER__B) KCOO, DOCO, DCTO, SFXO, LNID, MCU, OPRC, UPIB, ACTO, UOM, QTYO Not internal function
I3400310_GetAndSelectRatesSequentially F4801 Key4 (ID_F4801_ITEM_BRANCH) DCTO, DOCO, SFXO, DL01, MMCU, SRST, STRT, DRQJ, ITM, UORG, SOCN, SOQS, UOM
I3400310_GetConfCompQuantityInSequence F3215,
F4211
Key1 (ID_F3215_CONFIGID__COMPONENTID___A),
Key1 (ID_F4211_ORDER_NUMBER__ORDER_TYPE___A)
F3215 (CFGID, CFGCID, ITM, MCU, QNTY, UOM, KIT, CFGSID, SY, WADL, PDDJ),
F4211 (KCOO, DOCO, DCTO, LNID, LNTY,NXTR)
I3400310_GetandSelectProjectInventory F410211 Key2 (ID_F410211_MCU_ITM_LOCN_LOTN) MCU, PRJM, DOCO, ITM, LOCN, LOTN, PJCM, PJDM

Note:

To discuss this information further with Oracle experts and industry peers, we encourage you to review, join or start a discussion in the E1 Manufacturing Community.
To look at upcoming or archived Advisor Webcasts please see Advisor Webcast Details Document 1450327.1. If your topic is not currently scheduled please suggest it.