You are on page 1of 43

Depot Repair Field Service Install Base Service Contracts Service Fulfillment Manager Spares Management

Oracle Product Lifecycle Management . Oracle Advanced product Catalog

Telesales Trade Management Incentive Compensation Order Capture Partners Online

Develop Service & Maintain Market


Advanced Supply Chain Planning Global Order Promising

Release Management Shipping Execution Inventory Management WMS Transportation Execution

Fulfill

Plan

Manufacture

Cost Management Configure to Order Process Manufacturing Project Manufacturing Quality Work in Process
Purchasing iProcurement

Procure

Sell & Manage Orders

Order management Advanced Pricing Configurator iStore

Oracle Supply Chain Management Solutions

Oracle Order Management

Enter Order and Line details

Oracle Advanced pricing


Price the Order

Oracle Shipping Execution

Oracle Transportation Management Ship Confirm

Oracle Global ATP


Check Availability, Schedule Order

Oracle Mobile Supply Chain Application


Pick Confirm

Oracle Order Management Oracle Shipping Execution


Pick Release the Order Book the Order

Oracle WMS

Oracle INV

Modifiers enable you to set up price adjustments (for example, discounts and surcharges), benefits (for example, free goods, coupons) and freight and special charges that can be applied to the Price list lines.

Qualifiers determine who is eligible for certain Price List or modifier.


Price List Line 100 Item=AS5987 Price=$100

Price lists contain item and item category prices.

Modifiers enable you to set up price adjustments (for example, discounts and surcharges), benefits (for example, free goods, coupons) and freight and special charges that can be applied to the Price list lines.

Qualifiers determine who is eligible for certain Price List or modifier.

Price lists contain item and item category prices.

Price lists contain item and item category prices along with Currency, Round To, default Payment Terms, default Freight Terms, default Freight Carrier information. A negative Round To number indicates number of places to the right of the decimal point.

Details about the related Blanket Sales Agreement: can be found in Other tab as.. Blanket Document Number, Pricing Transaction Entity, Source System Code etc.

Select Line Types as Price List Line: To enter a base list price for the item. Application Method is populated as Unit Price: Defines the price for inventory items and item categories You can define the following types of prices on price lists: Unit price: A fixed price. Percent Price: A price which is a percent of the price of another item (for service items only) Formula: Multiple pricing entities and constant values related by arithmetic operators. Price Break: If the price of an item varies with the quantity ordered, you can define bracket pricing or price breaks.

Select Line Type as Price Break Header: Select the Price Break Type as.. Point: The pricing engine charges each unit of volume at the price of the within which the total falls. Range: The pricing engine charges each unit of volume at the price of the within which it falls. Choose an Application Method: Block Price: Defines the price for the entire set of a block. Unit Price: Defines the price for inventory items and item categories Block pricing enables you to apply a lumpsum price rather than a per unit price to a pricing line. Eg: For Point break type, if you ordered 25 units, the total quantity falls into the Price 2nd bracket where the unit price is $90. So the total price is calculated as follows: Total price = 20 * $90 each = $1800 If the Price Type is Point: The price is not returned if the ordered quantity does not fall in the price range of the price list. If the Price Type is Range: A price of 0 is retrieved for the ordered quantity that does not fall in the price range. Eg: For Range break type with Block pricing, To charge $10 for 0 to 1200 items with recurring price 100. When a recurring value is used with price breaks, the Block price repeats for every interval defined by the Recurring Value column. So for the first 1200 units, the price is $10 for each 100 units up to 1200 units. For 1201 units and more, you could create a second price to define a price of $30 for each 100 units. So if 1300 units were purchased, the total cost would be as follows: Block price 1: Price for first 1200 (1200/100= 12 X $10): $120 (first price break) Block price 2: Price for each additional block of 100 units beginning with 1201 units: $30 (second price break). Total $150

We shall discuss the Pricing Context and Pricing attributes later.

If the item you are ordering is not in the primary price list, the pricing engine looks for the price on any attached secondary price list. If the item is found, the pricing engine uses the highest precedence secondary price list (the secondary price list with the lowest value in the Precedence field). Qualifiers determine who is eligible for certain Price List. Enter a qualifier Grouping Number. Qualifier lines with the same grouping number generate an AND condition and qualifiers with different grouping numbers generate an OR condition. To make a qualifier mandatory for all qualifying conditions, you can use a qualifier grouping number of -1.

We shall discuss the Qualifier Context & Qualifier attributes later.

QP_LIST_HEADERS_B LIST_HEADER_ID LIST_TYPE_CODE START_DATE_ACTIVE END_DATE_ACTIVE AUTOMATIC_FLAG CURRENCY_CODE ROUNDING_FACTOR SHIP_METHOD_CODE FREIGHT_TERMS_CODE TERMS_ID COMMENTS DISCOUNT_LINES_FLAG GSA_INDICATOR PRORATE_FLAG SOURCE_SYSTEM_CODE QP_LIST_LINES LIST_LINE_ID LIST_HEADER_ID

LIST_LINE_TYPE_CODE
QP_PRICING_ATTRIBUTES PRICING_ATTRIBUTE_ID LIST_HEADER_ID LIST_LINE_ID PRICING_PHASE_ID EXCLUDER_FLAG ACCUMULATE_FLAG PRODUCT_ATTRIBUTE_CONTEXT PRODUCT_ATTRIBUTE PRODUCT_ATTR_VALUE PRODUCT_UOM_CODE START_DATE_ACTIVE END_DATE_ACTIVE AUTOMATIC_FLAG MODIFIER_LEVEL_CODE PRICE_BY_FORMULA_ID LIST_PRICE LIST_PRICE_UOM_CODE PRIMARY_UOM_FLAG INVENTORY_ITEM_ID ORGANIZATION_ID

