How to Use PriceCalulateSingle (B4500460) Wrapper to Compute Item Price

Purpose of Document

Caution: This document may contain information, software, products, services which are not supported by Oracle Support Services and are being provided “as is” without warranty. Please refer to the following site for My Oracle Support Terms of use: http://www.oracle.com/pls/topic/lookup?ctx=mos_en&id=MOSHP983

You can simulate sales price only through Sales Order Master Business Function (B4201310 and B4200311 F4211FSEditLine and F4211FSBeginDoc which is making use of CalculateSalesPricesAndCosts (B4201500 - Calculate Sales Price And Cost)) through multiple applications. This implmentation uses up more resources let alone slower performance. So this document is to guide alternative ways to handle this business requirement on How to get Sales Price with Advanced Pricing Schedule.

Note that information written in this document is not the best practice for this purpose and this wrapper business function may not work for all business scenario you have. And this business function does not encompass all business requirement you may have to perform daily activities.

B4500460 - PriceCalculateSingle (Price Calculate Single) is to serve as an interoperable Pricing API, retrieving and returning a single unit price while employing a smaller, less complicated datastructure than CalculateSalesPricesAndCosts (B4201500 - Calculate Sales Price And Cost).  The function requires only an item number to return a price.  This function acts as a  "wrapper" to B4201500, masking some of its complexity and defaulting in parameters that B4201500 requires to calculate a price.

This document is to guide brief explanation on how it work and it's limitation but this document is not meant to support any issue to be derived in your using this business function. So ensure that you are capable of debugging business function and it's surrounding kernels because Oracle shall not bear any responsibility for the outcome you get through this wrapper business function. 

Note

 

Note that there is no standard application which is calling PriceCalculateSingle (B4500460 - Price Calculate Single). So actual implementation is to be performed by your inhouse developers.

You are to simulate sales price dynamically to have better profit position or to verify change of your price configuration. Business function , B4500460 - PriceCalculateSingle (Price Calculate Single) shall enable you to fulfil this. Note that implementing this business function is not the best practice rather it is one of possible ways to perform it.

Alternative way can be,

 

Detail Implementation

PriceCalculateSingle (B4500460 - Price Calculate Single)

Parameter NameData ItemData TypeReq/OptI/O/BothImplemenation
mnAddressNumber (1st) AN8 MATH_NUMERIC OPT I/O
  • Case (input = 0)
    •        &dsD4201500.mnAddressNo = F0092.AN8 on Login User ID (PpatGetUserIdAddressNumber (B0200098, F0092 Get User ID and Address Book Number))
  • Case (input mnAddressNumber != 0)
    •        &dsD4201500.mnAddressNo = mnAddressNumber
    •        &dsD4201500.mnShipToNo = mnAddressNumber
jdDateEffective (2nd) EFTJ JDEDATE OPT I/O
  •  Case (Null Date)
    •         &dsD4201500.jdPriceEffectiveDate (Date Today) via JDEDATEToday()
  •  Case (Not Null Date)
    •          &dsD4201500.jdPriceEffectiveDate = jdDateEffective
