详细内容需要参考文档:Oracle 11i Advanced Pricing—Don’t Customize, Extend!

utl:http://blog.csdn.net/cai_xingyun/article/details/41384541

Oracle Advanced Pricing - Version 11.5.8 and later

Information in this document applies to any platform.

***Checked for relevance on 06-DEC-2013***

PURPOSE

This note explains details on sourcing Pricing Attributes by implementing QP_CUSTOM_SOURCE.Get_Custom_Attribute_Values procedure and troubleshooting custom sourced attributes.

QUESTIONS AND ANSWERS

Using Custom Sourced Attributes

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 the QP_CUSTOM_SOURCE API, where the user has manually
defined the attributes being passed and coded the sourcing of their values.



The user code is written in the package procedure QP_CUSTOM_SOURCE.Get_Custom_Attribute_Values. 

The Attribute Manager API program (Build_Contexts), calls this procedure to pick up custom-sourced attributes if the profile option QP: Custom Sourced is set to Yes. The input parameters to QP_CUSTOM_SOURCE are Request Type code and Pricing Type. Typical values
of Request Type Codes that can be passed are ONT, ASO, OKC, IC, FTE or MSD. By using the Request_Type_Code, the user can control how the attributes are sourced based on the PTE of the calling application.



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 



Files:

a. QPXCSOUS.pls - QP_CUSTOM_SOURCE Package Specification. 

b. QPXCSOUB.pls - QP_CUSTOM_SOURCE Package Body.

Customer has to implement the Package Body in QPXCSOUB.pls (for example) to source custom mapped qualifier/pricing attributes in Get_Custom_Attribute_Values procedure and need to set QP: Custom Sourced profile option
value to Yes.



Procedure Get_Custom_Attribute_Values:

QPXCSOUS.pls - QP_CUSTOM_SOURCE package specification contains the following procedure declaration. 

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. ie, 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. 

CREATE or REPLACE PACKAGE body QP_CUSTOM_SOURCE AS 

/*Customizable Public Procedure*/ 

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. 

*/ 

-- The statements below help the user in turning debug on 

-- The user needs to set the oe_debug_pub.G_DIR value. 

-- This value can be found by executing the following statement 

-- select value 

-- from v$parameter 

-- where name like 'utl_file_dir%'; 

-- This might return multiple values , and any one of the values can be taken 

-- Make sure that the value of the directory specified , actually exists 



-- Sample debug message. 

-- oe_debug_pub.add ('In Get_Custom_Attribute_Values'); 



If p_req_type_code = ‘ONT’ and p_pricing_type_code in (‘L’,’H’) then 

-- Sourcing qualifier attributes. 

x_qual_ctxts_result_tbl(1).context_name := 'CUST_SOURCE_QUAL_CON'; 

x_qual_ctxts_result_tbl(1).attribute_name := 'QUALIFIER_ATTRIBUTE31'; 

x_qual_ctxts_result_tbl(1).attribute_value := '10'; 



-- Sourcing pricing attributes. 

x_price_ctxts_result_tbl(1).context_name := 'CUST_SOURCE_PRIC_CON'; 

x_price_ctxts_result_tbl(1).attribute_name := 'PRICING_ATTRIBUTE31'; 

x_price_ctxts_result_tbl(1).attribute_value:= '10'; 

end if; 

End Get_Custom_Attribute_Values; 

END QP_CUSTOM_SOURCE; 





Please note that, context_name is actually the context code and NOT the name of the context. 

Also, attribute_name is the column mapped for the attribute and NOT the attribute name. 



Troubleshooting Custom sourced attributes: 

1. 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.

2. 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.

3. 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: 

SELECT line || ‘/’ position POS, text from DBA_ERRORS WHERE NAME =’QP_CUSTOM_SOURCE’; 



4. Please note that the value assigned to the attribute in Get_Custom_Attribute_Values procedure should not be NULL, otherwise the attribute will not get sourced.

5. Please add debug messages in Get_Custom_Attribute_Values procedure using oe_debug_pub.add API and verify that the debug messages are printed in the debug log to diagnose the issue in the custom procedure implementation.