PRICING_ATTRIBUTE_CONTEXT
PRICING_ATTRIBUTE PRICING_ATTR_VALUE_FROM PRICING_ATTR_VALUE_TO

A set of Qualifiers are seeded in Adv Pring viz:

Qualifiers determine who is eligible for certain modifier. Qualifiers may be grouped to create AND/OR conditions using grouping numbers. Qualifiers with the same group number create AND conditions. Qualifier groups with different numbers create OR conditions. To make a qualifier mandatory for all qualifying conditions, you can use a qualifier grouping number of -1. When qualifier group is selected, all the qualifiers in the qualifier group are attached to the modifier or price list.

QP_QUALIFIERS QUALIFIER_ID QUALIFIER_RULE_ID LIST_HEADER_ID LIST_LINE_ID QUALIFIER_GROUPING_NO QUALIFIER_CONTEXT QUALIFIER_ATTRIBUTE QUALIFIER_ATTR_VALUE COMPARISON_OPERATOR_CODE

Here is an example of a qualifier usage.. Create a Discount list modifier. Click on List qualifier to show the eligibility criteria for this modifier to be applied.

Qualifiers determine who is eligible for certain modifier. Qualifiers may be grouped to create AND/OR conditions using grouping numbers. Qualifiers with the same group number create AND conditions. Qualifier groups with different numbers create OR conditions. To make a qualifier mandatory for all qualifying conditions, you can use a qualifier grouping number of -1.

Modifiers enable you to set up price adjustments (for example, discounts and surcharges), benefits (for example, free goods, coupons) and freight and special charges that can be applied to the Price list lines.

We can create eligibility rules for modifiers by assigning list and line level qualifiers.
Control features that influence modifiers are products and product groups, pricing attributes, phases, incompatibility groups, levels, and buckets. The Global box is selected when the Pricing Security Control profile option is set to ON. This means that the price list can be used by all operating units for pricing transactions. If cleared, the price lists use is restricted to the operating unit of the user creating the price list.

Modifiers enable you to set up price adjustments (for example, discounts and surcharges), benefits (for example, free goods, coupons) and freight and special charges that can be applied immediately to pricing requests or accrues for later disbursement. You can create the following modifier list types: Deal Discount List Freight and Special charge List Promotion Surcharge List If Automatic box is selected, the pricing engine automatically applies the modifier If cleared, then the modifier is considered a manual modifier and the adjustment must be applied manually rather than automatically.

The Ask for box is only available for modifier list types of Deal and Promotion. This means the customer must specifically request that the modifier benefit be applied List Source Document Number: This is the Blanket Number of the blanket sales agreement associated with the modifier. List Source Code: Displays the code associated with the modifier source. For example, BSO indicates Blanket Sales Order. Pricing Transaction Entity (PTE): Displays the pricing transaction entity associated with the modifier. The Pricing Transaction Entity value defaults from the PTE that created the modifier. This field cannot be updated. Source System Code: Displays the source system code of the modifier such as QP for pricing. Shareable box: Indicates if the modifier is shared or not. If nonshareable (the default), then this modifier is specific to that blanket and cannot be used with other blanket sales agreements.

Modifier No field is populated with a default modifier number which identifies the modifier line and is unique. Modifier application Level: Order: If the line is eligible to receive the modifier, the pricing engine applies the modifier at the order level. Line: If the line is eligible to receive the modifier, the pricing engine applies the modifier at the line level. Group of Lines: If the pricing request is eligible to receive the modifier, the pricing engine considers the item quantity or item amount consumed for a group of order lines. Modifier Line Types: Discount: Creates a negative price adjustment such as a 10% discount. Freight/Special Charge: Applies a freight charge. Coupon Issue: Issues a coupon on one order that the customer can redeem for a price adjustment or benefit on a later order. Item Upgrade: Replaces a specific item ordered with another item for the same price. Other Item Discount: Gives a price adjustment or benefit to a specified item on an order when the customer orders one or more other items on the same order. Price Break Header: Applies a variable discount or surcharge price adjustment to a pricing request based meeting the condition of a break type. You can use both point and range type breaks. Promotional Goods: Adds a new item with a price adjustment or benefit when the customer orders one or more other items on the same order. Surcharge: Creates a positive price adjustment. Term Substitution: Replaces freight charges, shipping charges, and payment terms with typically more favorable charges.

Select a Product Attribute value such as Item Number, Item Category, or All Items. Use All Items to define a modifier that applies to all items in your product hierarchy. Select a Product Attribute Value. If you select ALL_ITEMS for Product Attribute, the Product Attribute Value is ALL. The Precedence value will default based on the Product Attribute Value. This value can be updated.

Enter a Volume Type such as Item Quantity and Item Amount to instruct the pricing engine which item attribute to use when qualifying for a modifier. Select an Operator value such as = or BETWEEN
To create greater than and less than conditions, leave From Value and To Value blank, as follows: From Value = 5 and To Value blank creates the condition Value > 5 From Value blank and To Value = 100 creates the condition Value < 100 From Value = 5 and To Value = 100 creates the condition Value >= 5 and value <= 100Enter the Value From/To. Select either Point or Recurring as the Break Type. If point break is chosen then the modifier line will be applied only once. If RECURRING is selected, then it will be accumulated as Recurring break type with the following values, for example, where Value from =10 application method =PERCENT and value=2. So if a sales order is created with order quantity 20, then 4%discount is applied

