Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Document 833793.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-stat...

Copyright (c) 2019, Oracle. All rights reserved. Oracle Confidential.

How Can One Setup a Freight Charge That is Recalculated Based On Actual Shipped Quantity? (Doc ID
833793.1)

In this Document

Goal
Solution
References

APPLIES TO:

Oracle Order Management - Version 11.5.9 and later


Information in this document applies to any platform.

GOAL

How to setup a freight charge modifier so that it is based on the actual shipped quantity.

This is needed for scenarios where the actual shipped quantity varies from the ordered quantity.

SOLUTION

A. Wait and follow Enhancement Request Bug 3780582 - FREIGHT IS APPLIED BY ORDER QTY AND NOT SHIPPED QTY. Refer to Note
283065.1.

OR test a potential workaround noting that it may not work for all environments.

B. Potential Workaround

Note: For cases where the ordered quantity cannot be the returned quantity since the shipped quantity is always less or more than the
ordered quantity, this is not an appropriate workaround.

As confirmed in Bug 16603036, this workaround is not appropriate for proration of charges on Return lines when using the
Under Ship Tolerance or Over Ship Tolerance.
Only on cancellation, the proration on return does not happen. Under Shipment Tolerance means, we are allowing a tolerance to under-
ship the item but not actually cancelling the remaining quantity. For this scenario, follow Enhancement Request Bug 2519494 - IF OVER
SHIPPED THE CHARGES AND PRICES ARE NOT GETTING UPDATED IN OM

One may be able to work around this problem by not using Amount based freight charge, but using a lump sum with a formula equal to
nvl(shipped_quantity, ordered_quantity) * charged_amount_per_quantity.
Whereas charged_amount_per_quantity represents how much one wishes to charge for freight for 1 quantity shipped. This would be a fixed
rate such as $.03.

To implement, please execute the following steps:

1. One will need to create the following custom package/function to accomplish this desired functionality. The following text is sample SQL
used on an internal instance. This is only a sample and should be used to develop your own package/function to meet your needs. Due to
the fact this is a customized package, it is the customer's responsibility to thoroughly test, correct as needed and to maintain the package.

CREATE OR REPLACE PACKAGE XX_SHIPPED_QUANTITY_PUB AS


FUNCTION XX_shipped_quantity_nbr(p_line_id IN NUMBER) RETURN NUMBER;
END XX_SHIPPED_QUANTITY_PUB;
/

1 of 4 19-Feb-19, 5:24 PM
Document 833793.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-stat...

CREATE OR REPLACE PACKAGE BODY XX_SHIPPED_QUANTITY_PUB AS


FUNCTION XX_shipped_quantity_nbr (p_line_id IN NUMBER) RETURN NUMBER IS
p_new_quantity_nbr number;
CURSOR get_quantity_shipped_cur(l_line_id NUMBER) IS
Select shipped_quantity
From oe_order_lines_all
Where line_id = l_line_id;
BEGIN
OPEN get_quantity_shipped_cur(p_line_id);
FETCH get_quantity_shipped_cur INTO p_new_quantity_nbr;
CLOSE get_quantity_shipped_cur;
RETURN p_new_quantity_nbr;
EXCEPTION
WHEN OTHERS THEN
RETURN NULL;
END XX_shipped_quantity_nbr;
FUNCTION XX_ordered_quantity_nbr (p_line_id IN NUMBER) RETURN NUMBER IS
p_ordered_nbr number;
CURSOR get_quantity_ordered_cur(l_line_id NUMBER) IS
Select ordered_quantity
From oe_order_lines_all
Where line_id = l_line_id;
BEGIN
OPEN get_quantity_ordered_cur(p_line_id);
FETCH get_quantity_ordered_cur INTO p_ordered_nbr;
CLOSE get_quantity_ordered_cur;
RETURN p_ordered_nbr;
EXCEPTION
WHEN OTHERS THEN
RETURN NULL;
END XX_ordered_quantity_nbr;
End XX_SHIPPED_QUANTITY_PUB;
/
Commit;

2. Create Context and Attributes:


Responsibility: Oracle Pricing Manager
Navigate to: Setup > Attribute Management > Context and Attributes

3. Do a FIND on: type = Pricing Context, Code = Pricing Attribute


Add a record for:
Code = KS_SHIPD_QTY (or whatever you wish to name it)
Name = KS_SHIPD_QTY
Description – Actual shipped quantity
Column Mapped = Pricing_attribute20 <select next available pricing_attributeXX>
Value Set = QP: Number
Save.

4. Add another record for:


Code = KS_ORDERD_QTY (or whatever you wish to name it)
Name = KS_ORDERD_QTY
Description – ordered quantity
Column Mapped = Pricing_attribute21 <select next available pricing_attributeXX>
Value Set = QP: Number
Save and exit the forms.

