Saturday, February 28, 2015

OE_DEPENDENCIES_EXTN in Order Management


In order management, sometimes defaulting rules are driven by source and dependant attributes. This means that whenever you change source, you can derive dependant attribute value based on source value.

For example, if you give order type as "Standard", you can derive value for "Shipping Method" from transaction type setup using pl/sql API. But this dependency between order type and shipping method has to be defined in file $ONT_TOP/patch/115/sql/OEXUDEPB.pls. If you open this file, you  can see dependency written as below between order type and shipping method. Hence your defaulting rule for shipping method will work fine just by writing simple logic in pl/sql API.

IF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER THEN
   --  Populate dependent attributes for one source at a time.
   l_index := OE_HEADER_UTIL.G_ORDER_TYPE * G_MAX ;
   g_dep_tbl(l_index +4 ).attribute  := OE_HEADER_UTIL.G_SHIPPING_METHOD;
............

However, there are many attributes for which dependency is not defined in file OEXUDEPB.pls. So oracle has provided an extension package - OE_DEPENDENCIES_EXTN which we also call as hook.

You can write simple piece of code in this package and compile it to define dependency between any of the OM attributes.

I am giving one example each for header and line, you can apply the same for any of the attributes in order management form

Example 1 (Header Tab): If you want to derive value for FOB_POINT based on value input in END_CUSTOMER, you can perform below steps to achieve it.

a) Define your defaulting rule for Order Header entity, Attribute - Shipping method and source as PL/SQL API. Write simple logic in your pl/sql procedure to derive fob_point value from hz_cust_accounts based on end_customer_id value (cust_account_id)                
 
b) Write below code in package - OE_DEPENDENCIES_EXTN and compile it.

IF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER THEN

x_extn_dep_tbl(l_index).source_attribute := OE_HEADER_UTIL.G_END_CUSTOMER;
x_extn_dep_tbl(l_index).dependent_attribute := OE_HEADER_UTIL.G_FOB_POINT;
x_extn_dep_tbl(l_index).enabled_flag := 'Y';      
l_index := l_index + 1;                

c) Run concurrent program " Defaulting Generator" from SRS window

Example 2 (Line Tab): If you want to derive value for DEMAND_CLASS based on value input in SCHEDULE_SHIP_DATE, you can perform below steps to achieve it.

a) Define your defaulting rule for Order Line entity, Attribute - Demand Class and source as PL/SQL API. Write your own logic in pl/sql procedure to derive demand_class value based on SSD value
 
b) Write below code in package - OE_DEPENDENCIES_EXTN and compile it.

ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE THEN

x_extn_dep_tbl(l_index).source_attribute := OE_LINE_UTIL.G_SCHEDULE_SHIP_DATE;
x_extn_dep_tbl(l_index).dependent_attribute := OE_LINE_UTIL.G_DEMAND_CLASS;
x_extn_dep_tbl(l_index).enabled_flag := 'Y';      
l_index := l_index + 1;

c) Run concurrent program " Defaulting Generator" from SRS window

4 comments:


  1. This web journal inspired me and over surpassed my desires. You know how to include a peruser and expand his interest to peruse more. Numerous congrats! Oracle

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. such a great knowledge with well defined defination it really helps me a lot. Thank You


    digital marketing seo training indore

    ReplyDelete
  4. Purchasing request administration programming requires broad pre-buy inquire about. distributor ordering

    ReplyDelete

Note: Only a member of this blog may post a comment.