Modifier application methods: Percent: Creates a percentage price adjustment on each unit based on the percentage entered in the Value field. For example, to apply a 10% discount, select Percent as the Application Method. Amount: Creates a fixed price adjustment on each unit using the amount entered in the Value field. Lumpsum: Creates a price adjustment for this lump sum amount on the entire line. New price: Overrides the selling price of this item and makes the new price defined in the Value field the new selling price. Creates a price adjustment for the difference in list price and the new price.

Accrual: Complete the remaining fields to enter an accrual: 1. Accrue: Select Accrue check box to enter accrual information. 2. Benefit Qty and Benefit UOM: Enter Benefit Qty and Benefit UOM of the benefit to be accrued. Use the benefit columns to define nonmonetary accruals. 3. Expiration Date: Defines when the accrued transactions expire. 4. Expiration Period and Period Type: The pricing engine calculates the expiration date. The Expiration Period begins when item begins to accrue. 5. Accrual Redemption Rate: You can enter or modify the redemption rate after the Accrue box is selected. 6. Accrual Conversion Rate: Defines the conversion of the Benefit UOM to the primary currency. For example, if one air mile is 0.50 currency units, the accrual conversion rate is 0.50.
Assign a pricing phase and then assign an incompatibility group to each modifier line. Multiple incompatibility groups can be assigned to each pricing phase. Say, During the phase List Line Base Price, if the pricing engine selects more than one eligible price list line in the desired unit of measure, it resolves the incompatibility by picking the price list line having the lowest precedence number.

Have we discussed the Pricing phases and events?

Formula: Optionally, select a formula to calculate a discount, surcharge, or freight charge (a formula can be used with modifier line types of Discount, Surcharge or Price Break Header).

Have we discussed the Pricing Formulae yet?

QP_LIST_HEADERS_B LIST_HEADER_ID LIST_TYPE_CODE START_DATE_ACTIVE END_DATE_ACTIVE AUTOMATIC_FLAG CURRENCY_CODE ROUNDING_FACTOR SHIP_METHOD_CODE FREIGHT_TERMS_CODE TERMS_ID COMMENTS DISCOUNT_LINES_FLAG GSA_INDICATOR PRORATE_FLAG SOURCE_SYSTEM_CODE

QP_LIST_LINES LIST_LINE_ID LIST_HEADER_ID LIST_LINE_TYPE_CODE START_DATE_ACTIVE END_DATE_ACTIVE AUTOMATIC_FLAG MODIFIER_LEVEL_CODE PRICE_BY_FORMULA_ID LIST_PRICE LIST_PRICE_UOM_CODE PRIMARY_UOM_FLAG INVENTORY_ITEM_ID ORGANIZATION_ID

QP_PRICING_ATTRIBUTES PRICING_ATTRIBUTE_ID LIST_HEADER_ID LIST_LINE_ID PRICING_PHASE_ID EXCLUDER_FLAG ACCUMULATE_FLAG PRODUCT_ATTRIBUTE_CONTEXT PRODUCT_ATTRIBUTE PRODUCT_ATTR_VALUE PRODUCT_UOM_CODE PRICING_ATTRIBUTE_CONTEXT PRICING_ATTRIBUTE PRICING_ATTR_VALUE_FROM PRICING_ATTR_VALUE_TO

A pricing transaction entity (PTE) is defined for a group of Source Applications having various request types. Under ORDFUL Pricing transaction entity we have a source application called Adv Pricing having request type as ONT ie. Order management .

Contexts and attributes are used to define customer, pricing, and product hierarchies

Creating new pricing contexts and attributes enables you to create additional user-defined data sources for your pricing actions. For each attribute, you can select "User-Entered" as the attribute mapping method to derive the value for the attribute. User-entered means that the value is obtained when a user enters the value. In Basic Pricing, you can define new contexts for the Pricing Context, and new attributes for Pricing and Product contexts. You cannot create new contexts or attributes for the Qualifier context. Once you define a new context, you can also create its attributes.

Link attributes for the Qualifier context ADS Order. We have various info like supplier, ship method, order source etc. as various attributes for this qualifier. Enter the column names in pricing table to which these info are mapped. If the attribute mapping method is user entered then the system waits for data to be entered by the user, else if it is Attribute mapping then click on the attribute mapping button below to see how the information is derived. Click on Adv Pricing application and view the derivation logic below. It can be derived from Header or line level. Check the user value string ie. OE_ORDER_PUB.G_Line.Shipping_method_code

While creating a Price list we are restricted to a LOV for the Pricing or product or qualifier context attribute. Lets see how those LOVs are set up.

Navigate to the context setup and search a qualifier context say Customer. It has various attributes like Name, ship to, sales channel etc. Click on the value_set tbutton o view the table and column, it is referring to for validation
Eg. Customer name is selected from qp_customers_v view for the above customer attribute.

QP_PTE_SOURCE_SYSTEMS PTE_SOURCE_SYSTEM_ID PTE_CODE APPLICATION_SHORT_NAME ENABLED_FLAG