mnQtyOrdered (7th) UORG MATH_NUMERIC OPT I/O
  • Case (mnQtyOrdered = 0)
    • &dsD4201500.mnQtyOrdered = 1
    • &dsD4201500.mnQtyShipped = 1
  • Case (mnQtyOrdered > 0)
    • &dsD4201500.mnQtyOrdered = (input) (mnQtyOrdered
    • &dsD4201500.mnQtyShipped = (input) (mnQtyOrdered
szUnitOfMeasure (5th) UOM char OPT I/O
  •  Case (Blank)
    • dsD4201500.szTransactionUom = F4101.uom1
    • dsD4201500.szPricingUom = F4101.uom1
    • &dsD4201500.mnConvFactorTransToPrim = 1
    • &dsD4201500.mnConvFactorPricingToPrim = 1
  •  Case (Not Blank)
    • dsD4201500.szTransactionUom = (input) szUnitOfMeasure
    • dsD4201500.szPricingUom = (input) szUnitOfMeasure
    • Call GetItemUoMConversionFactor (B4000520, F41002 Get Item UoM Conversion) to get Conversion Factor when szUnitOfMeasure is not Primary UOM (F4101.UOM1)
    • &dsD4201500.mnConvFactorTransToPrim = &dsD4000520.mnConversionFactorFrom_to_To
    • &dsD4201500.mnConvFactorPricingToPrim = &dsD4000520.mnConversionFactorFrom_to_To
szCostCenter (3rd) MCU char OPT I/O
  •  Case (Blank)
    • dsD4201500.szBranchPlantDtl = F40095.MCU (on User ID)
    • dsD4201500.szHdrBranchPlant = F40095.MCU
    • Retrieve F40095 MCU via GetDefaultBranch (B4000370, F40095 Get Default Branch)
  •  Case (Not blank)
    • dsD4201500.szBranchPlantDtl = (input) szCostCenter
    • dsD4201500.szHdrBranchPlant = (input) szCostCenter
<Bug 19027293> - B4500460 IS NOT WORKING (DEPENDENCY WITH B4201500) IN 9.1  is to handle dsD4201500.szHdrBranchPlant which is MCU which retrieves Sales Price
mnUnitPrice UPRC MATH_NUMERIC OPT OUT  
szItemNo (4th) UITM char REQ IN
  1. Call VerifyAndGetItemMaster (X4101, F4101 Get Item Master Row) to validate input szItemNo and return data pointer for item master (in calling B4201500 which is required)
  2. Call CheckItemBranch (B4100210, F4102 Get Item Branch Row) to get Line Type and store data pointer lpdsF4102
  3. If there is no matching records stop processing with error code 4363 and 0294
szCurrencyCodeForgn (6th) CRCD char OPT I/O
  1. Set cCurrencyConversionMethod through API jdeGetCurrencyCode()
  2. Get the Company from the Business Unit by calling RetrieveCompanyFromBusUnit (B0000130, F0006 Get Company from Business Unit)
  3. Get currency conversion rate for multi currency environment through RetrieveCompanyCurrencyCode (B0000128, F0010 Get Company Currency Code)
  4. Assign dsD4201500.szBaseCurrencyCode (= szCurrencyCodeBase)  = B0000128.szCurrencyCode
  5. If (input) szCurrencyCodeForgn is not blank then call GetExchRate (B0000033, F0015 Get Exchange Rate) by assigning  {(dsD0000033.szCurrencyCodeFrom = szCustomerCurrencyCode = (input) szCurrencyCodeForgn), (dsD0000033.szCurrencyCodeTo = B0000128.szCurrencyCode), (&dsD0000033.mnAddressNumber = mnAddressNo), (&dsD0000033.jdDateEffectiveRates = &dsD4201500.jdPriceEffectiveDate), (&dsD0000033.jdTransactionDate = &dsD4201500.jdPriceEffectiveDate)}
  6. Assign &dsD4201500.mnExchangeRate  = &dsD0000033.mnCurrConvRateMult  (cCurrencyConversionMethod = Y),  &dsD4201500.mnExchangeRate = &dsD0000033.mnCurrConvRateDiv (cCurrencyConversionMethod = Z)
szCurrencyCodeBase CRDC char OPT I/O  Refer szCurrencyCodeForgn
mnUnitPriceForgn FUP MATH_NUMERIC OPT OUT  = &dsD4201500.mnUnitPrice
mnListPrice LPRC MATH_NUMERIC OPT OUT  = &dsD4201500.mnListPrice
mnListPriceForgn FPRC MATH_NUMERIC OPT OUT  = &dsD4201500.mnForeignListPrice
szListPriceUOM APUM char OPT OUT  
mnAmountExtendedPrice AEXP MATH_NUMERIC OPT OUT  = &dsD4201500.mnExtendedPrice
mnAmountForeignExtPrice FEA MATH_NUMERIC OPT OUT  = &dsD4201500.mnForeignExtPrice

Flow Chart of B4500460

 

 

 

 


 

CalculateSalesPricesAndCosts (B4201500 - Calculate Sales Price And Cost)

Parameter NameData ItemData TypeReq/OptI/O/BothImplemenation
szComputerID CTID char OPT NONE  
mnJobNo JOBS MATH_NUMERIC OPT NONE  
mnWorkFileLineNo LNIX MATH_NUMERIC OPT NONE  
mnLastLineNoAssigned LNID MATH_NUMERIC OPT NONE  
szOrderType DCTO char OPT NONE  
mnOrderNo DOCO MATH_NUMERIC OPT NONE  
szOrderCo KCOO char OPT IN (input) dsD0000130.szCompany (RetrieveCompanyFromBusUnit)
mnLineNo LNID MATH_NUMERIC OPT NONE  
szAdjustmentSchedule ASN char OPT IN  dsD4200100.szAdjustmentSchedule (via GetSoldToBillingInstructions)
mnAddressNo AN8 MATH_NUMERIC OPT IN  (Input) mnAddressNumber
Either the value you have specified in calling B4500460
Or F4092.AN8 on your E1 user ID
mnShipToNo SHAN MATH_NUMERIC OPT IN  (Input) mnAddressNumber
mnShortItemNo ITM MATH_NUMERIC OPT IN  (input)  &dsDX4101A.mnShortItemNumber based on the the szItemNo specified in your calling B4500460 which is mandatory value.
szBaseCurrencyCode CRDC char OPT IN  (input) dsD0000128.szCurrencyCode
Or szCurrencyCodeBase 
szCustomerCurrencyCode CRCD char OPT IN  (input) dsD0000128.szCurrencyCode
Or szCurrencyCodeForgn
mnExchangeRate CRR MATH_NUMERIC OPT IN  &dsD0000033.mnCurrConvRateMult or &dsD0000033.mnCurrConvRateDiv (via GetExchRate)
mnTriangulationRateFrom TRR1 MATH_NUMERIC OPT NONE  
mnTriangulationRateTo TRR2 MATH_NUMERIC OPT NONE  
cCurrencyConversionMethod CRCM char OPT IN  jdeGetCurrencyCode() assigned by B4500460
cPriceOverride PROV char OPT NONE  
mnUnitPrice UPRC MATH_NUMERIC OPT OUT  B4500460.mnUnitPrice
mnExtendedPrice AEXP MATH_NUMERIC OPT OUT  B4500460.mnAmountExtendedPrice
mnForeignUnitPrice FUP MATH_NUMERIC OPT OUT  
  • Case (szCustomerCurrencyCode = szBaseCurrencyCode)
    • B4500460.mnUnitPriceForgn = mnForeignUnitPrice
    • B4500460.mnListPriceForgn = mnForeignListPrice
    • B4500460.mnAmountForeignExtPrice = mnForeignExtPrice
  • Case (szCustomerCurrencyCode != szBaseCurrencyCode)
    • B4500460.mnUnitPriceForgn = mnUnitPrice
    • B4500460.mnListPriceForgn = mnListPrice
    • B4500460.mnAmountForeignExtPrice = mnExtendedPrice
mnForeignExtPrice FEA MATH_NUMERIC OPT OUT  Refer to mnForeignUnitPrice
mnListPrice LPRC MATH_NUMERIC OPT OUT  B4500460.mnListPrice
mnForeignListPrice FPRC MATH_NUMERIC OPT NONE  
szListPriceUOM APUM char OPT NONE  
cCostOverride CSTO char OPT NONE  
mnUnitCost UNCS MATH_NUMERIC OPT NONE  
mnExtendedCost ECST MATH_NUMERIC OPT NONE  
mnForeignUnitCost FUC MATH_NUMERIC OPT NONE  
mnForeignExtCost FEC MATH_NUMERIC OPT NONE  
mnDetachedAdj DETD MATH_NUMERIC OPT NONE  
mnForeignDetachedAdj DETF MATH_NUMERIC OPT NONE  
szBranchPlantDtl MCU char OPT IN  Either B4500460.szCostCenter (when you specified)
Or F40095.MCU based on your User ID through GetDefaultBranch (B4000370, F40095 Get Default Branch)
szLocation LOCN char OPT NONE  
szLot LOTN char OPT NONE  
szCostMethod LEDG char OPT NONE  
cTransferOrderProcessing EV01 char OPT NONE  
cTransferOrderCostMarkup EV02 char OPT NONE  
cSalesOrderFlag1 SO01 char OPT NONE  
szHdrBranchPlant MCU char OPT IN  B4500460.szCostCenter
Same with szBranchPlantDtl
via <Bug 19027293> - B4500460 IS NOT WORKING (DEPENDENCY WITH B4201500) IN 9.1
Note that Sales Price will be computed based on szHdrBranchPlant
szCompany CO char OPT IN  (input) dsD0000130.szCompany (via RetrieveCompanyFromBusUnit based on Cost Center you have specified in B4500460)
jdTransactionDate TRDJ JDEDATE OPT NONE  
cExchangeRateOverride DCFL char OPT NONE  
mnCurrencyConverRate CRRD MATH_NUMERIC OPT NONE  
mnTriangulationRateFromPrev TRD1 MATH_NUMERIC OPT NONE  
mnTriangulationRateToPrev TRD2 MATH_NUMERIC OPT NONE  
mnTransferCost TCST MATH_NUMERIC OPT NONE  
szTransferOrderToBranch TMCU char OPT NONE  
mnQtyShipped SOQS MATH_NUMERIC OPT IN   (input) mnQtyOrdered
or 1 (if you do not specify it)
mnQtyBackOrdered SOBK MATH_NUMERIC OPT NONE  
mnQtyCanceled SOCN MATH_NUMERIC OPT NONE  
mnQtyOrdered UORG MATH_NUMERIC OPT NONE  (input) mnQtyOrdered
or 1 (if you do not specify it)
mnConvFactorTransToPrim CONV MATH_NUMERIC OPT IN  (input) &dsD4000520.mnConversionFactorFrom_to_To
Or 1 when transaction UOM is same with Primary UOM
mnConvFactorPricingToPrim CNV3 MATH_NUMERIC OPT IN  (input) &dsD4000520.mnConversionFactorFrom_to_To
Or 1 when transaction UOM is same with Primary UOM
szOriginalOrderNo OORN char OPT NONE  
szOriginalOrderType OCTO char OPT NONE  
szOriginalOrderCo OKCO char OPT NONE  
mnOriginalLineNo OGNO MATH_NUMERIC OPT NONE  
cSalesOrderFlag8 SO08 char OPT NONE  
szPricingCategoryLevel CLVL char OPT NONE  
szProgramId PID char OPT NONE  
cSuppressBasePriceRetrieval EV03 char OPT NONE  
szTransactionUom UOM char OPT IN   (input) szUnitOfMeasure (when this parameter is specified in your calling B4500460)
Or, F4101.UOM1
szPricingUom UOM4 char OPT IN   (input) szUnitOfMeasure  (when this parameter is specified in your calling B4500460)
Or, F4101.UOM1
jdPriceEffectiveDate PEFJ JDEDATE OPT IN  (input) jdDateEffective
Either DateToday (if you do not specify in your calling B4500460) or the data specified at jdDateEffective
mnFromPotency FRMP MATH_NUMERIC OPT NONE  
mnThruPotency THRP MATH_NUMERIC OPT NONE  
szFromGrade FRGD char OPT NONE  
szThruGrade THGD char OPT NONE  
szCustomerPricingGroup PRGP char OPT NONE  
idF4102Pointer GENLNG ID OPT IN   (input) lpdsF4102
cSuppressWriteToWF EV04 char OPT IN  1 (hard coded from calling routine B4500460). This parameter prevents this routine to write F40UI74.  Note that the calling business function B4500460 is not suitable in case you need to handle huge data because it may utilize significant amount of memory.
cTemporaryPriceYN TPC char OPT NONE  
mnRelatedKitComponent RKIT MATH_NUMERIC OPT NONE  
szRelatedKitItemNo RLIT char OPT NONE  
cSuppressAdvancedPricing EV05 char OPT NONE  
cParentMthdOfPriceCalc PMTH char OPT NONE  
idF4101Pointer GENLNG ID OPT IN  (input) lpdsF4101
mnDiscountTrade TRDC MATH_NUMERIC OPT NONE  
mnItemWeight ITWT MATH_NUMERIC OPT NONE  
cCommittedHS COMM char OPT NONE  
mnDiscountFactor DSPR MATH_NUMERIC OPT NONE  
cDiscountApplicationType FAPP char OPT NONE  
szLineType LNTY char OPT IN  (input) F4102.LNTY based on MCU and ITM resolved in B4500460
cSalesOrderFlag9 SO09 char OPT NONE  
mnCarrier CARS MATH_NUMERIC OPT NONE  
szAgreementNo DMCT char OPT NONE  
szDutyStatus DTYS char OPT NONE  
szHdrCostCenter_EMCU EMCU char OPT NONE  
szEndUse EUSE char OPT NONE  
szRateCodeFrieghtMisc FRAT char OPT NONE  
szLineofBusiness LOB char OPT NONE  
szModeOfTransport MOT char OPT NONE  
szPaymentTermsCode PTC char OPT NONE  
cRateTypeFreightMisc RATT char OPT NONE  
szRouteCode ROUT char OPT NONE  
szShippingCommodityClass SHCM char OPT NONE  
szShippingConditionsCode SHCN char OPT NONE  
szStopCode STOP char OPT NONE  
szPriceCode1 UPC1 char OPT NONE  
szPriceCode2 UPC2 char OPT NONE  
szPriceCode3 UPC3 char OPT NONE  
szZoneNumber ZON char OPT NONE  
mnDiscountCash CADC MATH_NUMERIC OPT NONE  
mnDaysBeforeExpiration EXDP MATH_NUMERIC OPT NONE  
mnGrossWeight GRWT MATH_NUMERIC OPT NONE  
mnItemVolume ITVL MATH_NUMERIC OPT NONE  
mnQtyOrderedInPrimary PQOR MATH_NUMERIC OPT NONE  
mnQuantityRelieved QRLV MATH_NUMERIC OPT NONE  
mnQuantityShippedToDate QTYT MATH_NUMERIC OPT NONE  
mnQtyOpen UOPN MATH_NUMERIC OPT NONE  
mnUserReservedAmount URAT MATH_NUMERIC OPT NONE  
szOrderRepriceCategory ORPR char OPT NONE  
szRepriceBasketPriceCat RPRC char OPT NONE  
szVolumeUom VLUM char OPT NONE  
szWeightUom WTUM char OPT NONE  
cSuppressPriceExtension EV06 char OPT IN 1 (hard coded in calling routine B4500460) 
szItemPriceGroup PRGR char OPT NONE  
mnConvFactorTransToPricing CONV MATH_NUMERIC OPT NONE  
cSuppressCostRetrieval EV07 char OPT IN  1 (Hard coded in calling routine B4500460) not to retrieve Inventory Cost information
cAdvPriceCalled EV08 char OPT NONE  
cSuppressErrorMsg EV09 char OPT NONE  
szErrorMessageID DTAI char OPT NONE  
idF49211Ptr GENLNG ID OPT NONE  
szFreightHandlingCode FRTH char OPT NONE  
mnParentAddressNo PA8 MATH_NUMERIC OPT NONE  
szDetailBPCurrCode CRCE char OPT NONE  
szPaymentTermsAR TRAR char OPT NONE  
szTaxExplanationCode1 EXR1 char OPT NONE  
mnHdrBPAddressNo IAN8 MATH_NUMERIC OPT NONE  
cPaymentInstrumentA RYIN char OPT NONE  
mnProcessID PEID MATH_NUMERIC OPT NONE  
mnTransactionID TCID MATH_NUMERIC OPT NONE  
mnPercentofProfitMargin PRMG MATH_NUMERIC OPT NONE  
szReasonCode RCD char OPT NONE  
szDualUOM UOM2 char OPT NONE  
mnDualQty SQOR MATH_NUMERIC OPT NONE  
mnOverrideBasePrice OVBPRC MATH_NUMERIC OPT NONE  
mnOverrideForeignBasePrice OVFBPRC MATH_NUMERIC OPT NONE  
mnVolumeTolerancePercentage INCRAM MATH_NUMERIC OPT NONE  
szSOEMBFInternalFlags SOEF char OPT NONE  
cUsePrefPricingUOMBasePrice EV01 char OPT NONE  
cPriceAtAmbStdWgt PRAS char OPT NONE  
mnTaxedUnitPrice TUPRC MATH_NUMERIC OPT NONE  
mnTaxedExtendedPrice TAEXP MATH_NUMERIC OPT NONE  
mnUnitTaxAmount UTA MATH_NUMERIC OPT NONE  
mnExtendedTaxAmount ETA MATH_NUMERIC OPT NONE  
mnForeignTaxedUnitPrice TFUP MATH_NUMERIC OPT NONE  
mnForeignTaxedExtendedPrice TFEA MATH_NUMERIC OPT NONE  
mnForeignUnitTaxAmount FUTA MATH_NUMERIC OPT NONE  
mnForeignExtendedTaxAmount FETA MATH_NUMERIC OPT NONE  
cUseTaxedPrices UTP char OPT NONE  
cTaxedPriceOverrideCode TPROV char OPT NONE  
jdInternalSOTaxDate DTXJ JDEDATE OPT NONE  
szTaxArea1 TXA1 char OPT NONE  
szOrderLineTaxExplanationCode1 EXR1 char OPT NONE  
cTaxableYN TAX1 char OPT NONE  
mnVertexJobnumber JOBS MATH_NUMERIC OPT NONE  
cVertexActiveFlag VVTX char OPT NONE  

 

 


 

Question and Answer

This section is to be expanded based on feedback on the usage of business function B4500460 if any.