Advanced Pricing - How to source Pricing Attributes using QP_CUSTOM_SOURCE.Get_Custom_Attribute_Valu的更多相关文章

  1. How to Create Modifiers Using the API QP_MODIFIERS_PUB.PROCESS_MODIFIERS

    In this Document Goal   Solution   Example Scripts   Steps to verify the creation of modifier(s).   ...

  2. 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 ...

  3. Oracle Advanced Pricing White Papers

    Oracle Order Management - Version 11.5.10.0 and later Oracle Advanced Pricing - Version 11.5.10 and ...

  4. How to: Create a C/C++ Union by Using Attributes (C#)

    [How to: Create a C/C++ Union by Using Attributes (C#)] 1.you can create what is known as a union in ...

  5. Apache OFBiz

    Apache OFBiz® Apache OFBiz offers a great deal of functionality, including: advanced e-commerce cata ...

  6. 12 Best Live Chat Software for Small Business Compared (2019) 最佳的wordpress在线聊天工具推荐插件 来帮你和潜在客户互动

    12 Best Live Chat Software for Small Business Compared (2019)     Did you know that more than 67% of ...

  7. SD从零开始11-12

    SD从零开始11 定价中的条件技术(Condition Technique in Pricing) 定价程序Pricing Procedure 所有定价中允许的条件类型都包含在定价程序中: 通过为每个 ...

  8. SAP事务码 一

    SE80 -- edit source code. SE24 -- class create or display. SFP -- created and maintained independent ...

  9. 2 Configuring SAP ERP Sales and Distribution -introduction to SAP

    First Steps in SAPWe’ll now discuss some of the basic menus, screens, and transactions that you need ...

随机推荐

  1. springMVC源码分析--ControllerClassNameHandlerMapping(九)

    在上一篇博客springMVC源码分析--AbstractControllerUrlHandlerMapping(六)中我们介绍到AbstractControllerUrlHandlerMapping ...

  2. Web自动化框架LazyUI使用手册(8)--excel数据驱动详解(ExcelDataProvider)

    概述 框架提供了excel数据驱动方式运行测试用例的工具,本文将针对数据驱动,进行详细演示. 详见类:lazy.test.ui.browser.ExcelDataProvider 被测对象: http ...

  3. 【BAT经典算法面试题系列】求和为n的连续正整数

    马上就要到9月份了,意味着一年一度的秋招就要开始了,相信不论是正在实习的童鞋还是马上就要找工作的童鞋,BAT无疑是国内的"明星企业",是每个学计算机的小伙伴们心之向往的企业,但是呢 ...

  4. AR模块常用函数

    --AR模块常用函数 FUNCTION get_fnd_user_name ( p_user_id IN NUMBER ) return VARCHAR2 IS CURSOR c_user_name ...

  5. java项目管理工具maven使用初级

    一.前言        早就知道maven 在java 项目的管理方面名声显赫,于是就想着学习掌握之,于是查阅了大量文档.发现这些文档的作者都是java 的大腕,大多都是站在掌握了一定maven 基础 ...

  6. 使用Fresco实现简单的显示一张图片

    使用Fresco实现显示一张图片 仅仅是下载一张图片,在下载完之前,先显示一张站位图 效果图 源码 下载地址(Android Studio工程):http://download.csdn.net/de ...

  7. Dynamics CRM2015 页面导航栏顶部全局快速查找功能配置

    在CRM2015中微软加入了新的快速查找功能,让你的数据查找更加方便,功能栏如下图所示,直接可以框中输入搜索项进行搜索. 但该功能是需要进行些配置,具体的配置在设置-管理-系统设置中,默认的就是红框中 ...

  8. iOS集合视图单元格高亮和选中的区别

    大熊猫猪·侯佩原创或翻译作品.欢迎转载,转载请注明出处. 如果觉得写的不好请多提意见,如果觉得不错请多多支持点赞.谢谢! hopy ;) 免责申明:本博客提供的所有翻译文章原稿均来自互联网,仅供学习交 ...

  9. [shiro学习笔记]第二节 shiro与web融合实现一个简单的授权认证

    本文地址:http://blog.csdn.net/sushengmiyan/article/details/39933993 shiro官网:http://shiro.apache.org/ shi ...

  10. iOS中 如何将自己的框架更新到cocopods上 韩俊强的博客

    每日更新关注:http://weibo.com/hanjunqiang  新浪微博! 为了更方便的集成第三方框架有了cocopods 的, 当我们有了相对比较好的框架的时候如何更新到cocopods ...