QP_PRC_CONTEXTS_B PRC_CONTEXT_ID PRC_CONTEXT_CODE PRC_CONTEXT_TYPE SEEDED_FLAG ENABLED_FLAG QP_SEGMENTS_B SEGMENT_ID SEGMENT_CODE PRC_CONTEXT_ID AVAILABILITY_IN_BASIC SEGMENT_MAPPING_COLUMN SEEDED_FLAG

Context Type Eg: Qualifier Context

APPLICATION_ID SEEDED_PRECEDENCE USER_PRECEDENCE SEEDED_VALUESET_ID

Context Code Eg. CUSTOMER

Context Code Eg. ADS_ORDER

USER_VALUESET_ID SEEDED_FORMAT_TYPE USER_FORMAT_TYPE REQUIRED_FLAG

Context Code Attribute Eg. Sold To Org

Context Code Attribute Eg. Order Source

Context Code Attribute Eg. Supplier

Context Code Attribute Eg. Shipment Method

QP_PTE_SEGMENTS

SEGMENT_PTE_ID
SEGMENT_ID PTE_CODE SEGMENT_LEVEL SOURCING_ENABLED SEEDED_SOURCING_METHOD USER_SOURCING_METHOD

SOURCING_STATUS
LOV_ENABLED LIMITS_ENABLED USED_IN_SETUP

QP_PTE_REQUEST_TYPES_B REQUEST_TYPE_CODE PTE_CODE ORDER_LEVEL_GLOBAL_STRUCT LINE_LEVEL_GLOBAL_STRUCT ORDER_LEVEL_VIEW_NAME QP_ATTRIBUTE_SOURCING LINE_LEVEL_VIEW_NAME ATTRIBUTE_SOURCING_ID ENABLED_FLAG SEGMENT_ID

REQUEST_TYPE_CODE
ATTRIBUTE_SOURCING_LEVEL APPLICATION_ID SEEDED_SOURCING_TYPE USER_SOURCING_TYPE SEEDED_VALUE_STRING USER_VALUE_STRING

SEEDED_FLAG
ENABLED_FLAG

QP_PTE_SEGMENTS SEGMENT_PTE_ID SEGMENT_ID PTE_CODE SEGMENT_LEVEL SOURCING_ENABLED SEEDED_SOURCING_METHOD USER_SOURCING_METHOD SOURCING_STATUS LOV_ENABLED LIMITS_ENABLED USED_IN_SETUP

QP_SEGMENTS_B SEGMENT_ID SEGMENT_CODE PRC_CONTEXT_ID AVAILABILITY_IN_BASIC SEGMENT_MAPPING_COLUMN SEEDED_FLAG APPLICATION_ID SEEDED_PRECEDENCE USER_PRECEDENCE SEEDED_VALUESET_ID USER_VALUESET_ID SEEDED_FORMAT_TYPE USER_FORMAT_TYPE REQUIRED_FLAG

Events are points in the process flow when the calling application sends a pricing request to the pricing engine (similar to a workflow event). The information that the pricing engine returns, for example, base prices, price adjustments, promotions, or freight charges, depends on the pricing phases of the event. For example, if you need to price sales orders at shipment, use the Reprice Line event and insert the Reprice Line workflow activity into the order process workflow to invoke the repricing. The pricing engine uses the price list and modifiers that are in effect at order entry to meet booking requirements such as credit check.

QP_PRICING_PHASES PRICING_PHASE_ID NAME MODIFIER_LEVEL_CODE

QP_EVENT_PHASES PRICING_EVENT_CODE PRICING_PHASE_ID START_DATE_ACTIVE

PHASE_SEQUENCE
INCOMPAT_RESOLVE_CODE SEEDED_FLAG FREEZE_OVERRIDE_FLAG USER_FREEZE_OVERRIDE_FLAG USER_INCOMPAT_RESOLVE_CODE LINE_GROUP_EXISTS OID_EXISTS RLTD_EXISTS FREIGHT_EXISTS MANUAL_MODIFIER_FLAG

SEARCH_FLAG
SEEDED_FLAG USER_SEARCH_FLAG

Formulas can be linked to a price list line or modifier line to: Create a price from a computation as an alternative to entering prices in a price list. Calculate a price adjustment. Like discount by attaching a formula to a discount line. Dynamic calculation: The list price resulting from the formula calculation is not calculated or stored anywhere until the sales order is entered with that Price List line item. When the sales order is entered, the pricing engine evaluates the formula and displays the final list price on the order. Static calculation: If the formula is attached to a price list line for static calculation of the final list price, you can run a concurrent program at any time to calculate the final list price using the formula up front (not wait until order entry time) and also store it in the price list. Enter a Formula expression. A formula consists of step numbers (such as 1, 2, 3) used in an arithmetic equation such as 1*2. A step number such as 1 in the formula expression corresponds to the formula line with the same step number in the Formula Lines region. Select one of the following Formula Types: List Price: The price of the item in a specific price list to which you have attached a formula. Numeric Constant: Enter the numeric constant in Component. Price List Line: A formula which has List Price as a component and is attached to a price list line gets the list price from the Value entered in a price list line. Modifier Value: Uses the value that is entered in the Value field of Define Modifier window. A formula which has a Modifier Value as a component cannot be attached to a price list line.

