Do Cost Plus Pricing with Oracle Costing

Set up Oracle Pricing to get cost details from Oracle Costing.

Summary of the Set Up

  1. Do the set up described in Get Cost Details from Oracle Costing.
  2. Create a pricing algorithm.

  3. Modify a predefined pricing algorithm.

1. Create a Pricing Algorithm

Create a pricing algorithm that gets pricing from the cost service.

  1. Download the algorithm.

  2. Sign into Oracle Pricing with administrative privileges.

  3. Go to the Pricing Administration work area, the click Tasks > Manage Algorithms

  4. On the Manage Algorithms page, click Actions > Import.

  5. In the dialog that displays, browse to the file you saved, GetPricefromExternalApplicationCustom.zip, then click OK.

  6. On the Manage Algorithms page, query for the Get Price from External Application Custom algorithm, then open it for editing.

  7. On the Edit Algorithm page, notice that the algorithm includes three steps.

    Step

    Value

    Create Costing Input

    Iterates over the ChargeCandidate variable to identify candidates that need cost.

    It includes data sets for ChargeCandidate and each candidate line. You can add data sets, as necessary, but the predefined data should meet most of your requirements.

    The default action uses InventoryItemId to create an entry in the CostingInput variable for each item that needs a cost plus calculation. It also uses InventoryOrganizationId from the line for ChargeCandidate.

    If you must price according to the warehouse, then remove InventoryOrganizationId, and replace it with ShipFromPartyId.

    Invoke Costing Service

    The predefined script in this step should meet most of your requirements.

    If necessary, you can modify it.

    executeSOAPService('QP_FUSION_COSTING_ICS_SERVICE', //Service Name
    CostingInput, //input
    [operation:'retrieveItemCost', inContext:'Sales.retrieveItemCost_Custom', outContext:'Sales.retrieveItemCost_Custom'])

    To make the connection when you modify it, use the connector that you set up in section D Set Up the Connector in Oracle Applications. For details, see Get Cost Details from Oracle Costing.

    Next, this script gets the output from the costing service.

    CostingOutput = serviceOutputMap.get("outputSDO")

    Note that the integration automatically adds the CostingInput entity and the CostingOutput entity when it calls the Get Price from External Application Custom pricing algorithm.

    Process Costing Output

    Iterates over the ChargeCandidate entries that need costs.

    The CostOutput data set corresponds to the item on the line.

    The actions determine whether the service successfully returned the costs, and updates the CostValue on the ChargeCandidate.

    As an option, if the service doesn't return a cost for an item, then use a PricingMessage to mark the corresponding line in error.

  8. Click Test, then click Actions > Add Row to add a test case.

  9. On the Test Input tab, notice that the test case includes a row for the PriceRequest variable and some code in the Variable Value column.

    The code doesn't contain any values, so you will replace it with code that does include example values.

  10. In the Variable Value column, click the pencil.

  11. In the Edit Variable dialog, delete all the code, paste this code into the dialog, then click OK.

    <
    ? xml version = "1.0"
    encoding = "UTF-8" ? >
        <
      PriceRequestInternal : PriceRequestInternalType xmlns: ns0 = "http://xmlns.oracle.com/adf/svc/types/"
    xmlns: PriceRequestInternal = "http://xmlns.oracle.com/apps/scm/pricing/priceExecution/pricingProcesses/pricingInternal/PricingInternal"
    xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"
    xsi: type = "PriceRequestInternal:PriceRequestInternalType" >
    
      <
      PriceRequestInternal: Header >
      <
      PriceRequestInternal: CustomerId > 1000 < /PriceRequestInternal:CustomerId> <
      PriceRequestInternal: HeaderId > 1 < /PriceRequestInternal:HeaderId><PriceRequestInternal:CalculatePricingChargesFlag>true</PriceRequestInternal: CalculatePricingChargesFlag > < PriceRequestInternal: CalculateShippingChargesFlag > false < /PriceRequestInternal:CalculateShippingChargesFlag> <
      PriceRequestInternal: CalculateTaxFlag > false < /PriceRequestInternal:CalculateTaxFlag> <
      PriceRequestInternal: SellingBusinessUnitId > 204 < /PriceRequestInternal:SellingBusinessUnitId> <
      PriceRequestInternal: SellingLegalEntityId > 204 < /PriceRequestInternal:SellingLegalEntityId> <
      PriceRequestInternal: TransactionTypeCode > ORA_SALES_ORDER < /PriceRequestInternal:TransactionTypeCode> <
      /PriceRequestInternal:Header> <
      PriceRequestInternal: PricingServiceParameter >
      <
      PriceRequestInternal: PricingContext > SALES < /PriceRequestInternal:PricingContext> <
      /PriceRequestInternal:PricingServiceParameter> <
      PriceRequestInternal: Line >
      <
      PriceRequestInternal: ShipFromPartyId > 300000037424187 < /PriceRequestInternal:ShipFromPartyId> <
      PriceRequestInternal: HeaderId > 1 < /PriceRequestInternal:HeaderId> <
      PriceRequestInternal: InventoryItemId > 100000001582379 < /PriceRequestInternal:InventoryItemId> <
      PriceRequestInternal: InventoryOrganizationId > 300000037424187 < /PriceRequestInternal:InventoryOrganizationId> <
      PriceRequestInternal: LineId > 1 < /PriceRequestInternal:LineId> <
      PriceRequestInternal: LineCategoryCode > ORDER < /PriceRequestInternal:LineCategoryCode> <
      PriceRequestInternal: LineQuantity unitCode = "Ea"
    xmlns: tns = "http://xmlns.oracle.com/adf/svc/errors/" > 2 < /PriceRequestInternal:LineQuantity> <
      PriceRequestInternal: LineQuantityUOMCode > Ea < /PriceRequestInternal:LineQuantityUOMCode> <
      PriceRequestInternal: LineTypeCode > ORA_BUY < /PriceRequestInternal:LineTypeCode> <
      /PriceRequestInternal:Line>
    
      <
      PriceRequestInternal: ChargeCandidate >
      <
      PriceRequestInternal: BasePrice > < /PriceRequestInternal:BasePrice> <
      PriceRequestInternal: CalculateMarginFlag > Y < /PriceRequestInternal:CalculateMarginFlag> <
      PriceRequestInternal: CalculationMethod > COST < /PriceRequestInternal:CalculationMethod> <
      PriceRequestInternal: CalculationTypeCode > MARKUP_PERCENT < /PriceRequestInternal:CalculationTypeCode> <
      PriceRequestInternal: CostCalculationAmount > 30 < /PriceRequestInternal:CostCalculationAmount>
    
        <
      PriceRequestInternal: CanAdjustFlag > Y < /PriceRequestInternal:CanAdjustFlag> <
      PriceRequestInternal: ChargeAppliesTo > PRICE < /PriceRequestInternal:ChargeAppliesTo> <
      PriceRequestInternal: ChargeDefinitionCode > QP_SALE_PRICE < /PriceRequestInternal:ChargeDefinitionCode> <
      PriceRequestInternal: ChargeDefinitionId > 300100070841552 < /PriceRequestInternal:ChargeDefinitionId> <
      PriceRequestInternal: ChargeId > 1 < /PriceRequestInternal:ChargeId> <
      PriceRequestInternal: ChargeSubtypeCode > ORA_PRICE < /PriceRequestInternal:ChargeSubtypeCode> <
      PriceRequestInternal: ChargeTypeCode > ORA_SALE < /PriceRequestInternal:ChargeTypeCode> <
      PriceRequestInternal: CurrencyCode > USD < /PriceRequestInternal:CurrencyCode> <
      PriceRequestInternal: DenormDistanceNum xsi: nil = "true" / >
      <
      PriceRequestInternal: ItemId > 149 < /PriceRequestInternal:ItemId> <
      PriceRequestInternal: ItemLevelCode > ITEM < /PriceRequestInternal:ItemLevelCode> <
      PriceRequestInternal: ItemLevelPrecedence > 1 < /PriceRequestInternal:ItemLevelPrecedence> <
      PriceRequestInternal: ItemType > STANDARD < /PriceRequestInternal:ItemType> <
      PriceRequestInternal: LineTypeCode > ORA_BUY < /PriceRequestInternal:LineTypeCode> <
      PriceRequestInternal: ParentEntityCode > LINE < /PriceRequestInternal:ParentEntityCode> <
      PriceRequestInternal: ParentEntityId > 1 < /PriceRequestInternal:ParentEntityId> <
      PriceRequestInternal: PriceListChargeId > 300100071623860 < /PriceRequestInternal:PriceListChargeId> <
      PriceRequestInternal: PriceTypeCode > ONE_TIME < /PriceRequestInternal:PriceTypeCode> <
      PriceRequestInternal: PricingUomCode > Ea < /PriceRequestInternal:PricingUomCode> <
      PriceRequestInternal: PrimaryPricingUomFlag > Y < /PriceRequestInternal:PrimaryPricingUomFlag> <
      PriceRequestInternal: StartDate > 2009 - 01 - 01 T09: 00: 00.0 Z < /PriceRequestInternal:StartDate> <
      PriceRequestInternal: Type > SEGMENT_PRICE < /PriceRequestInternal:Type> <
      PriceRequestInternal: NeedsCost > true < /PriceRequestInternal:NeedsCost> <
      /PriceRequestInternal:ChargeCandidate>
    
      <
      PriceRequestInternal: ChangeSummary logging = "false"
    xmlns: sdo = "commonj.sdo" / >
      <
      /PriceRequestInternal:PriceRequestInternalType>
  12. You're getting costs directly according to items on the line, so remove any references to ChargeCandidate in the Create Costing Input step and the Process Costing Output step. Make sure the primary set is Line.
  13. Click Save.

  14. Click Run Test, then verify that the test finishes without error.

    Order Management doesn't determine the actual warehouse for the sales order until you click Submit on the sales order. So, if you use ShipFromPartyId to get costs according to the warehouse, then you must set up a defaulting rule that sets the default value for the warehouse on the order header and the order line. If you don't have a defaulting rule, then Pricing won't calculate the cost. For details, see Overview of Using Business Rules With Order Management.

  15. Click Save and Close.

  16. On the Manage Algorithms page, click Actions > Publish, then verify that the Status attribute contains Published for the Get Price from External Application Custom algorithm.