5. Do attribute mapping
Responsibility: Oracle Pricing Manager
Navigate to: Setup > Attribute Management > Attribute Linking and Mapping
FIND: Pricing Transaction Entity = Order Fulfillment,
Context type = Pricing Context
Place cursor on line that has Code = Pricing Attribute,
Click on “Link Attributes”

5.1 Add a line for Code = KS_SHIPD_QTY, level = LINE,


Attribute Mapping Method = Attribute Mapping
Click on “Attribute Mapping”
Add Application Name = Advanced Pricing for request type = ONT

2 of 4 19-Feb-19, 5:24 PM
Document 833793.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-stat...

Under Line Level:


Enter user source type = PL/SQL API
User Value String =
XX_SHIPPED_QUANTITY_PUB. XX_shipped_quantity_nbr(OE_ORDER_PUB.G_LINE.line_id)
Save.
Exit this form to return to the attribute mapping form.

5.2 Add a line for Code = KS_ORDERD_QTY, level = LINE,


Attribute Mapping Method = Attribute Mapping
Click on “Attribute Mapping”
Add Application Name = Advanced Pricing for request type = ONT
Under Line Level:
Enter user source type = PL/SQL API
User Value String =
XX_SHIPPED_QUANTITY_PUB. XX_ordered_quantity_nbr(OE_ORDER_PUB.G_LINE.line_id)
Save.
Exit the open pricing forms.

6. Run Build Attribute Mapping Rules


Responsibility = Oracle Pricing Manager
Navigate: Reports
Select 'single request' then 'OK'
Name: Build Attribute Mapping Rules
Submit Request

7. Create a pricing formula as follows.


Responsibility = Oracle Pricing Manager
Navigate: Pricing Formulas > Formula Setup
formula = nvl(1,2) * 3
step 1 pricing attribute KS_SHIPD_QTY
step 2 pricing attribute KS_ORDERD_QTY
step 3 numeric constant .03 --This is the step represents how much one wishes
to charge for freight for 1 quantity shipped.
Save.

8. Run Build Formula Package


While still on the pricing formula form, select Tools > Build Formula Package.

9. Add the new formula to your line level freight charge modifier.
Responsibility = Oracle Pricing Manager
Navigate: Modifiers > Modifier Setup
Use the new formula as listed above.
Ensure the pricing phase selected includes the reprice line event.

10. Run QP: Maintains Denormalized Data in QP Qualifiers (for this modifier)
Responsibility = Oracle Pricing Manager
Navigate: Reports
Select 'single request' then 'OK'
Name: QP: Maintains the denormalized data in QP Qualifiers
Parameters:
Enter the list header id (low) by selecting the modifier from the LOV (list of values).
Enter the list header id (high) by selecting the modifier from the LOV.
Click OK then Submit Request

11. Test with a brand new sales order that uses workflow 'Line Flow - Generic, with Reprice at Fulfillment'.

Upon entering the order line, the ordered quantity is used to determine the freight charge.

Next ensure that the calculate price flag on the order line is set to calculate price or partial price or that the workflow is
setup as such so that the value of the calculate price flag is ignored before ship confirming the order line
(attribute called 'Honor Calculate Price Flag' within activity 'Reprice - Line'. Refer to Note 397355.1).

Next partially ship as such that it is within the order line's shipping tolerance but varies from the ordered quantity.

3 of 4 19-Feb-19, 5:24 PM
Document 833793.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-stat...

Before the line is closed the freight charge will be updated to reflect the freight charge based on the shipped quantity.

Note: This business requirement can be quite complex as one would need to consider
many aspects such as the pricing events associated to the pricing phase assigned
to the modifier and how they impact the promotion's application at shipping, impacts
of the setup chosen when a line is backorderd and a system split occurs on the order line, and
how returns will be handled since they are based off the ordered quantity versus shipped quantity, etc.
Hence it is the customer's responsibility to thoroughly test the functionality suggested above to
ensure it is an acceptable workaround.

Please note that it is outside the realm of Support to fully map the business requirements
to product functionality, assisting with custom queries and customizations that would be
necessary. For detailed assistance, one would need to contact your development department, 3rd party consulting,
or Oracle Consulting at http://www.oracle.com/consulting/index.html

12. If this solution meets your business needs, migrate the solution as appropriate to other environments.

REFERENCES

NOTE:397355.1 - How Does One Reprice The Order During Ship Confirmation Process ?
BUG:16603036 - PREVENT FREIGHT CHARGE PRORATION ON THE RETURN LINES

BUG:3780582 - FREIGHT IS APPLIED BY ORDER QTY AND NOT SHIPPED QTY.


NOTE:283065.1 - Freight Charge Is Applied By Order Quantity And Not Shipped Quantity
Didn't find what you are looking for?

4 of 4 19-Feb-19, 5:24 PM

You might also like