Pricing Attribute: Select the Pricing Attribute Context and Pricing Attribute. Function: The Component field displays GET_CUSTOM_PRICE. You must write the function in this PL/SQL package and it must return a number. Factor List: Select an existing factor list in Component field. To create a new factor list, type a new name in the Component field. When you complete your entries for the formula line, click Factors to create the factor criteria in the Factors window. GET_CUSTOM_PRICE parameters are: p_price_formula_id: Primary key of the formula that uses the Get_Custom_Price function. p_list_price: List price on the price list line to which the formula using Get_Custom_Price is attached. May be null. p_price_effective_date: Pricing Effective Date, the date for which the pricing engine is evaluating the formula. p_req_line_attrs_tbl: PL/SQL table of records containing context, attribute, and attribute value records for product and pricing attributes and a column indicating the type (Product Attribute or Pricing Attribute). The engine passes only the pricing and product Attributes of the price list line to which the formula is attached. The step numbers for a formula are available in the GET_CUSTOM_PRICE API.

Lets enter a factor list and define adjustment factor based on various Pricing context and attributes Click Factors to create factor criteria. Select a value for Base Pricing Attribute Context. If you have multiple entries, you must use the same base context in this region (to create an OR condition); the pricing engine chooses one of the entries. Use the Associate Pricing Attributes region to associate additional contexts with the base context (to create an AND condition where both attributes must be present to qualify). Select a value for Base Pricing Attribute. Select a comparison Operator and enter the Value From/To. Enter the Adjustment Factor. An adjustment factor enables you to adjust the price based on the options selected. For example, if you are selling cars, you could use adjustment factors to adjust the price based on the car options the customer chooses: If the car options are Standard then the price is multiplied by 1 (factor=1) If the car options are Business then the price is multiplied by 1.5 (factor=1.5) If the cars you are selling are second hand, you probably want to adjust the price further based on the age of the car. For example: If the car is between 1.1 and 3.0 years old, the price is multiplied by 0.8. If the car is older than 3.0 years, the price is multiplied by 0.6. In the Associate Pricing Attributes region, select an Associated Pricing Attribute Context and Associated Pricing Attribute to associate with the base pricing attribute context and base pricing attribute values (to create an AND condition).

Updating Formula Prices We need to use this process to use static formulas to set list prices. When you attach a formula to a price list line, you can select from the following calculation methods: Dynamic calculation: When you enter an order the pricing engine uses the formula to calculate list price. Static calculation: Prior to order entry, you execute a concurrent process which calculates the list price. Every time a new formula expression is created, the concurrent program Build Formula Package should be run to generate the formula package. From the Tools menu, select Build Formula Package to run the program. For price list lines whose formulas have been added or changed from when they were last updated by this concurrent program, select New and Modified Lines Only of Price Lists. select Update Individual Pricing Formula for Price Lists, and select the specific Pricing Formula.

Sample script which inserts a Price List with 3 price list lines, and the product information for each of the lines(Product Information is stored in pricing attributes table in product attribute columns). This sample price list does not have any qualifiers or price breaks or non product-information type of pricing attributes. This script must be modified by the user such that the qpr_pricing_attr_ tbl(J).product_attr_value columns (for J = 1 to 3) are populated with 3 different valid inventory_item_id from the instance where this script is run. **************************************************************************** declare gpr_return_status varchar2(1) := NULL; gpr_msg_count number := 0; gpr_msg_data varchar2(2000); gpr_price_list_rec QP_PRICE_LIST_PUB.Price_List_Rec_Type; gpr_price_list_val_rec QP_PRICE_LIST_PUB.Price_List_Val_Rec_Type; gpr_price_list_line_tbl QP_PRICE_LIST_PUB.Price_List_Line_Tbl_Type; gpr_price_list_line_val_tbl QP_PRICE_LIST_PUB.Price_List_Line_Val_Tbl_Type; gpr_qualifiers_tbl QP_Qualifier_Rules_Pub.Qualifiers_Tbl_Type; gpr_qualifiers_val_tbl QP_Qualifier_Rules_Pub.Qualifiers_Val_Tbl_Type; gpr_pricing_attr_tbl QP_PRICE_LIST_PUB.Pricing_Attr_Tbl_Type; gpr_pricing_attr_val_tbl QP_PRICE_LIST_PUB.Pricing_Attr_Val_Tbl_Type; ppr_price_list_rec QP_PRICE_LIST_PUB.Price_List_Rec_Type; ppr_price_list_val_rec QP_PRICE_LIST_PUB.Price_List_Val_Rec_Type; ppr_price_list_line_tbl QP_PRICE_LIST_PUB.Price_List_Line_Tbl_Type; ppr_price_list_line_val_tbl QP_PRICE_LIST_PUB.Price_List_Line_Val_Tbl_Type; ppr_qualifiers_tbl QP_Qualifier_Rules_Pub.Qualifiers_Tbl_Type; ppr_qualifiers_val_tbl QP_Qualifier_Rules_Pub.Qualifiers_Val_Tbl_Type; ppr_pricing_attr_tbl QP_PRICE_LIST_PUB.Pricing_Attr_Tbl_Type; ppr_pricing_attr_val_tbl QP_PRICE_LIST_PUB.Pricing_Attr_Val_Tbl_Type; K number := 1; j number := 1; begin --dbms_output.put_line('after get price list '); /* set the list_header_id to g_miss_num */ gpr_price_list_rec.list_header_id := FND_API.G_MISS_NUM; gpr_price_list_rec.name := 'Sample1-PL 1024'; gpr_price_list_rec.list_type_code := 'PRL'; gpr_price_list_rec.description := 'Sample price list';

