Order defaulting rule

hi
how to modify a defaulting rule using sql or pl/sql ?

Hi,
You have like this:
1. Price list
2.OE_DEFAULT_PVT.Get_SOB_Currency_Code
You have to make
1. XXOE_DEFAULT_PVT.custom_code
2. Price list
3.OE_DEFAULT_PVT.Get_SOB_Currency_Code
Did you made own custom code to pick currency?
Regards,
Luko

Similar Messages

  • Default rule in Order type dependend parameters - OPL8 - Order Settlement

    Hello,
    We are doing settlement of production orders via Tcode - Ko88.
    After execution of the same, system is passing an FI entry to GL - which is mentioned in the Material Master (Valuation Class - 7900) i.e. through OBYC setting.
    We have also checked the OPL8 setting (Order Type dependend Parameters - Controlling Tab) in which "Default Rule" is mentioned as - PP1 - Production Material full Settlement.
    As the system is passing an entry via "Default Rule - PP1" stored in Order Type Dependend Paramenters:
    1. What is the use of Settlement Profile (OKO7) & Allocation Structure (OKO6)?
    2. Can we make "Default Rule" field as optional (In Tcode - OPL8) ? since all the settlements are resulting in same Material GL.
    Waiting for a positive answer. Points will be assigned definitly.
    Thanks & Regards,
    Shridhar Sawant

    Hi,
    Settlement Profile:
    In the settlement profile, you define a range of control parameters for settlement. You must define the settlement profile before you can enter a settlement rule for a sender.
    If you want to settle the costs each time to just one cost center or just one G/L account, you need a settlement profile. As you cannot maintain the settlement parameters during settlement to a receiver, you must save the settlement profile either in the order type or in the model order or reference order.
    Allocation Structure:
    During settlement, costs incurred under the primary and secondary cost elements by a sender are allocated to one or more receivers. When you settle by cost element, you settle using the appropriate original cost element.
    An allocation structure comprises one or several settlement assignments. An assignment shows which costs (origin: cost element groups from debit cost elements) are to be settled to which receiver type (for example, cost center, order, and so on).
    You have two alternatives in settlement assignment:
    You assign the debit cost element groups to a settlement cost element.
    You settle by cost element - that is, the debit cost element is the settlement cost element.
    This is a good idea, for example, if the required capital spending for an asset you are building yourself is to be monitored. These costs are settled by cost element to an inventory account in Asset Accounting at the end of the year, or when the measure is complete.
    Each allocation structure must fulfil the following criteria:
    Completeness
    An allocation structure is assigned to each object to be settled. All cost elements in which costs are incurred, must be represented in the appropriate allocation structure.
    Uniqueness
    Each cost element in which costs are incurred may only appear once in an allocation structure. Only one settlement cost element may be assigned to a source within a particular allocation structure.
    Source Structure:
    A source structure contains several source assignments, each of which contains the individual cost elements or cost element intervals to be settled using the same distribution rules.
    In the settlement rule for the sender you can define one distribution rule, in which you specify the distribution and receivers for the costs for each source assignment.
    Thanks,
    Rau

  • Defaulting Rules Not Working for Repair Orders in OM?

    Hi,
    Defaulting Rules have been setup for return line & standard line based on few conditions and it is working fine if we create a sales order directly from OM (Manual SO)?
    But in our project we are using  Depot Repair(Repair Orders), we tried to create a service request and then converted to a sales order here defaulting rules not working for repair orders?
    Please help me to solve this issue ASAP.
    Thanks,
    Kishor

    Hi,
    You have like this:
    1. Price list
    2.OE_DEFAULT_PVT.Get_SOB_Currency_Code
    You have to make
    1. XXOE_DEFAULT_PVT.custom_code
    2. Price list
    3.OE_DEFAULT_PVT.Get_SOB_Currency_Code
    Did you made own custom code to pick currency?
    Regards,
    Luko

  • Using Sales order by Defaulting Rules

    I would like to ask how to capture sales order information into custom plsql by using Defaulting rules in 11i Order management.
    and my custom plsql is this
    create or replace package body ame_default_sch_date_ven_pkg as
    FUNCTION default_SSD (p_database_object_name IN VARCHAR2,p_attribute_code IN VARCHAR2)
    RETURN date IS
    v_ssd DATE;
    l_atp_flag varchar2(1);
    l_org_id NUMBER;
    BEGIN
    IF ONT_LINE_Def_Hdlr.g_record.ship_from_org_id IS NOT NULL
    THEN
    l_org_id:=trim(ONT_LINE_Def_Hdlr.g_record.ship_from_org_id);
    INSERT INTO amei_venkanna_temp values ('org_id'||l_org_id);
    IF ONT_LINE_Def_Hdlr.g_record.inventory_item_id IS NOT NULL
    THEN
    BEGIN
    SELECT atp_flag
    INTO l_atp_flag
    from mtl_system_items
    where inventory_item_id = ONT_LINE_Def_Hdlr.g_record.inventory_item_id
    and organization_id=ONT_LINE_Def_Hdlr.g_record.ship_from_org_id;
    EXCEPTION
    WHEN OTHERS
    THEN
    NULL;
    END;
    END IF;
    COMMIT;
    END IF;
    IF l_atp_flag='N'
    THEN
    INSERT INTO ame_venkanna_temp values ('Non ATP item');
    v_ssd := ONT_LINE_Def_Hdlr.g_record.request_date+5;
    ELSE
    INSERT INTO ame_venkanna_temp values ('ATP item');
    v_ssd := ONT_LINE_Def_Hdlr.g_record.request_date+5;
    COMMIT;
    NULL;
    END IF;
    return v_ssd;
    END;
    END;
    Please have some thought on this issue would be appreciated.
    thanks
    Edited by: ameer.oracle on May 15, 2013 10:50 PM

    Hi Ameer,
    it's not clear to me what you actually want to achieve, but if you plan to customize the defaulting rules in OM, I can recommend following note:
    *Using Defaulting Rules in Oracle Order Management [ID 122461.1]*
    That one in combination with some forms personalizations helped us to have some advanced defaulting logic.
    I can try to help more, if you describe your business case in more details.
    regards,
    David.

  • Defaulting Rule not working for Order Currency

    Hi,
    We have a requirement where we need to have defaulting currency as SEK for one of the Sweden customer. We have set the defaulting rules for the same but doesn't seem to work. Any suggestions will help..
    Thanks in Advance.

    Hi,
    You have like this:
    1. Price list
    2.OE_DEFAULT_PVT.Get_SOB_Currency_Code
    You have to make
    1. XXOE_DEFAULT_PVT.custom_code
    2. Price list
    3.OE_DEFAULT_PVT.Get_SOB_Currency_Code
    Did you made own custom code to pick currency?
    Regards,
    Luko

  • Creation of New Default Rule in OPL8

    Hi,
    In TC : OPL8, in cost accounting tab we maintain the default rule.
    Can we create our own default rule?
    The issue is we are using the CO-Product scenario in IS MILL. There the two default rules are PP5 and PP6. Both are Full settlement type.
    But as we are using Cost Object Hierarchy, we cannot use the Full settlement type. So we want something similar to PP2 but having te features of PP5 or PP6.
    Can we achieve this in any way by creating new default rule or how to acheive this.
    Regards
    Kami

    Hi
    You can change it in OPL8 when you create New Order Type
    Even if you dont change, it will be overwritten by PER when you use Cost Obj Hierarchy
    br, Ajay M

  • PL/SQL API + Defaulting Rules in OM

    Hi,
    I want to default custom rule in Sales Order from whenever I select Item. After selecting item from the sales order from, it should populate Warehouse value in Shipping tab. I am using custom PL/SQL API option. I wrote one function and kept in package. I was disabled all defaulting rules. Now If I select Item in sales order form, I am not getting warehouse value.
    The steps are:
    Step 1. Select Warehouse attribute and define defaulting rule
    Application: Order Management
    Entry: Order Line
    Select Attribute as Warehouse
    Click on Defaulting Rules
    Step 2: Define Defaulting Sourcing Rule
    Select Source type as PL/SQL API.
    In the Defaulting Source/Value field give Package Name and Function Name.
    Open Catalog Groups window from the below path: Setup  Items  Catalog Groups
    Specify Name and Description for Catalog Group
    Click on Details button.
    Step 3: Create Catalog Group
    Step 4: Specify Descriptive Elements for the Item Catalog Group
    Step 5: Code preparation
    -- My Custom Code
    Create or replace FUNCTION custom_default_rule
    RETURN VARCHAR2
    AS
    l_line_type_rec oe_order_cache.line_type_rec_type;
    CURSOR cus_l
    IS
    SELECT a.organization_code, b.element_name, b.element_value
    FROM mtl_parameters a,
    mtl_descr_element_values b,
    mtl_system_items_b c
    WHERE b.inventory_item_id = c.inventory_item_id
    AND a.organization_id = c.organization_id
    AND a.organization_id = c.organization_id
    AND c.inventory_item_id = 12924
    GROUP BY a.organization_code, b.element_name, b.element_value
    ORDER BY a.organization_code, b.element_name, b.element_value;
    BEGIN
         l_line_type_rec := oe_order_cache.load_line_type
    (ont_line_def_hdlr.g_record.line_type_id);
    FOR cur_rec IN cus_l
    LOOP
    IF cur_rec.element_name IN
    ('Frequency',
    'Emission Norms',
    'Voltage',
    'Duty Rating',
    'Phase',
    'Product'
    AND cur_rec.element_value IN
    ('50', '', '230', 'Medium', 'Single', 'QSK60')
    THEN
    RETURN cur_rec.organization_code;
    ELSIF cur_rec.element_name IN
    ('Frequency',
    'Emission Norms',
    'Voltage',
    'Duty Rating',
    'Phase',
    'Product'
    AND cur_rec.element_value IN
    ('50', '', '230', 'Medium', 'Three', 'QSK15')
    THEN
    RETURN cur_rec.organization_code;
    ELSIF cur_rec.element_name IN
    ('Frequency',
    'Emission Norms',
    'Voltage',
    'Duty Rating',
    'Phase',
    'Productfamily'
    AND cur_rec.element_value IN
    ('50', '', '230', 'Medium', 'Single', 'DQK50')
    THEN
    RETURN cur_rec.organization_code;
    END IF;
    END LOOP;
    EXCEPTION
    WHEN OTHERS
    THEN
    IF oe_msg_pub.check_msg_level (oe_msg_pub.g_msg_lvl_unexp_error)
    THEN
    oe_msg_pub.add_exc_msg ('OE_Default_PVT', 'CUSTOM_DEFAULT_RULE');
    END IF;
    RAISE fnd_api.g_exc_unexpected_error;
    END custom_default_rule;
    Step 6: Create a Sales Order (Order Returns  Sales Orders)
    Select Customer and Order Type and select Line Items Tab.
    Select Item from the Ordered Item Field. Press Tab.
    After pressing tab in the Shipping Tab Warehouse value Should be populated. But it is not working.
    Can anyone guide me in this.
    It is very urgent.
    If possible, Please send u r details to my official id: [email protected]
    Thanks in Advance,
    sateesh

    Sateesh,
    This is working fine for me here:
    CREATE OR REPLACE PACKAGE xx_def_wh
    AS
    FUNCTION custom_default_rule (p_database_object_name IN VARCHAR2, p_attribute_code IN VARCHAR2)
    RETURN NUMBER;
    END;
    CREATE OR REPLACE PACKAGE BODY xx_def_wh
    AS
    FUNCTION custom_default_rule (p_database_object_name IN VARCHAR2, p_attribute_code IN VARCHAR2)
    RETURN NUMBER
    AS
    l_line_type_rec oe_order_cache.line_type_rec_type;
    l_item_id NUMBER;
    CURSOR cus_l(p_item_id in number)
    IS
    SELECT a.organization_id, b.element_name, b.element_value
    FROM mtl_parameters a, mtl_descr_element_values b, mtl_system_items_b c
    WHERE b.inventory_item_id = c.inventory_item_id
    AND a.organization_id = c.organization_id
    AND a.organization_id = c.organization_id
    AND c.inventory_item_id = p_item_id
    and a.organization_id<>a.master_organization_id
    ORDER BY a.organization_id;
    BEGIN
    l_line_type_rec := oe_order_cache.load_line_type (ont_line_def_hdlr.g_record.line_type_id);
    l_item_id:= ONT_LINE_DEF_HDLR.g_record.inventory_item_id;
    FOR cur_rec IN cus_l(l_item_id)
    LOOP
    IF cur_rec.element_name IN ('Frequency', 'Emission Norms', 'Voltage', 'Duty Rating', 'Phase', 'Product')
    AND cur_rec.element_value IN ('50', '', '230', 'Medium', 'Single', 'QSK60')
    THEN
    RETURN cur_rec.organization_id;
    ELSIF cur_rec.element_name IN ('Frequency', 'Emission Norms', 'Voltage', 'Duty Rating', 'Phase', 'Product')
    AND cur_rec.element_value IN ('50', '', '230', 'Medium', 'Three', 'QSK15')
    THEN
    RETURN cur_rec.organization_id;
    ELSIF cur_rec.element_name IN ('Frequency', 'Emission Norms', 'Voltage', 'Duty Rating', 'Phase', 'Productfamily')
    AND cur_rec.element_value IN ('50', '', '230', 'Medium', 'Single', 'DQK50')
    THEN
    RETURN cur_rec.organization_id;
    END IF;
    END LOOP;
    EXCEPTION
    WHEN OTHERS
    THEN
    IF oe_msg_pub.check_msg_level (oe_msg_pub.g_msg_lvl_unexp_error)
    THEN
    oe_msg_pub.add_exc_msg ('OE_Default_PVT', 'CUSTOM_DEFAULT_RULE');
    END IF;
    RAISE fnd_api.g_exc_unexpected_error;
    END custom_default_rule;
    END;
    Thanks
    Nagamohan

  • Defaulting Rules using PL/SQL Api - ORA error

    Hi All,
    Iam using the PLSQL api for OM defaulting rules. Based on the item in the Sales order line, Line type has to be defaulted.
    I have put debug messages and iam able to see successful execution and the required Line type value is returned. No exception is raised.
    Error ORA-06502 PL/SQL numberic to value error. Character to number conversion error is thrown outside the custom package.
    PLSQL api is coded as below.
    CREATE OR REPLACE PACKAGE BODY xx_default_ordertype IS
    G_PKG_NAME      CONSTANT VARCHAR2(30) := 'XX_DEFAULT_ORDERTYPE';
    FUNCTION get_trans_type
    p_database_object_name IN VARCHAR2,
    p_attribute_code IN VARCHAR2
    RETURN varchar2 IS
    l_trans_type VARCHAR2(30);
    -- l_item_id NUMBER := ONT_LINE_DEF_HDLR.g_record.ORDERED_ITEM_ID;
    BEGIN
    SELECT b.name
    INTO l_trans_type
    FROM OE_TRANSACTION_TYPES_tL b,
    oe_transaction_types_all a
    WHERE a.transaction_type_id=b.transaction_type_id
    AND attribute1=ONT_LINE_DEF_HDLR.g_record.INVENTORY_ITEM_ID;
    RETURN l_trans_type;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    RETURN l_trans_type;
    WHEN OTHERS THEN
    insert_sstab(7,'in exception');
    IF OE_MSG_PUB.Check_Msg_Level (OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
    OE_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'xx_default_ordertype');
    END IF;
    RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
    END get_trans_type;
    END xx_default_ordertype;
    Not able to figure out where the ORA error is getting raised from.
    Kindly help
    Edited by: user11969666 on Mar 19, 2011 7:47 AM

    btw, I did try your test and it didn't error for me:
    CREATE OR REPLACE PACKAGE xx_default_ordertype IS
    FUNCTION get_trans_type
    p_database_object_name IN VARCHAR2,
    p_attribute_code IN VARCHAR2
    RETURN varchar2;
    end xx_default_ordertype;
    CREATE OR REPLACE PACKAGE BODY xx_default_ordertype IS
    FUNCTION get_trans_type
    p_database_object_name IN VARCHAR2,
    p_attribute_code IN VARCHAR2
    RETURN varchar2 IS
    l_trans_type OE_TRANSACTION_TYPES_tL.name%TYPE :='a';
    BEGIN
    RETURN l_trans_type;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    RETURN l_trans_type;
    END get_trans_type;
    END xx_default_ordertype;
    begin
    dbms_output.put_line(xx_default_ordertype.get_trans_type('X','Y'));
    end;
    /

  • How is an Order Routing rule connected to the IC Webclient Profile

    I created a simple ERMS order routing rule that If priority equals very high then route to John Smith whom is assigned to the IC Web position in PPOMW.
    When I create a service ticket and mark it very high and choose the ESCALATE button the message no rule for routing was found. 
    I don't see anyway to connect this rule to our IC Webclient profile, or why the rule wasn't envoked. Will give points.
    Edited by: John Burton on Apr 21, 2008 2:54 PM

    Hello Glenn,
    Yes, you are correct. In addition to creating a Rule Modeler policy via the IC Manager role (accessible from the BSP view or Enterprise Portal), the business user also needs to request that IT (or someone) add the name of the Rule Modeler policy as an attribute of the RE_RULE_EXEC service for the applicable Service Manager profile in the IMG configuration for the relevant Rule Modeler context (Order Routing, ERMS, etc.). I certainly agree with you that the business user and the IT user as generally two different people. And if they are the same person, Sarbanes Oxley probably has something to say about that Your point is definitely valid. Perhaps in the future we need to be more considerate of the distinction of job responsibilities of business user versus IT user when designing products and solutions.
    By the way, just as an aside... some Rule Modeler contexts can only use one Service Manager profile (for example Order Routing must always use a Service Manager profile called "SAP_ORDERROUTING") while other contexts can use multiple Service Manager profiles. For example, as of CRM 2005 (CRM 5.0) it is possible in transaction CRMC_ERMS_SM_PDET to assign different Service Manager profiles directly to different inbound email addresses for ERMS. And by assigning a different Rule Modeler policy to each Service Manager profile, you can use different root/default Rule Modeler policies for each incoming email address.
    Warm regards,
    John
    Edited by: John Burton on May 1, 2008 10:01 PM

  • Maintain internal order settlement rule using LSMW

    HI ALL
    I want to do mass maintenance of internal order settlement rule. Settlement category is PSG.
    But when I use LSMW to do KO02, I only can input one settlement receriver, the first line will be overwritten by the second line.
    I also see BAPI INTERNAL_ORDER_CREATE,but cannot find PSG as a settlement category.
    Does anyone know how to do this?
    THX
    Deelia

    Hi Lian
    When you do recording, enter two settlement rules..
    Then, before pressing the "DEFAULT ALL" button, change the Field names for the 2nd settlement rule
    The problem you described happens because the field names for both settlement rules are same.. Hence, it gets overwritten
    Assume that field name for Order is AUFNR... You can change the field name in recording to ZAUFNR for one of the fields
    See the screen shot, wherein I changed the name of the recorded field to _01, _15 and _70
    Br. Ajay M

  • BLANKET SALES ORDER의 DATA가 ORDER의 DEFAULT 값으로 되지 않는 이유?

    제품 : MFG_OM
    작성날짜 : 2004-10-12
    BLANKET SALES ORDER의 DATA가 ORDER의 DEFAULT 값으로 되지 않는 이유?
    ===================================================================
    PURPOSE
    Blanket Sales Agreement form에서 Create Release button을 선택하면
    Blanket Sales Agreement의 정보들이 Sales Order form의 default 값으로
    입력되어 보여야 하나 현재는 Sales Order form은 open 되지만 header나
    line에 blanket의 data가 populated 되지 않는다.
    이 note에서는 그 원인과 해결책을 알아본다.
    Explanation
    Change(s)
    =========
    Blanket Sales Agreement는 정의 되어 있고, Customer 정보는 Header에 입력
    되어 있다. 또한 Line item은 특정 products을 위해 정의되어 있다.
    Blanket agreement는 blanket order type과 연관되어 있다.
    원인
    ====
    보통 Agreements에 대한 Orders/Releases를 신청하는 Customers는 먼저
    folder를 만들어야만 한다. 이 folder는 order header에 blanket number
    field는 가지며 default folder로 저장되야 한다.
    Blanket Sales Agreement form에서 Create Release button을 click 하면
    Sales Order form이 열리고 cursor는 blanket agreement field로 이동할
    것이다.
    User가 다른 field로 tab을 하면 customer data는 blanket에서 release
    order로 default 조회된다.
    만약 Customer data가 아닌 다른 data를 blanket agreement에서 release
    order로 default 하길 원한다면, 먼저 그 영향을 주는 defaulting rule을
    생성해야 한다.
    Fix
    =====
    Blanket으로부터 data를 default로 받길 원하면 Sales order header와
    line에 있는 모든 field에 대한 defaulting rules은 정의되어져 있어야 한다.
    Defaulting rule에서 defaulting source로 'Blanket'을 이용하여 가능하다.
    Example
    Price List는 blanket agreement의 값을 default로 해야 하는 business rule
    이 있다면, Price List의 defaulting rules을 아래와 같이 변경한다.
    Price List First Default
    =========================
    Source Type : Related Record
    Default Source : Blanket Agreement
    위와 같은 rules은 blanket header를 sales order header default로 하거나
    blanket line을 sales order line의 default로 하려면 먼저 생성되어져야
    한다.
    Reference Documents
    Note 253150.1

  • Production order default settlement type

    Hi,
    After creating a production order, manually we are maintaining settlement rule by entering catogory and settlement receiver and
    after pressing enter automatically the settlement type proposed is PER, but we want system to propose FUL,
    pl suggest.
    Regards,
    Santhosh

    HI Santosh
    Please check you own thread for the same issue.
    Re: Production order default settlement type
    either close the previous one and then raise second issue.
    Regards
    Anupam Sharma

  • Defaulting Rule - Help Needed

    hi,
    I want to default the Order Line based on specific Item. I have created the Defaulting Condition Template specifying the item for Entity Order Line.
    At the Item Type : I have added a new defaulting condition with a precedence later than the Regular Line and have added a constant value as the order line type.
    But it doesnt seem to work out. I have compiled the defaulting rules. But it still does not seem to work out.
    Can any one help or atleast point out how to get this thing working ?
    The idea is to have separate line type created for manufactured shippable items and separate line type for service items. Service module is not being implemented.
    since, the number of service items are not large so I am planning to hard code with the service items.
    I am not sure how the PL/SQL process would work. But if somebody could point out the PL/SQL usage for this with pseudo code. I think it might help out.
    Thanks,
    Dhiraj

    Hi Dhiraj,
    I understand that you are looking for different line types for different item types. This can be easily set up in the transaction type definition form itself. You don't have to setup special defaulting rules for this.
    In the transaction type form , when you assign line flows, it lets you choose item type. So you can set different line types for each item_type.
    Regards,
    Swapna.

  • Defaulting Rules on Line Type

    Hi,
    I have set up a Defaulting rule based for line type. This defaulting rule calls a custom package on the database to retrieve the correct value. Everything works fine when creating a manual order, but when an order is created automatically via Workfklow then the rule is not applied.
    I added a dependency using the OE_Dependencies_Extn package as documented by oracle, in here I link g_inventory_item to g_line_type as follows:
    x_extn_dep_tbl(l_index).source_attribute := OE_LINE_UTIL.G_INVENTORY_ITEM;
    x_extn_dep_tbl(l_index).dependent_attribute := OE_LINE_UTIL.G_LINE_TYPE;
    x_extn_dep_tbl(l_index).enabled_flag := 'Y';
    l_index := l_index + 1;
    I can see from some logging I put in that when the custom package is called to determine the line_type that the item_id is not populated correctly!
    Anyone have an idea how to resolve this?

    From what I have seen the only loop you can use in a SmartForm is a loop over an internal table. Can you provide more information on the "Repeat Processing" you talk about?
    Che

  • OM Defaulting Rule Customization

    Hi All,
    I have requirement to derive Order Header Sales Channel Code from Sales Person DFF attribute.
    Try to custom using Sales Channel defaulting rule but referencing to ONT_HEADER_DEF_HDLR.g_record.salesrep_id always return FND_API.G_MISS_NUM value.
    Any idea on how to solve this issue?
    TIA,
    Fendy

    Hi Luko,
    Seems like its Oracle bugs.
    First time i open Sales Order Form, its trigger ONT_HEADER_Def_Hdlr package
    1)
    l_attr:= 'SALESREP_ID';
    IF g_record.SALESREP_ID = FND_API.G_MISS_NUM THEN
    -- Get the defaulting api registered in the AK AND default
    l_attr:=l_attr||' 1';
    g_record.SALESREP_ID := ONT_D1_SALESREP_ID.Get_Default_Value(g_record);
    l_attr:=l_attr||' 2';
    IF g_record.SALESREP_ID IS NULL
    AND p_in_old_rec.SALESREP_ID <> FND_API.G_MISS_NUM THEN
    g_record.SALESREP_ID := p_in_old_rec.SALESREP_ID;
    END IF;
    -- For UPDATE operations, check security if new defaulted value is not equal to old value
    IF g_record.operation = OE_GLOBALS.G_OPR_UPDATE THEN
    l_attr:=l_attr||' 3';
    IF NOT OE_GLOBALS.Equal(g_record.salesrep_id, p_in_old_rec.salesrep_id) THEN
    IF OE_HEADER_SECURITY.SALESREP(p_record => g_record, x_on_operation_action => l_action) = OE_PC_GLOBALS.YES THEN
    -- Raise error if security returns YES, operation IS CONSTRAINED
    RAISE FND_API.G_EXC_ERROR;
    END IF;
    OE_GLOBALS.G_ATTR_UPDATED_BY_DEF := 'Y';
    END IF;
    END IF;
    IF g_record.SALESREP_ID IS NOT NULL THEN
    l_attr:=l_attr||' 4';
    -- Validate defaulted value if not null
    IF OE_VALIDATE.SALESREP(g_record.SALESREP_ID) THEN
    -- There is no dependent api registered in the AK dictionary
    NULL;
    l_attr:=l_attr||' 5';
    ELSE
    g_record.SALESREP_ID := NULL;
    l_attr:=l_attr||' 6';
    END IF;
    END IF;
    END IF;
    which return g_record.SALESREP_ID = FND_API.G_MISS_NUM
    then l_attr:= 'SALES_CHANNEL_CODE' is being called
    2)
    IF g_record.SALES_CHANNEL_CODE = FND_API.G_MISS_CHAR THEN
    -- Get the defaulting api registered in the AK AND default
    l_attr:=l_attr||' 1';
    g_record.SALES_CHANNEL_CODE := ONT_D1_SALES_CHANNEL_CODE.Get_Default_Value(g_record);
    l_attr:=l_attr||' 2';
    -- For UPDATE operations, check security if new defaulted value is not equal to old value
    IF g_record.operation = OE_GLOBALS.G_OPR_UPDATE THEN
    l_attr:=l_attr||' 3';
    IF NOT OE_GLOBALS.Equal(g_record.sales_channel_code, p_in_old_rec.sales_channel_code) THEN
    IF OE_HEADER_SECURITY.SALES_CHANNEL_CODE(p_record => g_record, x_on_operation_action => l_action) = OE_PC_GLOBALS.YES THEN
    -- Raise error if security returns YES, operation IS CONSTRAINED
    RAISE FND_API.G_EXC_ERROR;
    END IF;
    OE_GLOBALS.G_ATTR_UPDATED_BY_DEF := 'Y';
    END IF;
    END IF;
    -- There is no validation api registered in the AK dictionary
    END IF;
    which return g_record.SALES_CHANNEL_CODE is null because calling to xx03ont_oe_default_pvt.sales_channel_code return null.
    So the next visit to this ONT_HEADER_Def_Hdlr package when bill to location is entered :
    g_record.SALESREP_ID is filled but g_record.SALESREP_ID is not, due to following condition does not meet
    IF g_record.SALES_CHANNEL_CODE = FND_API.G_MISS_CHAR THEN
    I try to change this package as following (pls see the bold)
    IF g_record.SALES_CHANNEL_CODE = FND_API.G_MISS_CHAR
    OR g_record.SALES_CHANNEL_CODE IS NULL THEN -- New Added
    -- Get the defaulting api registered in the AK AND default
    l_attr:=l_attr||' 1';
    g_record.SALES_CHANNEL_CODE := ONT_D1_SALES_CHANNEL_CODE.Get_Default_Value(g_record);
    l_attr:=l_attr||' 2';
    -- For UPDATE operations, check security if new defaulted value is not equal to old value
    IF g_record.operation = OE_GLOBALS.G_OPR_UPDATE THEN
    l_attr:=l_attr||' 3';
    IF NOT OE_GLOBALS.Equal(g_record.sales_channel_code, p_in_old_rec.sales_channel_code) THEN
    IF OE_HEADER_SECURITY.SALES_CHANNEL_CODE(p_record => g_record, x_on_operation_action => l_action) = OE_PC_GLOBALS.YES THEN
    -- Raise error if security returns YES, operation IS CONSTRAINED
    RAISE FND_API.G_EXC_ERROR;
    END IF;
    OE_GLOBALS.G_ATTR_UPDATED_BY_DEF := 'Y';
    END IF;
    END IF;
    -- There is no validation api registered in the AK dictionary
    IF g_record.SALES_CHANNEL_CODE = FND_API.G_MISS_CHAR THEN
    g_record.SALES_CHANNEL_CODE := NULL;
    END IF;
    END IF;
    After changing this package, its working. Unfortunately, this is seeded package. So i revert back the code and change to use form personalization instead.
    Let me know if you have another work around.
    TIA,
    Fendy

Maybe you are looking for

  • Connecting to a Mysql database using a ColdFusion server

    can't create a mysql datasource in CF Administrator. If I use the following datasource settings in CF Administrator: JDBC URL: jdbc:mysql://localhost:3306/test Drive Class: MySQL Connector J AND (note the emphasis) I set my local and remote folders i

  • Why can I no longer backup my Iphone to Outlook using ITunes?

    Why can I no longer backup my Iphone to Outlook using ITunes? for 6 months I never had a problem as it was indicated on Itunes but now the word OUTLOOK has disappeared from the screen!

  • Problems accessing my DMZ on LAN

    Hi, I am running Solaris 10 (x86) and have decided to setup a zone as a website. I have apache2 running successfully and can access the test page over my LAN. However i am unable to access the same page from the WWW through my ADSL Trust 445A router

  • Photoshop CS6 Install Question

    Why does the Adobe Photoshop CS6 have the two install options clicked by default? These are the Adobe Photoshop CS6 (64 Bit) and the Adobe Photoshop CS6. I have Win7 Ultimate 64-bit. Am I missing some features if I only install the former? Is the lat

  • Reduce time

    Hi I have records more than one one Lakh in my table. 1) i have created index for a primary key column. 2) i have used analytical functions in where condition. so now i want to reduce time for that query .. is there any way to reduce time ...???