Sie sind auf Seite 1von 3

Purpose:

This article outlines the application setups required and the code snippet called, that wed
utilized to implement automatic freight charge application based on shipped weight, in our
work with different clients.
Applications: Advanced Pricing/Order Management/Shipping
Minimum version: 11.5.8
Business Scenario:
In some industries, notably Distribution and Logistics, wed witnessed that the ability to
automatically assign freight charges in Order Management based on shipped weight, to be a
common requirement. And wed used the standard setups, in conjunction with a custom
function (sourced attribute) in Advanced Pricing, to address this need.
Application Setups:
At a high level, wed set up the application in the following way:
1. Create a new pricing context and pricing attribute.
2. Use Attribute Mapping to custom source this pricing attribute to return the shipped
weight.
3. Define a pricing formula with the pricing attribute as a component
4. Define a Freight and Special Charges modifier that uses the formula. Add qualifiers
to ensure that the modifier gets applied only after shipment.
In our experience, wed defined the pricing formula in one of two ways with the pricing
attribute and factors (when the freight charge is based on a range, say $45 for 50-100 lbs
shipped) or a numeric constant multiplied by the pricing attribute (for instance, say the freight
charge is $0.60 per pound shipped).Having the unit weight of the items set in the item master
is a prerequisite. The details on custom sourcing for step 2 are given below.

Responsibility: Oracle Pricing Manager


Navigation: Setup > Attribute Management > Attribute Linking and Mapping
For the Pricing context defined in step 1, wed set the level to be Line and Attribute Mapping
method as Attribute Mapping and in the Attribute Mapping form, wed typically set the
values as given below. Subsequently, wed run the Build Attribute Mapping Rules
concurrent program.
Field

Value

Application Name
Request Type
User source type
User Value String

Advanced Pricing
ONT
PL/SQL API
Freight_formula_pkg.Get_line_shipped_weight
(oe_order_pub.g_line.line_id)

Code Snippet:
CREATE OR REPLACE PACKAGE freight_formula_pkg
IS
FUNCTION get_line_shipped_weight (
p_line_id IN NUMBER
)
RETURN NUMBER;
END;

CREATE OR REPLACE PACKAGE BODY freight_formula_pkg


IS
FUNCTION get_line_shipped_weight (
p_line_id IN NUMBER
)
RETURN NUMBER
IS
l_item_id
NUMBER
: = oe_order_pub.g_line.inventory_item_id;
l_ship_from_org_id NUMBER
: = oe_order_pub.g_line.ship_from_org_id;
l_unit_weight
mtl_system_items.unit_weight%TYPE;

BEGIN
SELECT SUM (NVL (wdd.gross_weight, 0))
INTO l_unit_weight
FROM wsh_delivery_details wdd
WHERE wdd.source_line_id = p_line_id;
RETURN (l_unit_weight);
EXCEPTION
WHEN OTHERS THEN
RETURN (0);
END get_line_shipped_weight;
END freight_formula_pkg;

Additional logic could be included, to meet business-specific requirements like imposing a


minimum freight charge for certain customers, line unit weight for containers etc.
Please refer to the Advanced Pricing implementation manual for the other setups, outlined
above.
References: Oracle Advanced Pricing Implementation manual, Oracle Advanced Pricing
users guide.

Disclaimer: The information in this document is the opinion of the author, not of Oracle Corporation. Any
content, materials, information or software downloaded or otherwise obtained through the use of the site is
done at your own discretion and risk. Oracle shall have no responsibility for any damage to your computer
system or loss of data that results form the download of any content, materials, information or software.

Das könnte Ihnen auch gefallen