HOW to Use QP_PREQ_PUB.PRICE_REQUEST API to Price an Item

In this Document

Goal
  Solution
  References

APPLIES TO:

Oracle Advanced Pricing - Version 11.5.10 and later
Information in this document applies to any platform.

GOAL

This note describes how the QP_PREQ_PUB.PRICE_REQUEST API can be called to obtain the Price of an item.

SOLUTION

 

 

 

The following is an example of how the QP_PREQ_PUB.PRICE_REQUEST API can be called to obtain the Price of an item

Examples described in this note will use the following attributes - this has been tested using data set up in a Vision instance. You will need to change data as appropriate to your environment.

NB - is important to ensure that the pricing phase on the modifier line matches the pricing event used when calling the API.

For example if the pricing phase on the modifier is -- All Line Adjustments then to apply the modifier -- p_control_rec.pricing_event :='BATCH'; or alternatively change the pricing phase to -- List Line adjustments (note that setting the phase to the value will cause the pricing engine to update the price whenever the order line is changed and may have an impact on performance).

Pricing Attributes

1. Item priced is Inventory Item ID - 307627

Qualifier Attributes
1. Price List is Price List ID - 54824
2. Customer is Customer ID - 16071

A Modifier has been created where:
1. The Modifier is qualified at Header Level by the Customer ID - 16071
2. The Line on the modifier is qualified by pricing attribute - Inventory Item is 307627

Price List
1. For Testing purposes I have not included the Inventory Item ID -- 307627 on the price list - 54824
2. The Price List does however include an ALL_ITEMS value which sets the price to 1.23

When Calling the PRICE_REQUEST API, I have passed the following values.

1. ALL_ITEMS pricing attribute which will be used to return a price from the price list if the item has not been included on the price list. This will only return a price if the Price List has a value for ALL_ITEMS.

line_attr_rec.LINE_INDEX    := 1;
line_attr_rec.PRICING_CONTEXT    :='ITEM'; 
line_attr_rec.PRICING_ATTRIBUTE   :='PRICING_ATTRIBUTE3';
line_attr_rec.PRICING_ATTR_VALUE_FROM   :='ALL';
line_attr_rec.VALIDATED_FLAG    :='N';
p_line_attr_tbl(1)    := line_attr_rec;

2. The Inventory Item to be priced

line_attr_rec.LINE_INDEX    := 1;
line_attr_rec.PRICING_CONTEXT    :='ITEM'; 
line_attr_rec.PRICING_ATTRIBUTE   :='PRICING_ATTRIBUTE1';
line_attr_rec.PRICING_ATTR_VALUE_FROM   :='307627';                  -- INVENTORY ITEM ID
line_attr_rec.VALIDATED_FLAG    :='N';
p_line_attr_tbl(2)    := line_attr_rec;

---- Qualifier Attribute Record

3. The Price List used to price the item

qual_rec.LINE_INDEX     := 1; 
qual_rec.QUALIFIER_CONTEXT    :='MODLIST';
qual_rec.QUALIFIER_ATTRIBUTE    :='QUALIFIER_ATTRIBUTE4';
qual_rec.QUALIFIER_ATTR_VALUE_FROM   :='54824';                     -- PRICE LIST ID
qual_rec.COMPARISON_OPERATOR_CODE   := '=';
qual_rec.VALIDATED_FLAG    :='Y';
p_qual_tbl(1)     := qual_rec;

4. Customer Qualifier will be used to determine (in this test) which modifier is to be used.

qual_rec.LINE_INDEX     := 1;
qual_rec.QUALIFIER_CONTEXT    :='CUSTOMER';
qual_rec.QUALIFIER_ATTRIBUTE    :='QUALIFIER_ATTRIBUTE2';
qual_rec.QUALIFIER_ATTR_VALUE_FROM   := 16071 ;   -- CUSTOMER ID;
qual_rec.COMPARISON_OPERATOR_CODE   := '=';
qual_rec.VALIDATED_FLAG    :='Y';
p_qual_tbl(2)     := qual_rec;

The following Script will create a procedure called XX_TEST_PRICE_REQUEST ---  PRICE_REQUEST_API_EXAMPLE.sql 

Do the following to run the script from a SQL*Plus session

SQL> Set Serveroutput on size 100000
SQL> Exec XX_TEST_PRICE_REQUEST

This should then return output similar to:

File : /usr/tmp/l5027518.dbg
Return Status text Routine: QP_PREQ_PUB.PRICE_REQUEST SUCCESS
Return Status  S
+---------Information Returned to Caller---------------------+
-------------Request Line Information-------------------
Line Index: 1
Unit_price: 1.23
Percent price:
Adjusted Unit Price: .615
Pricing status code: UPDATED
Pricing status text:
-----------Pricing Attributes Information-------------
Line detail Index 3
Context ITEM
Attribute PRICING_ATTRIBUTE1
Value 307627
Status Code
---------------------------------------------------
Line detail Index 2
Context ITEM
Attribute PRICING_ATTRIBUTE3
Value ALL
Status Code
---------------------------------------------------
-----------Qualifier Attributes Information-------------
Line Detail Index 3
Context CUSTOMER
Attribute QUALIFIER_ATTRIBUTE2
Value 16071
Status Code N
---------------------------------------------------
------------Price List/Discount Information------------
Line Index: 1
Line Detail Index: 2
Line Detail Type:NULL
List Header Id: 54824
List Line Id: 189859
List Line Type Code: PLL
Adjustment Amount : 1.23
Line Quantity :
Operand Calculation Code: UNIT_PRICE
Operand value: 1.23
Automatic Flag: Y
Override Flag:
status_code: N
status text: INSERTED IN L_LIST_CUR
-------------------------------------------
Line Index: 1
Line Detail Index: 3
Line Detail Type:NULL
List Header Id: 191260
List Line Id: 221749
List Line Type Code: DIS
Adjustment Amount : -.615
Line Quantity :
Operand Calculation Code: %
Operand value: 50
Automatic Flag: Y
Override Flag: N
status_code: N
status text: PRODUCT_QUALIFIER_ONLY
-------------------------------------------
--------------Related Lines Information for Price Breaks/Service
Items---------------

PL/SQL procedure successfully completed.


The Important Elements shown here are:

1. /usr/tmp/l5027518.dbg     --  additional debug information is located in this file

The following information is shown in the debug file:
2. Request Line Information     --  Shows the price returned by the API
3. Pricing Attributes Information --  Shows Pricing Attributes used to determine the price -- Note only the attributes use

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值