2. Modify a Predefined Pricing Algorithm

Modify the Get Base List Price for Goods and Services algorithm. This algorithm calculates cost plus pricing.

Modify the Get Base List Price for Goods and Services algorithm.

Try it.

  1. Create a version of the pricing algorithm that you need to edit.

    • Click Tasks > Manage Algorithms.

    • On the Manage Algorithms page, search for the pricing algorithm.

      Attribute

      Value

      Name

      Get Base List Price for Goods and Services

    • Click Actions > Create Version, locate the version that has this status, then open it for editing.

      Attribute

      Value

      Status

      In Progress

  2. Modify the test that you use to determine whether to process cost plus pricing.

    • On the Edit Algorithm page, in the Sequence column, expand step 15 in the tree, expand the Cost Plus Pricing step, then click the step that has the value.

      Attribute

      Value

      Name

      If Cost Plus Pricing

    • Delete the content in the Condition window and replace it with this code.

      Attribute

      Value

      Condition

      false && NeedsCostPlus && finer('==== Invoking Cost-Plus Pricing ====') == null

    • Click Save.

  3. Modify cost plus pricing.

    • Click the Cost Plus Pricing step.

    • Click Add Step > Composite Step > If.

    • Click the new step you just added and set the values.

      Attribute

      Value

      Name

      If External Costing Plus Pricing

      Condition

      NeedsCostPlus && finer('==== Invoking Cost-Plus Pricing ====') == null

    • Click Save.

  4. Add the subalgorithm.

    • In the tree, click the triangle on the step you just added, If External Costing Plus Pricing.

      This helps to make sure that the subalgorithm you add is a child of If External Costing Plus Pricing.

    • Click Add Step > Subalgorithm.

    • In the Step Details area, set the values.

      Attribute

      Value

      Name

      Compute Cost from External Systems

      Algorithm Name

      Get Price From External Application Custom

      This is the algorithm that you created in the previous section in this topic.

    • In the Input Variables area, set the values.

      Attribute

      Value

      Variable

      PriceRequest

      Assignment Value

      PriceRequest

    • In the Output Variables area, set the values.

      Attribute

      Value

      Variable

      PriceRequest

      Assignment Value

      PriceRequest

  5. Click Save and Close, then publish the highest version of Get Base List Price for Goods and Services.