/* you can set the currency of price list to whatever, say FRA */ gpr_price_list_rec.currency_code := 'USD'; gpr_price_list_rec.operation := QP_GLOBALS.G_OPR_CREATE; FOR K IN 1..3 LOOP gpr_price_list_line_tbl(K).list_line_id := FND_API.G_MISS_NUM; gpr_price_list_line_tbl(K).list_line_type_code := 'PLL'; gpr_price_list_line_tbl(K).operation := QP_GLOBALS.G_OPR_CREATE; gpr_price_list_line_tbl(K).operand := 10; gpr_price_list_line_tbl(K).arithmetic_operator := 'UNIT_PRICE'; END LOOP; /* product_attr_value stores inventory item id - product_attribute for Item Number is Pricing_Attribute1 product_attribute_context is ITEM. Each line can have one or more pricing attributes. PRICE_LIST_LINE_INDEX is used to link the child (pricing attributes) to the parent(line). When you have pricing attributes like color, length, width etc, populate the fields pricing_attribute_context, pricing_attribute, pricing_attr_value_from, pricing_attr_value_to and comparison_operator_code ( '=' or 'between') and repeat the product_attr_value and its attribute and context for each record. */ J := 1; gpr_pricing_attr_tbl(J).pricing_attribute_id := FND_API.G_MISS_NUM; gpr_pricing_attr_tbl(J).list_line_id := FND_API.G_MISS_NUM; gpr_pricing_attr_tbl(J).PRODUCT_ATTRIBUTE_CONTEXT := 'ITEM'; gpr_pricing_attr_tbl(J).PRODUCT_ATTRIBUTE := 'PRICING_ATTRIBUTE1'; gpr_pricing_attr_tbl(J).PRODUCT_ATTR_VALUE := '62061'; gpr_pricing_attr_tbl(J).PRODUCT_UOM_CODE := 'Ea'; gpr_pricing_attr_tbl(J).EXCLUDER_FLAG := 'N'; gpr_pricing_attr_tbl(J).ATTRIBUTE_GROUPING_NO := 1; gpr_pricing_attr_tbl(J).PRICE_LIST_LINE_INDEX := 1; gpr_pricing_attr_tbl(J).operation := QP_GLOBALS.G_OPR_CREATE; J := J + 1; gpr_pricing_attr_tbl(J).pricing_attribute_id := FND_API.G_MISS_NUM; gpr_pricing_attr_tbl(J).list_line_id := FND_API.G_MISS_NUM; gpr_pricing_attr_tbl(J).PRODUCT_ATTRIBUTE_CONTEXT := 'ITEM'; gpr_pricing_attr_tbl(J).PRODUCT_ATTRIBUTE := 'PRICING_ATTRIBUTE1';

gpr_pricing_attr_tbl(J).PRODUCT_ATTR_VALUE := '62081'; gpr_pricing_attr_tbl(J).PRODUCT_UOM_CODE := 'Ea'; gpr_pricing_attr_tbl(J).EXCLUDER_FLAG := 'N'; gpr_pricing_attr_tbl(J).ATTRIBUTE_GROUPING_NO := 1; gpr_pricing_attr_tbl(J).PRICE_LIST_LINE_INDEX := 2; gpr_pricing_attr_tbl(J).operation := QP_GLOBALS.G_OPR_CREATE; J := J + 1; gpr_pricing_attr_tbl(J).pricing_attribute_id := FND_API.G_MISS_NUM; gpr_pricing_attr_tbl(J).list_line_id := FND_API.G_MISS_NUM; gpr_pricing_attr_tbl(J).PRODUCT_ATTRIBUTE_CONTEXT := 'ITEM'; gpr_pricing_attr_tbl(J).PRODUCT_ATTRIBUTE := 'PRICING_ATTRIBUTE1'; gpr_pricing_attr_tbl(J).PRODUCT_ATTR_VALUE := '62083'; gpr_pricing_attr_tbl(J).PRODUCT_UOM_CODE := 'Ea'; gpr_pricing_attr_tbl(J).EXCLUDER_FLAG := 'N'; gpr_pricing_attr_tbl(J).ATTRIBUTE_GROUPING_NO := 1; gpr_pricing_attr_tbl(J).PRICE_LIST_LINE_INDEX := 3; gpr_pricing_attr_tbl(J).operation := QP_GLOBALS.G_OPR_CREATE; --dbms_output.put_line('before process price list '); QP_PRICE_LIST_PUB.Process_Price_List ( p_api_version_number=> 1 , p_init_msg_list=> FND_API.G_FALSE , p_return_values=> FND_API.G_FALSE , p_commit=> FND_API.G_FALSE , x_return_status=> gpr_return_status , x_msg_count=> gpr_msg_count , x_msg_data=> gpr_msg_data , p_PRICE_LIST_rec=> gpr_price_list_rec , p_PRICE_LIST_LINE_tbl=> gpr_price_list_line_tbl , p_PRICING_ATTR_tbl=> gpr_pricing_attr_tbl , x_PRICE_LIST_rec=> ppr_price_list_rec , x_PRICE_LIST_val_rec=> ppr_price_list_val_rec , x_PRICE_LIST_LINE_tbl=> ppr_price_list_line_tbl , x_PRICE_LIST_LINE_val_tbl=> ppr_price_list_line_val_tbl , x_QUALIFIERS_tbl=> ppr_qualifiers_tbl , x_QUALIFIERS_val_tbl=> ppr_qualifiers_val_tbl , x_PRICING_ATTR_tbl=> ppr_pricing_attr_tbl , x_PRICING_ATTR_val_tbl=> ppr_pricing_attr_val_tbl ); IF gpr_return_status <> FND_API.G_RET_STS_SUCCESS THEN

