O acleApp Blog
Home Gallery Categories Archives Feeds Links Contact About
A b ou t
This web log documents the daily experiences and learnings of Oracle Applications C onsultants and Implementor's. OracleAppsBlog was founded by Richard Byrom, an Oracle Applications C onsultant, Speaker and Author. This Blog has been categorised according to the different industries and modules that apply to Oracle Applications. Should you wish to participate as an author for a related module or category please register as a member and mail me to let me know which category you would like to write under. Richard also hosts another blog entitled WebDesignBlog - a web log and portal dedicated to the design and build of web sites.
Scenario:
Apply 10% Margin on cost of the item. (Costing Method = Standard)
S y n di ca t e
RSS 1.0 RSS 2.0 (full text with comments) Atom (full text) del.icio.us (link blog) furl
St ep 2: Define Formula
Define a Pricing Formula and source a formula line as Function. Nav igation: Pricing Form ulas > Form ulas Setup
St ep 3: Find Formula id
Find the Formula_id using Examine Feature.
oracleappsblog.com/ /get-custom-price-api-the-power-of-oracle-advanced 1/4
12/22/11
All the parameters are passed to the function b the Pricing Engine and can be used in the function bod . OE_ORDER_PUB.G_LINE.line_id and other global variables can be used in the package bod to reference an order line and to retrieve information specific to current order line.
A typical Get_Custom_Price package body may look like: CREATE OR REPLACE PACKGE BODY QP_CUSTOM AS FUNCTION get_custom_price( P_pricing_formula_id IN NUMBER, P_list_price IN NUMBER, P_price_effective_date IN DATE, P_req_line_attrs_tbl IN qp_formula_pricecalc_pvt.req_line_attrs_tbl) RETURN NUMBER IS L_item_cost NUMBER; L_item_id NUMBER; L_organi ation_id NUMBER; C_cost_plus_formula CONSTANT NUMBER := 6248; BEGIN L_item_id := OE_ORDER_PUB.G_LINE.inventor _item_id; L_organi ation_id := OE_ORDER_PUB.G_LINE.ship_to_org_id; If p_price_formula_id = c_cost_plus_formula THEN SELECT item_cost INTO l_item_cost FROM CST_ITEM_COST_TYPE_V WHERE inventor _items_id = l_inventor _item_id AND organi ation_id = l_organi ation_id AND cost_t pe_id = 1; End if; RETURN l_item_cost; WHEN OTHERS RETURN NULL; END get_custom_price; END qp_custom;
1. Suv,
Most r ecen t en t r i es
Get_C ustom_Price() API : The Power of Oracle Advanced Pricing
Mon t h l y A r ch i v es
May 2009 August 2008 April 2008 March 2008 February 2008 January 2008 November 2007 September 2007 June 2007 February 2007 January 2007 November 2006 October 2006 September 2006 July 2006 June 2006 May 2006 April 2006 March 2006 February 2006 November 2005 October 2005 September 2005 August 2005
oracleappsblog.com/
/get-custom-price-api-the-power-of-oracle-advanced
2/4
12/22/11
July 2005 June 2005 May 2005 April 2005 March 2005 February 2005 January 2005 December 2004 November 2004 October 2004 September 2004 August 2004 July 2004 June 2004 C omplete Archives C ategory Archives
Very neat article. In your get_custom_price function example you have used ----L_item_id := OE_ORDER_PUB.G_LINE.inventory_item_id; L_organization_id := OE_ORDER_PUB.G_LINE.ship_to_org_id; -----We did the exact same thing on a project and I wanted to share our learning from it. This works very well when one line is priced. However if you are pricing an entire order (say using Price Order), then OE_ORDER_PUB.G_LINE structure can keep information on only one line, and regardless of which line is being priced by QP (since OM submits the entire batch to QP together) you will get the same item number and Warehouse (usually the one pertaining to the line where your cursor is, or the last line). As I said, we made the same mistake, and learnt that we should only use Pricing/Qualifier Attributes in Get Custom Price. The other obvious advantage of using just the Pricing/Qualifier Attribute is that you can use the same function regardless of which module is trying to price (in our case Order Capture, iStore etc used the same price list). Again this was a very well written and educating article. regards, Pankaj
Poste d by Pank aj Jain on 12/26 at 10:39 PM
2. I ve put the profile QP: Get Custom Price Customized to Yes and when I go
to the Formula Setup form, I can t get the formula type function appearing even if the lookup for it is enabled. Any idea on how to resolve this issue?
Email:
Location:
URL:
h p://
Smileys
<b> <i> < > q o e code @ <a> Clo e Tag
oracleappsblog.com/
/get-custom-price-api-the-power-of-oracle-advanced
3/4
12/22/11
Remembe m pe
S bmi
Pre ie
Ne en : Ba ic V Ad anced P icing o e p ice b eak ba ed on Weigh ?
P e io
Thi
en
page ha
Po e e d b
E p e
oracleappsblog.com/
/get-custom-price-api-the-power-of-oracle-advanced
4/4