Notes

  • When you process the output from the costing service, you use the cost value to create a cost charge component for each item that the algorithm successfully calculates. Use the Write Costs step in the Calculate Cost algorithm as an example.

  • If you price a configurable item, then call the Rollup and Aggregate Charge Components subalgorithm to roll up and aggregate the costs. Call the new custom algorithm that you created from the algorithm that calculates cost.

Implement Cost Plus Pricing with Systems That Are Part of Oracle

If you do the steps described in the sections earlier in this topic, then the pricing algorithms already calculated cost on the ChargeComponents. Here's what you need to do:

  • Create a new version of the algorithm that calculates costs.

  • Disable the steps that get cost from the cost lists in Oracle Pricing.

  • Add a step that iterates over the ChargeCandidate entries that need the cost plus markup. Get the CostValue from the ChargeCandidate and create a Cost Charge Component.

  • Use the Write Costs algorithm step in the Calculate Cost algorithm or the Calculate Margin algorithm as an example to create the cost charge components.

  • If you price a configurable item, then call the Rollup and Aggregate Charge Components subalgorithm to roll up and aggregate the costs.

  • Save and publish your changes.

Calculate Margin

As an option, you can calculate margin according to costs from Oracle Costing.

The Calculate Cost pricing algorithm calculates cost, and the Calculate Margin step in the Calculate Pricing Charges algorithm calculates the margin. This section describes some guidelines you can follow for this use case.