RAISE FND_API.G_EXC_UNEXPECTED_ERROR; END IF; --dbms_output.put_line('after process price list '); EXCEPTION WHEN FND_API.G_EXC_ERROR THEN gpr_return_status := FND_API.G_RET_STS_ERROR; --Get message count and data --dbms_output.put_line('err msg 1 is : ' || gpr_msg_data); Rollback; WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN gpr_return_status := FND_API.G_RET_STS_UNEXP_ERROR ; --dbms_output.put_line(' msg count 2 is : ' || gpr_msg_count); for k in 1 .. gpr_msg_count loop gpr_msg_data := oe_msg_pub.get( p_msg_index => k, p_encoded => 'F' ); /* oe_msg_pub.Count_And_Get ( p_count=> gpr_msg_count , p_data=> gpr_msg_data ); */ --Get message count and data --dbms_output.put_line('err msg ' || k ||'is: ' || gpr_msg_data); null; end loop; Rollback; Price List Setup Application Program Interface 5-218 Oracle Order Management Open Interfaces, API, & Electronic Messaging Guide WHEN OTHERS THEN gpr_return_status := FND_API.G_RET_STS_UNEXP_ERROR ; --Get message count and data --dbms_output.put_line('err msg 3 is : ' || gpr_msg_data); Rollback; end; / commit; exit;

This sample script inserts a Pricing Formula with seven different pricing formula lines to demonstrate the six formula line types supported in Advanced Pricing formulas: * Price List Line (PLL) * Function (FUNC) * List Price(LP) * Numeric Constant (NUM) * Pricing Attribute (PRA) * Factor List(ML) * Modifier Value (MV) Oracle Basic Pricing supports three formula line types: * Pricing Attribute (PRA) * Numeric Constant (NUM) * Factor List (ML) A pricing formula header record and seven price formula lines are created. For the formula line of type Factor List, the list_header_id of an existing Factor List is used in this sample script. This script must be modified by the user so that the following column is populated with a valid list_header_id of an existing Factor List: gpr_formula_lines_tbl(K).price_modifier_list_id and the following column is populated with a valid list_line_id of an existing Price List Line from the instance where this script is run: gpr_formula_lines_tbl(K).price_list_line_id For more information, see: Oracle Advanced Pricing User's Guide, Seed Data. **************************************************************************** declare gpr_return_status varchar2(1) := NULL; gpr_msg_count number := 0; gpr_msg_data varchar2(2000); gpr_formula_rec QP_PRICE_FORMULA_PUB.Formula_Rec_Type; gpr_formula_val_rec QP_PRICE_FORMULA_PUB.Formula_Val_Rec_Type; gpr_formula_lines_tbl QP_PRICE_FORMULA_PUB.Formula_Lines_Tbl_Type; gpr_formula_lines_val_tbl QP_PRICE_FORMULA_PUB.Formula_Lines_Val_Tbl_Type; ppr_formula_rec QP_PRICE_FORMULA_PUB.Formula_Rec_Type; ppr_formula_val_rec QP_PRICE_FORMULA_PUB.Formula_Val_Rec_Type; ppr_formula_lines_tbl QP_PRICE_FORMULA_PUB.Formula_Lines_Tbl_Type; ppr_formula_lines_val_tbl QP_PRICE_FORMULA_PUB.Formula_Lines_Val_Tbl_Type; K number := 1; begin /* Set the price_formula_id to g_miss_num to

Create the Price Formula Record(Header)*/ gpr_formula_rec.price_formula_id := FND_API.G_MISS_NUM; gpr_formula_rec.name := 'Sample1-PF 1025-1'; gpr_formula_rec.description := 'Sample Pricing Formula'; gpr_formula_rec.formula := 'SQRT(1)*2-NVL(3,4)/5+6'; --Any valid Mathematical Expression including built-in database functions. --Every operand must correspond to a step_number in a price formula line. gpr_formula_rec.operation := QP_GLOBALS.G_OPR_CREATE; /* Create price formula line 1 of type 'List Price'(LP) */ K := 1; gpr_formula_lines_tbl(K).price_formula_id := FND_API.G_MISS_NUM; gpr_formula_lines_tbl(K).price_formula_line_id := FND_API.G_MISS_NUM; gpr_formula_lines_tbl(K).formula_line_type_code := 'LP' gpr_formula_lines_tbl(K).step_number := 1; gpr_formula_lines_tbl(K).operation := QP_GLOBALS.G_OPR_CREATE; /* Create price formula line 2 of type 'Price List Line'(PLL) */ K := K + 1; gpr_formula_lines_tbl(K).price_formula_id := FND_API.G_MISS_NUM; gpr_formula_lines_tbl(K).price_formula_line_id := FND_API.G_MISS_NUM; gpr_formula_lines_tbl(K).formula_line_type_code := 'PLL'; gpr_formula_lines_tbl(K).step_number := 2; gpr_formula_lines_tbl(K).price_list_line_id := 293195; -- Corresponds to the list_line_id of the item 'dw01' on the PriceList -- 'Testing 1023'. gpr_formula_lines_tbl(K).operation := QP_GLOBALS.G_OPR_CREATE; /* Create price formula line 3 of type 'Pricing Attribute'(PRA) */ K := K + 1; gpr_formula_lines_tbl(K).price_formula_id := FND_API.G_MISS_NUM; gpr_formula_lines_tbl(K).price_formula_line_id := FND_API.G_MISS_NUM; gpr_formula_lines_tbl(K).formula_line_type_code := 'PRA';

