AttrMapping Part2
AttrMapping Part2
INTRODUCTION
Oracle Advanced Pricing offers flexibility and extensibility in terms of handling various pricing
scenarios. Attribute management is one of the key components of Advanced Pricing and it provides
the users of Advanced Pricing with the flexibility to take care of varied business scenarios by
defining attributes of product, qualifier or pricing context type.
This paper describes in detail the various functional aspects of Attribute management, profile options
needed and the set up require for creating and mapping attributes and troubleshooting details as of
11.5.10 release. Please refer to Oracle Advanced Pricing implementation guide and user guide for
Attribute Management details in latest release.
Attribute Management in Advanced Pricing Page 3
FUNCTIONAL ASPECTS
When a new request type is created (i.e. a new ordering structure is developed), the business must
decide if the request type will use the same set of source systems in the existing PTE. A new PTE
needs to be created only if the new request type uses a different ordering structure and a different set
of source systems. Request types have to be unique across PTEs.
Oracle Advanced Pricing has seeded 4 PTEs. They are Order Fulfillment, Inter-company Transaction,
Logistics, and Demand Planning.
Context
Contexts are a group of related pricing elements that can have attributes linked to them. In
Attribute Management, users can set up 3 types of contexts. Product context, Qualifier context, and
Pricing context. Qualifier Contexts and its attributes allow for the creation of qualifiers, which
determine eligibility. The attributes in the product context help to define the product hierarchy.
Attributes within a pricing context enable users to further define eligibility for a line.
We can add new contexts of Pricing and Qualifier Context type. However you cannot add new contexts
of Product Context type. You can add attributes to the existing Product context ITEM.
The Context-Attribute grouping is linked to a specific Pricing Transaction Entity. For a given PTE,
this combination becomes available to use in a formula, qualifier, price list, or modifier. Each PTE
will have its own unique combination of attributes.
Note:
You cannot delete a context, if it has one or more attributes. Attributes that are already used in Pricing
Setup cannot be deleted.
Please make sure to set QP: Pricing Transaction Entity profile option value appropriately before
creating contexts/attributes. So, these contexts and attributes will be available in pricing setup forms
Attribute Management in Advanced Pricing Page 4
in that PTE. If this profile is not set correctly, the contexts/attributes linked to the PTE will not be
shown in LOVs in Pricing Setup Forms, and using contexts/attributes from incorrect PTE in
pricing setup (Qualifier, Pricing attributes, etc) will give incorrect results during pricing call as the
attribute(s) will not be sourced correctly.
Attributes
Attributes can be used as product, qualifier or pricing attributes. Attributes are linked to a Pricing
Transaction Entity depending on the defined Request Types. Different request types may use the same
attribute to source different data. The same attribute used in 2 different PTEs may be completely
different in terms of the attribute mapping method, mapping level, and other controls. One attribute
for 2 PTEs may be different.
As mentioned before, these attributes are sources of data that can be used by the pricing engine in a
pricing request. There are 4 methods to source data. They are,
User entered attributes: The attribute value is entered by the user at run time. Attribute
mapping is not needed.
Custom sourcing: User provides a code to map an attribute. In this case attribute mapping is
not needed.
Search engine will look at only the setup data generated by all the source systems defined
for that Pricing Transaction Entity.
2. To make contexts of one Pricing Transaction Entity unavailable to other Pricing Applications
families. To setup processing constraints to some extent.
Source Systems
It is the application generating setup data. For example IStore, Oracle Pricing and AMS generate
modifiers. Hence these applications could be source system.
If these applications are sharing their setup data then they form one Pricing Transaction Entity.
Code
It is a short name for the source system application.
Description
It is a description for a source system.
Enabled
Enable/disable source system association with PTE.
Request types
The Request Type identifies the type of transaction that is being priced.
Different applications make requests to the pricing engine. Request structures of these applications may
be different. Some applications may share their request structures.
For example IStore and Order capture. They share same request structures. On the other hand,
Order Management and IStore have different request structures. If request type codes are not unique
then each request structure will have to provide PTE code to uniquely identify the request type. As a
Attribute Management in Advanced Pricing Page 7
result of this, each integrating application will have to change its request structure. Hence to avoid
this, Request type codes will be unique across PTEs.
Description: Figure 3, displays the Pricing Transaction Entity window with request
types associated with Order Fulfillment PTE.
Code
It is a short name of a request type.
Description
It is a description of a request type.
Header/Line structure/view
A request type may have a global record structure or a view defined to map the data. Based on it user
will either enter global structures for header and line or view names for header and line.
Header Global Structure
It is a global structure for „Header‟ .
Line Global Structure
It is a global structure for „Line‟ .
Header View Name
It is a view name for the „Header‟
Line View Name
It is a view name for the „Line‟ .
Enabled
Enable/disable request type association with PTE.
• Map attributes used in active pricing setup: The Build Attribute Mapping Rules program will
source the attributes that are used only in the active pricing setup.
• Map all attributes: This program will source the attributes that are used in both the active and
inactive setups.
Note:
Please set this profile value to „Map attributes used in active pricing setup‟ to map only those
attributes used in the active pricing setup to improve the performance of Build Attribute Mapping
Rules program. For troubleshooting/debugging purpose, it may be set to „Map all attributes‟ .
CONCURRENT PROGRAMS
The Attribute Mapping Method must be ATTRIBUTE MAPPING. Attributes with mapping
method USER ENTERED and CUSTOM SOURCED are never meant to be created by the
Build Attribute Mapping Rules program.
In 11.5.10 release, user can update (enable/disable) Sourcing Enabled box for the attribute
sourcing rule. Please ensure that this Sourcing Enabled box is selected, for the sourcing rule
to be active and for the attribute to be sourced by attribute mapping functionality.
If the attribute is newly created, you must ensure that it is attached to at least one valid Pricing
Setup such as a Modifier, Price List or Limit. Ensure that the PTE-Attribute link that was
created has at least one attribute mapping rule.
Creating Contexts
In Attribute Management, you can set up the following contexts:
Qualifier Contexts and its attributes: Used to create qualifiers that determine eligibility for a
modifier (who is eligible to receive the modifier). Qualifiers can be attached to price lists (only in
Advanced Pricing) and modifiers.
Product Contexts and its attributes: Defines the product hierarchy related to product
information. For example, the product context Item may consist of attributes such as Item Number
and Item Category.
Pricing Contexts (associated with pricing attributes): Define eligibility for a price list line or
modifier. They can be used for a price list line, as a formula component, or in modifiers.
To create new contexts
Navigate to the Setup -> Attribute Management -> Contexts and Attributes Setup window.
Description
It is a description of a context.
Seeded
Seeded check box is selected for the seeded context.
Enabled
Enable the context to make it available in Pricing Setup windows. If disabled, context will not be
displayed in pricing setup windows, and all the attributes defined under this context will also be
unavailable for setup.
Creating Attributes
Once the context is defined, you can create its attributes. Attributes determine the specific values in
which you define pricing rules. The pricing engine evaluates attributes during engine run time to
determine which price lists and modifiers are eligible for the transaction. Attribute values can be
derived at the order level, line level, or for both order and line levels.
Navigate to the Setup -> Attribute Management -> Contexts and Attributes window. Select the
context to which you want to link attributes:
Description: Figure 5, displays the Context Setup window with Customer Group context and
the attributes created in this context.
Code
It is a short name of the attribute. This is an internal name that is unique for a given attribute. Once
created, it cannot be updated.
Name
It is a name of the Attribute.
Description
It is a description for the attribute.
Precedence
It is a numeric precedence value, which decides the processing sequence of qualifier/ pricing
attributes. The precedence is restricted to a maximum of 3 digits (any number between 1 and 999).
For example, if two incompatible discounts qualify for the same item, then the discount with the
higher precedence is given. Precedence numbers in the series of 5's and 10's are reserved for seeded
qualifiers/pricing attributes and should not be used.
Logistics LOGSTX
Procurement PO
The following tables display the seeded Request Types and Source Systems for each PTE:
Pricing Transaction Entity Source Systems Request Types
Procurement PO PO
• Runtime Sourced: Sourced in the pricing engine by a Custom API. This is used to source
an accumulation attribute at runtime. During accumulated range break calculations, the
pricing engine calls the Runtime Sourcing API to acquire an accumulation value for the
accumulation attribute (defined as RUNTIME SOURCE in Attribute Mapping setup).
For additional information on custom attribute sourcing, please refer to Note 374963.1 in
MetaLink.
LOV Enabled
Only if LOV Enabled checkbox is checked, attribute will be available in LOVs of
modifier/qualifier/price list/formula screens. If unchecked, attribute will not be available in setups
of modifier/qualifier/formula. However existing modifiers defined using that attribute, will behave
the same way.
If „LOV Enabled‟ is checked and „Attribute Mapping Enabled‟ is unchecked, then in this case
even though the attribute is available for setup, a mapping rule will not get created. Hence whenever
user uses such attribute in the setup screens of qualifier/modifier/pricelist/formula, an error will be
raised.
Used in Setup
It indicates if the attribute is used in an active pricing setup such as a price list, modifier, formula,
qualifier, or limit.
Attribute Mapping Status
This checkbox is checked /unchecked automatically by the Build Attribute Mapping Rules
concurrent program which generates the Build Contexts API for mapped attributes.
Attribute Mapping Status is unchecked
For new attributes until concurrent program is run after defining the attribute mapping for
it.
Description: Figure 8, displays window for attribute linking and mapping and
the various values available for source types. The user value string will have a
value as OE_ORDER_PUB.G_LINE.XXX_XXX where XXX_XXX is the
column name in Order lines table.
Details of each of the fields in the form have been explained below.
Request Type
It is a Request type associated to PTE.
Description
It is a description of Request type.
Application Profile
PL/SQL API
Constant Value
System Variable
Application Profile: Select the profile option from where you want to get the default value for this
attribute. A LOV will provide a list of valid profile options such as OE: Item Validation
Organization.
PL/SQL API: Attribute can be sourced directly from a global structure defined for the given
source system or can be sourced from seeded or custom PL/SQL API. The parameters passed to
the PL/SQL API should be valid columns and we cannot pass the entire structure. For example,
sourcing rule like CUSTOM_PKG.CUSTOM_API (OE_ORDER_PUB) is invalid.
For Order Management all the record structures are defined in the package OE_ORDER_PUB.
For example, if you want to use payment term id as the source value for the new segment that you
have defined, enter OE_ORDER_PUB.G_LINE.payment_term_id in the function name. You
have two record structures available. OE_ORDER_PUB.G_LINE contains all the possible values
of a sales order line. OE_ORDER_PUB.G_HDR contains fields from Order header. Structure of
the Line_rec_type and header_rec_type can be obtained from the Manufacturing Open Interface
Manual. (For I*Store/OC the equivalent global structures are defined in the package
ASO_PRICING_INT.
PL/SQL API Multi-Record: We can write a custom API (must be a function) that returns
multiple values. The output of our function can only be a table of VARCHAR2‟ s.
Constant Value: Constant value. Enter a constant value that will always be mapped to this attribute
for the given condition. Ex.100
System Variable: System Variable. Enter the system variable that will be mapped to the attribute
for the given condition. Ex. SYSDATE
Description: Figure 9, displays window for attribute linking and mapping and the
various values available for source types.
Seeded Source Type
It will have value if the sourcing rule is seeded. This field is protected against update. If we want to
modify seeded mapping, then we can enter data into corresponding „user‟ field (user source type).
Value String (user & seeded)
It is a value of the source type. Seeded value string will have seeded value. This field is protected
against update. If we want to modify seeded mapping, then we can enter data into corresponding
„user‟ field. (user value string).
Seeded
This is a non-navigable field indicating, whether the sourcing rule is seeded or not.
Enabled
Enable/Disable sourcing rule at Order/Line level for one or more request types under a PTE.
Description: Figure 11, displays the item AS54999 being added to the Price List Corporate with
Unit price as USD 1900
Description: Figure 13, displays creation of a new context of type Qualifier Context
in context Order.
Navigation: Oracle Pricing Manager responsibility -> Setup -> Attribute Management-> Contexts
and Attributes
Navigation: Oracle Pricing Manager responsibility -> Setup -> Attribute Management ->
Attribute Linking and Mapping -> Link Attributes
Description: Figure 16, displays window for attribute linking and mapping.
Navigation: Order Management super user responsibility -> Orders, Return ->Sales order
Attributes can also be passed to the pricing engine directly, without the need for an attribute
mapping rule. In such cases, the Attribute Manager API calls a custom API,
QP_CUSTOM_SOURCE, where the user has manually defined the attributes being passed and
coded the sourcing of their values.
The Pricing Type can be H (Header) or L (Line), which defines the level of the attribute mapping
rule. These attributes and their values are passed to the pricing engine in the same manner as the
attributes sourced through attribute mapping rules.
Profile option:
QP: Custom Sourced – YES
PROCEDURE Get_Custom_Attribute_Values
(p_req_type_code IN VARCHAR2
, p_pricing_type_code IN VARCHAR2
, x_qual_ctxts_result_tbl OUT
QP_ATTR_MAPPING_PUB.CONTEXTS_RESULT_TBL_TYPE
, x_price_ctxts_result_tbl OUT
QP_ATTR_MAPPING_PUB.CONTEXTS_RESULT_TBL_TYPE
);
Parameters:
p_req_type_code
Request Type Code. Ex. ONT.
p_pricing_type_code
- 'L' for Line and 'H' for Header Level attribute mapping rule. x_qual_ctxts_result_tbl
- Qualifier attributes result table.
x_price_ctxts_result_tbl
- Pricing attributes result table.
If profile option QP: Custom Sourced is set to Yes, Attribute Manager API Build_Contexts will call
QP_CUSTOM_SOURCE.Get_Custom_Attribute_Values procedure to source custom mapped
attributes. i.e., attributes with attribute Attribute Mapping Method=CUSTOM SOURCED.
Example code:
The following example explains how a customer may code the body of QP_CUSTOM_SOURCE
for a particular case.
In this case, two segment mapping columns, 'QUALIFIER_ATTRIBUTE31' and
'PRICING_ATTRIBUTE31' that belong to contexts CUST_SOURCE_QUAL_CON and
CUST_SOURCE_PRIC_CON respectively and linked to PTE 'Order Fulfillment', will have
Custom Sourced values as 10 for ORDER as well as LINE Attribute Mapping levels. The user must
ensure that the Attribute Mapping method for both these PTE-Attribute links is CUSTOM
SOURCED in the 'Attribute Linking and Mapping' setup window.
PROCEDURE Get_Custom_Attribute_Values
(p_req_type_code IN VARCHAR2
, p_pricing_type_code IN VARCHAR2
, x_qual_ctxts_result_tbl OUT
QP_ATTR_MAPPING_PUB.CONTEXTS_RESULT_TBL_TYPE
, x_price_ctxts_result_tbl OUT
QP_ATTR_MAPPING_PUB.CONTEXTS_RESULT_TBL_TYPE
) is
Begin /*
Note:
a) Assign Context Code to context_name parameter and not the name of the context.
b) Assign Column Mapped for the attribute to attribute_name parameter and not the attribute
name.
c) Ensure that attribute_value is assigned to NOT NULL value, otherwise the attribute will not
get sourced and not used by pricing engine for calculation.
*/
End Get_Custom_Attribute_Values;
END QP_CUSTOM_SOURCE;
/
Please check QP: Custom Sourced profile is set to Yes for the Attribute Manager API
Build_Contexts to call QP_CUSTOM_SOURCE.Get_Custom_Attribute_Values
procedure to source custom mapped attributes.
Please set QP: Debug profile to „Request Viewer On‟ and reproduce the issue. Look at
the Pricing Engine Request Viewer and see the custom sourced attribute is sourced
correctly and the value assigned to the attribute is matched with the setup value in the
pricelist/modifier/formula setup. Please see 'Pricing Engine Request Viewer – Attributes
section‟ in Advanced Pricing implementation guide on how to use Pricing Engine Request
Viewer for attribute sourcing issues.
Please check the string 'Before Calling Custom Sourcing Package' in the debug log and
make sure that there is no exception/error message thrown in custom API call and check
the number of custom attributes sourced. Also, check the output of the following SQL to
determine the error message thrown in the custom package:
NAME =‟ QP_CUSTOM_SOURCE‟ ;
• View the controls passed by the calling application to the pricing engine such as Events,
Rounding Flag, Search and Calculate Flag, GSA Flag.
• View the pricing, qualifiers, and product attributes passed to the pricing engine along with
the other data generated by the engine.
• View the relationship between order lines for promotional modifiers, price breaks, and
service lines (OID, PRG, PBH, and Service Items).
• View the formula step values generated by the pricing engine used in formula calculation.
• From the „Pricing Engine Request Viewer‟ window, select Attributes button by placing
the cursor in the Lines Block, Attributes block shows all the attributes corresponding to
that Line. The output qualifier and pricing attribute records would have the qualifiers and
pricing attributes passed to the pricing engine for the line.
• Please make sure that the all the required attributes have been sourced correctly and the
values match with the qualifier/product/pricing attributes used in the
pricelist/modifier/formula setup.
• Please set QP: Insert Formula Step Values into Temp Table profile to yes to insert the
dynamic formula step values evaluated during runtime. Only if this profile is set to yes,
formula step values for the dynamic formula attached to price list/modifier will be inserted
into QP_FORMULA_STEP_VALUES_TMP table which can be used during runtime in
custom code and „Step Values‟ button in the Pricing Engine Viewer will be enabled. For
any formula sourcing issues, please see if any formula processing error is thrown in the
debug log and set this profile to yes to see the formula step values. The data in
QP_FORMULA_STEP_VALUES table is copied to debug table
QP_FORMULA_STEP_VALUES_TMP that is used by Pricing Engine Request Viewer.
• Please refer to Advanced Pricing Implementation guide> Pricing Engine Request Viewer
window section for complete details on the columns in each region.
• Please refer to Advanced Pricing Implementation guide >Pricing Engine Request Viewer
window>Attributes window section for the information on the columns displayed in
Qualifer Context/Product Context/Pricing Context to diagnose attribute sourcing issues.
• Please run „Purge Pricing Engine Requests‟ concurrent program on a regular basis to
purge the historical data from the pricing debug tables. Periodically purging the historical
data from the pricing debug tables will improve the performance of the „Pricing Engine
Request Viewer‟ form.
This program can be accessible from:
o Oracle Pricing Manager -> Reports -> Submit New Request (button). Choose –
Single Request. Name – QP: Purge Pricing Engine Requests.
o Oracle Pricing Manager -> View Concurrent Requests -> Submit New Request
(button). Choose – Single Request. Name – QP: Purge Pricing Engine Requests.
2 QP_DEBUG_REQ_LINES This table contains details about the lines being priced.
3 QP_DEBUG_REQ_LDETS This table contains information about the line details being priced. It
has adjustment and discount details for lines, including adjustments
and discounts that the pricing engine eliminates.
4 QP_DEBUG_REQ_LINE_ATTRS This table contains information on the pricing attributes that the
attribute mapping functionality passed to the pricing engine.
6 QP_FORMULA_STEP_VALUES This table contains information about the formula step values which
are inserted into the table QP_FORMULA_STEP_VALUES. The
step values are inserted into the table during the evaluation of
formula attached to the pricelist/modifier.
1 QP_Attr_Mapping_PUB package is invalid due Check dba_errors for this package to determine which attribute
to incorrect attributes mapping setup. mapping API is causing the error. If this is a custom API then
correct the API. If this is the seeded API then determine whether
a correction patch is available.
While in Attribute Linking and Mapping Please check the following pre-requisities:
5 window, I run Build Attribute Mapping rules
from the Tools bar. The return message a) The Attribute Mapping Enabled checkbox was not
confirms that the Build Attribute Mapping checked.
program ran successfully. But the Attribute
Mapping status box of the attribute that I just b) Attribute is used in Pricing Setup. Please check Used in
linked is still unchecked. Setup checkbox was not checked.
8 I removed the attribute from Pricing setup. But, You will need to run „Build Attribute Mapping Rules‟
used in setup flag is still set. concurrent program. This program will clear used in setup and
attribute source status flags for the attributes which are not used
in the setup.
9 Inactivated the Pricing setup, but still used in Please run Build Attribute Mapping Rules concurrent program. It
setup and attribute sourcing status flags are set will clear used in setup and attribute source status flags, if attribute
for the attribute. is not used in active pricing setup, and if profile option QP: Build
Attribute Mapping Options is set to „Map attributes used in active
pricing setup‟ .
Mapping Rules program will source only attributes which are used
in the active setup. This profile can be controlled only at the SITE
level.
11 Attribute is used in pricing setup, but used in Please check Profile option QP: Build Attribute Mapping Options
setup flag is not set. value is set to „Map attributes used in active pricing setup‟ . If so,
please check Active flag is checked for the Pricing Setup (Price
list/Modifier/Formula, etc) and run Build Attribute Mapping
Rules concurrent program.
12 Attribute Mapping Method is set to „CUSTOM Please check the Custom attribute sourcing procedure
SOURCED‟ and Build Contexts failed during QP_CUSTOM_SOURCE.Get_Custom_Attribute_Values is
call to pricing engine. defined and is not throwing any exception/error. Please also
check OM debug log with level 5 and check any exception is
thrown while invoking a call to the custom procedure.
14 Customer upgraded to 11.5.7 and is on OM Please apply Patch#2597461 and Patch#2603770. Also check the
Family Pack H, and there are few corrupted seeded attribute sourcing rules are enabled by executing the
seeded attributes. Is there any standard patch following query:
available?
select count(*) from qp_attribute_sourcing where seeded_flag='Y'
and enabled_flag='N';
A.PRC_CONTEXT_CODE,
B.SEGMENT_CODE,
C.REQUEST_TYPE_CODE;
17 PL/SQL: could not find program unit error • Please check all the database objects are valid. If any
message is recorded in OM Debug log file and INVALID Objects found, please recompile all
no attributes sourced. INVALID objects.
19 Is there any report, which identifies errors in In Release 11.5.9 or later, please run „Attribute Mapping Rules
Attribute sourcing rules? Error Report‟ and specify request type optionally. Check report
output for attribute sourcing rule errors if any. This report will
output errors in sourcing rules only for the attributes, which has
Attribute Mapping set to „ATTRIBUTE MAPPING‟ . For
release prior to 11.5.9, please see the diagnostic script provided in
Attribute Management Diagnostic scripts section.
20 For troubleshooting Intercompany invoicing For details on „Intercompany Integration with Advanced
with Advanced Pricing issues, where can I find Pricing‟ , please refer to „Intercompany Invoicing and Advance
the document details? Pricing
Integration‟ Technical Brief in MetaLink. Please set QP: Pricing
Transaction Entity and QP: Source System code correctly before
creating pricelist/modifier so that the contexts/attributes linked to
the „Intercompany Transaction‟ PTE will be available in LOVs in
Pricing setup forms.
21 Build Attribute Mapping Rules concurrent • Please run Attribute Mapping Rules Error report and
program throws error with User Defined verify if there are any errors. This report verifies the
Exception. packages used in sourcing rules are valid in database and
Invalid HVOP Attribute: if any file dependencies are missing.
QP_BULK_PREQ_GRP.G_LINE_REC. • Please verify the custom sourcing rules are valid and the
parameters passed to the custom souring rules.
22 Problem in Please check if there are custom contexts attached to the PTE and
QP_Attr_Mapping_PUB.Build_Contexts API in verifies the sourcing rules of the custom attributes are valid.
Custom Contexts attached to the PTE. For troubleshooting, please uncheck „Attribute Mapping Enabled‟
checkbox for the custom attributes in the custom contexts attached
to the PTE and run Build Attribute Mapping Rules concurrent
program. Verify if the issue still exists. Please refer to Bug#
4709496 & 4887583 for more details.
- No
NOTES
CONCLUSION
As detailed above, Attribute Management provides flexibility for Pricing setup for various business
needs. Usage of attribute management for product, qualifier and pricing attributes provides
powerful and flexible capabilities within Advanced Pricing. In fact this feature is also called as an
extension of Advanced pricing because of the flexibility it provides. Using these features
successfully requires an understanding of the business process, the features and the required setup
in the application.
Oracle Corporation
World Headquarters 500
Oracle Parkway Redwood
Shores, CA 94065 U.S.A.
Worldwide Inquiries:
Phone: +1.650.506.7000 Fax:
+1.650.506.7200
www.oracle.com