Ignore Pricing for Quote/Order Lines
This is done by using oracle's user hook QP_CUSTOM_IGNORE.IGNORE_ITEMLINE_FOR_PRICING.
I have implemented the same in one of my client. I am sharing my learning below.
When
we setup a price list line we use the product attribute as Item Number,
Item Category, and All Items. We normally use All Items to apply the
same price to all items in your product hierarchy.
In real time
scenario, we need to price only certain number of quote/order items
using the pricing setup & for the remaining items the price is
picked either from some dummy pricelist that will carry certain price or
from the pricelist line of the product attribute “All Items” value as
0. These items are completely insignificant to pricing and no more
processing is required for these items in the pricing engine call other
than fetching a price from some dummy pricelist as explained above.
In
many organizations mostly the model items have lot of marketing or
manufacturing option items included which have no significance from
pricing perspective. Those are to complete the configuration of the
items. When we try to price those products, the lines from these items
are sourced to pricing for processing and after lot of unnecessary
processing; the prices fetched for these lines are zero. Due to this
these lines are actually extra burden on pricing and cause performance
issues unnecessarily. Especially in case of bigger orders significant
amount of time can be saved if pricing engine could ignore these lines.
The
Ignore Pricing custom hook provides users an opportunity to inform
pricing engine to ignore such lines that could result in substantial
performance gain. The benefit can be realized at real time scenario.
QP_CUSTOM_IGNORE
package contains the procedures IGNORE_ITEMLINE_FOR_PRICING which is
supplied by oracle. The IGNORE_ITEMLINE_FOR_PRICING is a customizable
code; need to be customized as per the requirement. It is called when
the profile value QP: Custom Ignore Pricing is set to ‘Y’. Pricing
engine calls it for each line while sourcing line level attributes. Line
structure will be available based on the p_request_type_code parameter
in the procedure.
For example OE_ORDER_PUB.G_LINE would be
available for ONT request_type_code & ASO_PRICING_INT.G_LINE_REC
would be available for ASO request_type_code.
Example:
Ignore the 0$ lines from the quote in order to improve the performance of the pricing call.
We have implemented the below logic in the Ignore Pricing custom hook (QP_CUSTOM_IGNORE. IGNORE_ITEMLINE_FOR_PRICING).
CREATE OR REPLACE PACKAGE BODY qp_custom_ignore
AS
PROCEDURE ignore_itemline_for_pricing (
p_request_type_code IN VARCHAR2,
x_ignore OUT VARCHAR2,
x_default_price_list_id OUT NUMBER
)
IS
l_price_attribute NUMBER;
BEGIN
IF p_request_type_code = 'ASO'
AND NOT (NVL (aso_pricing_int.g_header_rec.attribute_name, 'N') ='Y'
)
THEN
--Custom attribute defined in EGO for base price
l_price_attribute := xx_cus_pkg.get_custom_attribute;
IF NVL (l_price_attribute, 1) = 0
THEN
x_ignore := 'Y';
x_default_price_list_id :=
aso_pricing_int.g_header_rec.price_list_id;
ELSE
x_ignore := 'N';
x_default_price_list_id :=
aso_pricing_int.g_header_rec.price_list_id;
END IF;
ELSE
x_ignore := 'N';
x_default_price_list_id := aso_pricing_int.g_header_rec.price_list_id;
END IF;
EXCEPTION
WHEN OTHERS
THEN
x_ignore := 'N';
x_default_price_list_id := aso_pricing_int.g_header_rec.price_list_id;
END ignore_itemline_for_pricing;
END qp_custom_ignore;
Thank you friend for sharing this oracle query.
ReplyDelete