gpr_formula_lines_tbl(K).step_number := 3; gpr_formula_lines_tbl(K).pricing_attribute_context := 'PRICING ATTRIBUTE'; gpr_formula_lines_tbl(K).pricing_attribute := 'PRICING_ATTRIBUTE12'; -- Corresponds to the Pricing Attribute 'Insurance Cost' gpr_formula_lines_tbl(K).operation := QP_GLOBALS.G_OPR_CREATE; /* Create price formula line 4 of type 'Numeric Constant'(NUM) */ K := K + 1; gpr_formula_lines_tbl(K).price_formula_id := FND_API.G_MISS_NUM; gpr_formula_lines_tbl(K).price_formula_line_id := FND_API.G_MISS_NUM;

gpr_formula_lines_tbl(K).formula_line_type_code := 'NUM'; gpr_formula_lines_tbl(K).step_number := 4; gpr_formula_lines_tbl(K).numeric_constant := 1000; gpr_formula_lines_tbl(K).operation := QP_GLOBALS.G_OPR_CREATE; /* Create price formula line 5 of type 'Function'(FUNC) */ -- User must customize the QP_CUSTOM.Get_Custom_Price function -- to return a numeric value and also set the profile option -- 'QP: Get Custom Price Customized' to 'Yes' at the Site Level to -- successfully use this formula line type (FUNC) in their formulas. K := K + 1; gpr_formula_lines_tbl(K).price_formula_id := FND_API.G_MISS_NUM; gpr_formula_lines_tbl(K).price_formula_line_id := FND_API.G_MISS_NUM; gpr_formula_lines_tbl(K).formula_line_type_code := 'FUNC'; gpr_formula_lines_tbl(K).step_number := 5; gpr_formula_lines_tbl(K).operation := QP_GLOBALS.G_OPR_CREATE; /* Create price formula line 6 of type 'Factor List'(ML) */ K := K + 1; gpr_formula_lines_tbl(K).price_formula_id := FND_API.G_MISS_NUM; gpr_formula_lines_tbl(K).price_formula_line_id := FND_API.G_MISS_NUM; gpr_formula_lines_tbl(K).formula_line_type_code := 'ML'; gpr_formula_lines_tbl(K).step_number := 6; gpr_formula_lines_tbl(K).price_modifier_list_id := 50174; -- Corresponds to the list_header_id of an existing Factor List -- 'ABC' gpr_formula_lines_tbl(K).operation := QP_GLOBALS.G_OPR_CREATE; /* Create price formula line 7 of type 'Modifier Value'(MV) */ K := K + 1; gpr_formula_lines_tbl(K).price_formula_id := FND_API.G_MISS_NUM; gpr_formula_lines_tbl(K).price_formula_line_id:= FND_API.G_MISS_NUM; gpr_formula_lines_tbl(K).formula_line_type_code := 'MV' gpr_formula_lines_tbl(K).step_number := 7; gpr_formula_lines_tbl(K).operation := QP_GLOBALS.G_OPR_CREATE; --dbms_output.put_line('before process price formula '); QP_PRICE_FORMULA_PUB.Process_Price_Formula ( p_api_version_number => 1 , p_init_msg_list => FND_API.G_FALSE , p_return_values => FND_API.G_FALSE , p_commit => FND_API.G_FALSE , x_return_status => gpr_return_status , x_msg_count => gpr_msg_count , x_msg_data => gpr_msg_data

, p_FORMULA_rec => gpr_formula_rec , p_FORMULA_LINES_tbl => gpr_formula_lines_tbl , x_FORMULA_rec => ppr_formula_rec , x_FORMULA_val_rec => ppr_formula_val_rec , x_FORMULA_LINES_tbl => ppr_formula_lines_tbl , x_FORMULA_LINES_val_tbl => ppr_formula_lines_val_tbl ); IF gpr_return_status <> FND_API.G_RET_STS_SUCCESS THEN RAISE FND_API.G_EXC_UNEXPECTED_ERROR; END IF --dbms_output.put_line('after process price formula '); EXCEPTION WHEN FND_API.G_EXC_ERROR THEN gpr_return_status := FND_API.G_RET_STS_ERROR; --Get message count and data --dbms_output.put_line('err msg 1 is : ' || gpr_msg_data); Rollback; WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN gpr_return_status := FND_API.G_RET_STS_UNEXP_ERROR ; --dbms_output.put_line(' msg count 2 is : ' || gpr_msg_count); for k in 1 .. gpr_msg_count loop gpr_msg_data := oe_msg_pub.get( p_msg_index => k, p_encoded => 'F' ); /* oe_msg_pub.Count_And_Get ( p_countgpr_msg_count , p_data => gpr_msg_data ); */ --Get message count and data --dbms_output.put_line('err msg ' || k ||'is: ' || gpr_msg_data); null; end loop; Rollback; WHEN OTHERS THEN gpr_return_status := FND_API.G_RET_STS_UNEXP_ERROR ; --Get message count and data --dbms_output.put_line('err msg 3 is : ' || gpr_msg_data); Rollback; end; / Commit;

You might also like