Unit Selling Price Override through PROCESS_ORDER API

Hi All,
I have this below requirement to be achieved through process_order API.
1. In the Order Oganizer UI, I open the Order Entry form.
2. Open the Lines tab
3. For the Unit Selling Price, I change the price manually and tab out.
4. Its gives me a LOV to select a Surcharge modifier.
5. I select one of the surcharge and click save.
6. The price is overridden and a manual price adjustment is created for the above selected surcharge.
This functionality I want to acieve through the PROCESS_ORDER API. Basically, I want to override the unit selling price and apply a surchage modifier. This should change the selling price and create a adjustement record for the above line.
Please let me know if anyone knows about this. That would help me.
Thanks,
Anand

Anand
I tested this in 12.0.4 vision and works. Also if you need to use update option if you are applying the same modifier more than once(not create), just like the way screen changes behave.
DECLARE
l_return_status VARCHAR2 (30);
x_msg_data VARCHAR2 (2000);
x_msg_count NUMBER;
l_adj_rec oe_order_pub.line_adj_rec_type;
l_adj_tbl oe_order_pub.line_adj_tbl_type;
l_x_header_rec oe_order_pub.header_rec_type;
l_x_header_adj_tbl oe_order_pub.header_adj_tbl_type;
l_x_header_scredit_tbl oe_order_pub.header_scredit_tbl_type;
l_x_line_tbl oe_order_pub.line_tbl_type;
l_x_line_adj_tbl oe_order_pub.line_adj_tbl_type;
l_x_line_scredit_tbl oe_order_pub.line_scredit_tbl_type;
l_x_lot_serial_tbl oe_order_pub.lot_serial_tbl_type;
l_x_action_request_tbl oe_order_pub.request_tbl_type;
l_x_header_price_att_tbl oe_order_pub.header_price_att_tbl_type;
l_x_header_adj_att_tbl oe_order_pub.header_adj_att_tbl_type;
l_x_header_adj_assoc_tbl oe_order_pub.header_adj_assoc_tbl_type;
l_x_line_price_att_tbl oe_order_pub.line_price_att_tbl_type;
l_x_line_adj_att_tbl oe_order_pub.line_adj_att_tbl_type;
l_x_line_adj_assoc_tbl oe_order_pub.line_adj_assoc_tbl_type;
l_list_line_type_code VARCHAR2 (30) := NULL;
l_list_line_id NUMBER;
l_x_header_payment_tbl oe_order_pub.header_payment_tbl_type;
l_x_line_payment_tbl oe_order_pub.line_payment_tbl_type;
l_prc_adj_request oe_order_pub.request_tbl_type;
l_prc_adj_index NUMBER := 1;
l_price_adj_id NUMBER;
v_msg_index_out NUMBER;
x_header_rec_type oe_order_pub.header_rec_type;
x_header_val_rec_type oe_order_pub.header_val_rec_type;
x_header_adj_tbl_type oe_order_pub.header_adj_tbl_type;
x_header_adj_val_tbl_type oe_order_pub.header_adj_val_tbl_type;
x_header_price_att_tbl_type oe_order_pub.header_price_att_tbl_type;
x_header_adj_att_tbl_type oe_order_pub.header_adj_att_tbl_type;
x_header_adj_assoc_tbl_type oe_order_pub.header_adj_assoc_tbl_type;
x_header_scredit_tbl_type oe_order_pub.header_scredit_tbl_type;
x_header_scredit_val_tbl_type oe_order_pub.header_scredit_val_tbl_type;
x_line_tbl_type oe_order_pub.line_tbl_type;
x_line_val_tbl_type oe_order_pub.line_val_tbl_type;
x_line_adj_tbl_type oe_order_pub.line_adj_tbl_type;
x_line_adj_val_tbl_type oe_order_pub.line_adj_val_tbl_type;
x_line_price_att_tbl_type oe_order_pub.line_price_att_tbl_type;
x_line_adj_att_tbl_type oe_order_pub.line_adj_att_tbl_type;
x_line_adj_assoc_tbl_type oe_order_pub.line_adj_assoc_tbl_type;
x_line_scredit_tbl_type oe_order_pub.line_scredit_tbl_type;
x_line_scredit_val_tbl_type oe_order_pub.line_scredit_val_tbl_type;
x_lot_serial_tbl_type oe_order_pub.lot_serial_tbl_type;
x_lot_serial_val_tbl_type oe_order_pub.lot_serial_val_tbl_type;
x_request_tbl_type oe_order_pub.request_tbl_type;
x_header_payment_tbl_type oe_order_pub.header_payment_tbl_type;
x_header_payment_val_tbl_type oe_order_pub.header_payment_val_tbl_type;
x_line_payment_tbl_type oe_order_pub.line_payment_tbl_type;
x_line_payment_val_tbl_type oe_order_pub.line_payment_val_tbl_type;
l_control_rec oe_globals.control_rec_type;
BEGIN
fnd_global.apps_initialize (1005902, 21623, 660);
mo_global.set_policy_context ('S', 204);
l_x_line_tbl (1).line_id := 319799;
l_x_line_tbl (1).header_id := 155008;
l_adj_rec := oe_order_pub.g_miss_line_adj_rec;
l_adj_rec.price_adjustment_id := fnd_api.g_miss_num;
l_adj_rec.list_header_id := 8988; --Modifier id
l_adj_rec.list_line_id := 16596; --Modifier line id
l_adj_rec.automatic_flag := 'N';
l_adj_rec.list_line_type_code := 'DIS'; --Change this is it is surcharge
l_adj_rec.arithmetic_operator := 'AMT'; --Percentage or amount
l_adj_rec.operand := 10; --How much?
l_adj_rec.operation := oe_globals.g_opr_create;
l_adj_rec.line_index := 1;
l_adj_rec.update_allowed := 'Y';
l_adj_rec.applied_flag := 'Y'; --this is required to change the price of the line
l_adj_rec.change_reason_code := 'MANUAL';
l_adj_rec.change_reason_text := 'Manually applied adjustments';
l_adj_tbl (1) := l_adj_rec;
l_control_rec.process_entity := oe_globals.g_entity_line_adj;
l_control_rec.process := TRUE;
oe_order_pub.process_order (p_api_version_number => 1.0
, x_return_status => l_return_status
, x_msg_count => x_msg_count
, x_msg_data => x_msg_data
, p_header_rec => l_x_header_rec
, p_header_adj_tbl => l_x_header_adj_tbl
, p_header_scredit_tbl => l_x_header_scredit_tbl
, p_header_payment_tbl => l_x_header_payment_tbl
, p_line_tbl => l_x_line_tbl
, p_line_adj_tbl => l_adj_tbl
, p_line_scredit_tbl => l_x_line_scredit_tbl
, p_line_payment_tbl => l_x_line_payment_tbl
, p_lot_serial_tbl => l_x_lot_serial_tbl
, p_action_request_tbl => l_prc_adj_request
, p_header_price_att_tbl => l_x_header_price_att_tbl
, p_header_adj_att_tbl => l_x_header_adj_att_tbl
, p_header_adj_assoc_tbl => l_x_header_adj_assoc_tbl
, p_line_price_att_tbl => l_x_line_price_att_tbl
, p_line_adj_att_tbl => l_x_line_adj_att_tbl
, p_line_adj_assoc_tbl => l_x_line_adj_assoc_tbl
, x_header_rec => x_header_rec_type
, x_header_val_rec => x_header_val_rec_type
, x_header_adj_tbl => x_header_adj_tbl_type
, x_header_adj_val_tbl => x_header_adj_val_tbl_type
, x_header_price_att_tbl => x_header_price_att_tbl_type
, x_header_adj_att_tbl => x_header_adj_att_tbl_type
, x_header_adj_assoc_tbl => x_header_adj_assoc_tbl_type
, x_header_scredit_tbl => x_header_scredit_tbl_type
, x_header_scredit_val_tbl => x_header_scredit_val_tbl_type
, x_header_payment_tbl => x_header_payment_tbl_type
, x_header_payment_val_tbl => x_header_payment_val_tbl_type
, x_line_tbl => x_line_tbl_type
, x_line_val_tbl => x_line_val_tbl_type
, x_line_adj_tbl => x_line_adj_tbl_type
, x_line_adj_val_tbl => x_line_adj_val_tbl_type
, x_line_price_att_tbl => x_line_price_att_tbl_type
, x_line_adj_att_tbl => x_line_adj_att_tbl_type
, x_line_adj_assoc_tbl => x_line_adj_assoc_tbl_type
, x_line_scredit_tbl => x_line_scredit_tbl_type
, x_line_scredit_val_tbl => x_line_scredit_val_tbl_type
, x_line_payment_tbl => x_line_payment_tbl_type
, x_line_payment_val_tbl => x_line_payment_val_tbl_type
, x_lot_serial_tbl => x_lot_serial_tbl_type
, x_lot_serial_val_tbl => x_lot_serial_val_tbl_type
, x_action_request_tbl => x_request_tbl_type
DBMS_OUTPUT.put_line (l_return_status);
IF x_msg_count > 0
THEN
FOR v_index IN 1 .. x_msg_count
LOOP
oe_msg_pub.get (p_msg_index => v_index, p_encoded => 'F', p_data => x_msg_data, p_msg_index_out => v_msg_index_out);
x_msg_data := SUBSTR (x_msg_data, 1, 200);
DBMS_OUTPUT.put_line (x_msg_data);
DBMS_OUTPUT.put_line ('============================================================');
END LOOP;
END IF;
END;
Thanks
Nagamohan

Similar Messages

  • Manual override option for Unit selling price in Order line level.

    In OM R-12
    Our client wants manual override option for Unit selling price in Order line level.
    But there is no solution available to fulfill this requirment. To be able to manually override the price on a Sales Order line you
    must have defined a manual modifier that qualifies for the Sales Order line in question. Without a suitable manual modifier the price cannot be changed.
    This is current standard functionality.
    Anybody can give some suggestion/workaround to override selling price in Order header level without using the modifiers.
    regards,

    Hi Kashif,
    I'm finding it little difficult to buy Oracle Support's feedback with regards to R12 functionality for direct List Price update without using any modifier (manual or whatever). After all it is Oracle's product and they should know better. But test results in Solution Beacon's Vision 12.0.6 instance (http://www.solutionbeacon.com/tools_r12vision.htm) and documentation updates in R12 (R12.0.4) OM user guide & implementation manuals potray a different picture.
    After your last post, I did a test in Solution Beacon's Vision 12.0.6 instance with following details:
    OM: List Price Override Privilege = "Unlimited Access" at user level
    OM: Discounting Privileges = "None" at user level
    No manual modifiers defined and Order status = "Entered"
    I could display the "List Price" field from folder under Line Items >> Main tab, override the list price to a new value and save. The unit selling price showed the new value based on updated List Price as soon as I tabbed out of the list price field after overriding. After saving it showed the new selling price. _Please note that under Line Items >> Pricing tab there is another "List Price" field and that is not editable_. For such overrides "View Adjustments" (from Line >> Actions) will not show any adjustment details as it is a direct update of list price.
    Also please note that, if "Enforce List Price" checkbox is selected for the order type, the list price cannot be overridden even if the profile option is set to "Unlimited Access".
    Document References:
    Oracle® Order Management User's Guide
    Release 12, Part No. B28099-03, September 2007 >> R12.0.4
    Page No. 10-74
    +Note: Note: If any order line for an order has the Calculate Price Flag value equal to Partial Price or Freeze Price new order level adjustments will not be applied or allowed to be overridden. _The profile option OM: List Price Override  Privilege controls your ability to override the unit list price. If you have this profile set to Unlimited, you may modify the unit list price by editing the current value displayed_. The original list price is saved in a hidden folder field, so you can display it if necessary+.
    Page No. 10-94
    User Procedures
    _A new profile option, OM: List Price Override Privilege controls whether or not you can update the List Price_. It is enabled and updated at the application, responsibility and user level. It is not user visible and updatable. The values include+:
    - View Only: This is the default value. If set to this value, the current behavior is retained, which means unit list price field is protected.
    - Unlimited Privilege: If set to this value, you can override the unit list price field from the main tab and immediately see selling price adjusted accordingly.
    To use Override List Price:
    +1. Navigate to the Sales Orders/Quick Sales Orders window.+
    +2. Enter the header and line information, including the ordered item and quantity, then tab to the next field. The Selling Price and List Price display+.
    +3. If the profile is set to Unlimited Privilege, you can enter a new list price in the List Price field. You can either proceed to the next line or save your work+.
    +4. You can see the new, entered list price, and if there are automatic discounts applied, they will be based on the new list price+.
    +5. If the folder has been modified to show the Original List Price, the original list price displays+.
    +6. To change the List Price again, go to the list price field and enter a new value, replacing a previously entered value. If Audit Trail is enabled for List Price and a reason is required, a window appears to enter a reason and optional comments+.
    Note: Subsequent overrides of the List Price, after the order line is saved, can be captured by Audit Trail, depending on the setup of Audit Trail (entered or booked state) and any processing constraints that have been set up.
    In the OM Implementation Manual also there are notes related to this.
    OM Implementation Manual
    Release 12, Part No. B25975-03, September 2007 >> R12.0.4
    You can refer to page no. 2-59, C-4 etc.
    Thanks
    Supro

  • Need Sample API code to update Quote Line level Unit Selling Price alone.

    Hi,
    i want to update Unit Selling Price alone using API, can any one have sample code to do that.
    ASO_QUOTE_PUB.Update_Quote_Line
    Thanks!
    Kishore

    Hi,
    please find the code below for ASO Quote Line Update. Here this sample only shows an DFF Attribute update. You can try the same for the Unit Selling price Update.
    DECLARE
    l_Api_Version_Number NUMBER;
    l_Init_Msg_List VARCHAR2(1000);
    l_Commit VARCHAR2(1000);
    l_Validation_Level      NUMBER;     
    l_Qte_Header_Rec ASO_QUOTE_PUB.Qte_Header_Rec_Type;
    l_Qte_Line_Rec ASO_QUOTE_PUB.Qte_Line_Rec_Type;
    l_Control_Rec ASO_QUOTE_PUB.Control_rec_Type;
    l_Qte_Line_Dtl_TBL ASO_QUOTE_PUB.Qte_Line_Dtl_tbl_Type;
    l_Line_Attribs_Ext_Tbl ASO_QUOTE_PUB.Line_Attribs_Ext_Tbl_type;
    l_Payment_Tbl ASO_QUOTE_PUB.Payment_Tbl_Type;
    l_Price_Adj_Tbl ASO_QUOTE_PUB.Price_Adj_Tbl_Type;
    l_Price_Attributes_Tbl ASO_QUOTE_PUB.Price_Attributes_Tbl_Type;
    l_Price_Adj_Attr_Tbl ASO_QUOTE_PUB.Price_Adj_Attr_Tbl_Type;
    l_Shipment_Tbl ASO_QUOTE_PUB.Shipment_Tbl_Type;
    l_Tax_Detail_Tbl ASO_QUOTE_PUB.Tax_Detail_Tbl_Type;
    l_Freight_Charge_Tbl ASO_QUOTE_PUB.Freight_Charge_Tbl_Type;
    l_Sales_Credit_Tbl ASO_QUOTE_PUB.Sales_Credit_Tbl_Type;
    l_Quote_Party_Tbl ASO_QUOTE_PUB.Quote_Party_Tbl_Type;
    l_Update_Header_Flag VARCHAR2(100);
    X_Qte_Line_Rec ASO_QUOTE_PUB.Qte_Line_Rec_Type;
    X_Qte_Line_Dtl_TBL ASO_QUOTE_PUB.Qte_Line_Dtl_TBL_Type;
    X_Line_Attribs_Ext_Tbl ASO_QUOTE_PUB.Line_Attribs_Ext_Tbl_type;
    X_Payment_Tbl ASO_QUOTE_PUB.Payment_Tbl_Type;
    X_Price_Adj_Tbl ASO_QUOTE_PUB.Price_Adj_Tbl_Type;
    X_Price_Attributes_Tbl ASO_QUOTE_PUB.Price_Attributes_Tbl_Type;
    X_Price_Adj_Attr_Tbl ASO_QUOTE_PUB.Price_Adj_Attr_Tbl_Type;
    X_Shipment_Tbl ASO_QUOTE_PUB.Shipment_Tbl_Type;
    X_Tax_Detail_Tbl ASO_QUOTE_PUB.Tax_Detail_Tbl_Type;
    X_Freight_Charge_Tbl ASO_QUOTE_PUB.Freight_Charge_Tbl_Type;
    X_Sales_Credit_Tbl ASO_QUOTE_PUB.Sales_Credit_Tbl_Type;
    X_Quote_Party_Tbl ASO_QUOTE_PUB.Quote_Party_Tbl_Type;
    lX_Return_Status VARCHAR2(1000);
    lX_Msg_Count NUMBER;
    lX_Msg_Data VARCHAR2(1000);
         lc_last_update_date date;
         l_file varchar2(2000);
         CURSOR c_quote(c_qte_header_id NUMBER) IS
         SELECT last_update_date
         FROM ASO_QUOTE_HEADERS_ALL
         WHERE quote_header_id = c_qte_header_id;
    BEGIN
         BEGIN
         MO_GLOBAL.init('SQLAP');
         MO_GLOBAL.set_policy_context('S',83);
         fnd_global.apps_initialize(1175,50689,280);
         END;
         OPEN c_quote(l_qte_header_rec.quote_header_id);
         FETCH c_quote INTO lc_last_update_date;
         CLOSE c_quote;
         aso_debug_pub.SetDebugLevel(10);
    aso_debug_pub.Initialize;
    l_file:= ASO_DEBUG_PUB.Set_Debug_Mode('FILE');
    aso_debug_pub.debug_on;
    aso_debug_pub.add('Update Quote',1, 'Y');
    dbms_output.put_line('File :'||l_file);
    dbms_output.put_line( to_char(sysdate, 'mm/dd/yyyy:hh24:SS') );
         l_qte_header_rec.quote_header_id := 24649;
         l_qte_header_rec.last_update_date := lc_last_update_date;
         l_control_rec.last_update_date := lc_last_update_date;
         l_qte_line_rec.quote_header_id := 24649;
         l_qte_line_rec.quote_line_id := 27712;
         l_qte_line_rec.attribute12 := 1000;
         ASO_QUOTE_PUB.Update_Quote_Line(
    P_Api_Version_Number => '1.0',
    P_Init_Msg_List =>     l_Init_Msg_List,
    P_Commit =>     l_Commit,
    P_Qte_Line_Rec =>     l_Qte_Line_Rec,
    P_Control_Rec =>     l_Control_Rec,     
    P_Qte_Line_Dtl_Tbl =>     l_Qte_Line_Dtl_Tbl,
    P_Line_Attribs_Ext_Tbl =>     l_Line_Attribs_Ext_Tbl,
    P_Payment_Tbl =>     l_Payment_Tbl,     
    P_Price_Adj_Tbl =>     l_Price_Adj_Tbl,     
    P_Price_Attributes_Tbl =>     l_Price_Attributes_Tbl,
    P_Price_Adj_Attr_Tbl =>     l_Price_Adj_Attr_Tbl,
    P_Shipment_Tbl =>     l_Shipment_Tbl,
    P_Tax_Detail_Tbl =>     l_Tax_Detail_Tbl,
    P_Freight_Charge_Tbl =>     l_Freight_Charge_Tbl,
    P_Update_Header_Flag =>     l_Update_Header_Flag,
    X_Qte_Line_Rec =>     X_Qte_Line_Rec,
    X_Qte_Line_Dtl_Tbl =>     X_Qte_Line_Dtl_Tbl,
    X_Line_Attribs_Ext_Tbl =>     X_Line_Attribs_Ext_Tbl,
    X_Payment_Tbl =>     X_Payment_Tbl,
    X_Price_Adj_Tbl =>     X_Price_Adj_Tbl,
    X_Price_Attributes_Tbl =>     X_Price_Attributes_Tbl,
    X_Price_Adj_Attr_Tbl =>     X_Price_Adj_Attr_Tbl,
    X_Shipment_Tbl =>     X_Shipment_Tbl,
    X_Tax_Detail_Tbl =>     X_Tax_Detail_Tbl,
    X_Freight_Charge_Tbl =>     X_Freight_Charge_Tbl,
    X_Return_Status =>     lX_Return_Status,
    X_Msg_Count =>     lX_Msg_Count,
    X_Msg_Data =>     lX_Msg_Data
    fnd_msg_pub.count_and_get( p_encoded => 'F'
    , p_count => lx_msg_count
    , p_data => lx_msg_data);
    dbms_output.put_line('no. of FND messages :'||lx_msg_count);
    for k in 1 .. lx_msg_count loop
    lx_msg_data := fnd_msg_pub.get(
    p_msg_index => k,
    p_encoded => 'F');
    dbms_output.put_line('Error msg: '||substr(lx_msg_data,1,240));
    end loop;
    dbms_output.put_line(lx_return_status);
    dbms_output.put_line(to_char(lx_msg_count));
    dbms_output.put_line(lx_msg_data);
    dbms_output.put_line('end');
    END;     
    COMMIT;
    Thanks
    Sunil Devulapally
    Edited by: user13150483 on 05-Jan-2012 10:59

  • Unit selling price is not updating

    Hi
    I am updating unit selling price of an item using API.
    code:
       v_line_tbl (1).request_date := SYSDATE;
       v_line_tbl (1).unit_selling_price := 299;
    in the above code request_date is updating to sysdate but selling price is not updating.
    how to do this?
    Thanks

    The CALCULATE_PRICE_FLAG is in the OE_ORDER_LINES_ALL table.  This setting could override determines pricing engine calls which could be overriding your update.
    Values -
    Calculate Price (Y)
    Partial Price (P)       
    Freeze Price (N)
    Thank you,
    Debbie

  • Unit Selling Price in OM

    Hi All,
    I am new in OM. i just want to know when my user enter and modified unit selling price the message shows no list of values contain no entries, please advice how can i add its list or how can i use range of list against list.
    Thanks

    Dear All,
    Please advice above issue
    thanks

  • Cannot manual adjustment unit selling price for Retrobill order

    Dears,
    I try formpersonalzation to set to update allowed and alterable,but still cannot update unit selling price?
    there is a message:
    Get_manual_adjustment#2 ORA-01403:no data found in Package oe_order_adj_pvt Procedure oe_line_adj.calulate_adjustments
    Edited by: user6911393 on 2011/5/18 下午 9:00
    Is there method can find the way to adjustment unit selling price manually fro Retrobill order?
    Thank you very much!

    Dears,
    I try formpersonalzation to set to update allowed and alterable,but still cannot update unit selling price?
    there is a message:
    Get_manual_adjustment#2 ORA-01403:no data found in Package oe_order_adj_pvt Procedure oe_line_adj.calulate_adjustments
    Edited by: user6911393 on 2011/5/18 下午 9:00
    Is there method can find the way to adjustment unit selling price manually fro Retrobill order?
    Thank you very much!

  • Sales Order - Unit Selling Price - Format Mask

    Hi,
    I want to change Format Mask of Unit Selling Price column on Sales Order Form. By using Forms Personalization it is not being done.
    Please guide me how could I change its format mask from 5 decimal places to 2 decimal places.
    Regards
    Waqas Hassan

    Hi Waqas,
    In the define Currency form in GL setup, change the existing currency code precision to 2.
    this should resolve your issue.
    Make sure you logout and login back to recheck the issue.
    General Ledger Super User-->Setup-->Currency-->Define.
    Thanks
    -Arif.

  • Unit Selling Price - Round Off

    Hi All,
    My requirement is to round off the unit selling price in Sales Order screen,
    for example
    Item AS16101 unit selling price is 12.99, while entering this item it should be 13, and saved to database as 13
    Item AS16103 unit selling price is 12.40, while entering this item it should be 12
    In WHEN VALIDATE RECORD, i used round function in form personlization, but in data base its saving the original value.
    Any help on this.
    Regards,
    Max

    In Personalization i have shown the value in messages, its showing correctly but when i enabled the custom events, after my message with value it showing PRE_QUERY trigger and saving the actual value.
    Regards,
    Max

  • Unit selling price and list price

    all

    >
    I am getting internal_function within explain plan filter section at step 17 ,18 and 22, i know it is an overhead but why it is happening how can i come to know please help
    >
    That is just how Oracle is processing your IN clause
    oha.org_id In
           ('122', '82', '222', '166', '142', '182', '162', '164', '203', '262')It caches' those hard-coded values in a hash table and uses an internal function to implement the 'IN' part of your query by using 'oha.orgid' as the search parameter to the hash table.
    Nothing to worry about from a performance issue unless maybe you had hundreds or thousands of hard-coded values for the IN clause. Even then a hash table is far quicker that accessing a real table.

  • Find out the Selling Price and Unit Price.

    Hi All,
    Am trying to get the Selling and Unit Price Before an Order Creation and Quote , from the API of " QP_PREQ_PUB.PRICE_REQUEST " ,. based on Item ID , Quantity and two Modifiesrs(Price List ID and Order Type ID).
    i can get Selling Price and Unit from Temp table " qp_preq_lines_tmp ". after execution of Above API .
    but I am getting Unit Price correctly and about Selling Price, its dispaly the Priec as same as Unit Price only .
    I Dont' know what step i missed .
    Have anyone developed similar API for getting the Selling Price and Unit Price for an Item ?.
    Any suggestions are appreciated.
    Regards,
    Shan

    Hi Shan,
    I saw your posting on Oracle forum that is why I am sending this email to you.
    I have been using QP_PREQ_PUB.PRICE_REQUEST to pass item to get item list price thru Oracle Price Engine. I get Item list price without any issues the only thing I am stuck is when that item has multiple modifiers then item price I get is without applying modifiers.
    My case: When Item KD653 3/3MAT has 'X' price list and price of that item is set to 600.00. I have a modifier defined and that includes/qualifies above item for 10% discount. So when I pass my pameters like inv_item_id, list_header_id etc I get 600.00 not 540.00. So I am passing two lines one for regular item list price (600.00) and second for modifier that I have created for this item.
    Result: I get 600.00 Item Price but I don't get modified (10%) price applied to unit price. Also it doesn't recognize my list_header_id that I am passing for my modifier.
    I may be missing something to trigger the modifier part. If you got case details then that will be great.
    Your help will be highly appreciated in this case.
    Regards,
    Prakash

  • Price Break through the Pricing Agreement API.

    Hi All,
    I need to put Range price break on the pricing agreement conversion. I am using the OE_Pricing_Cont_PUB.Process_Agreement API to accomplish this, but couldn't find where and What do I need to put to take care of the Price Breaks.
    All pointers are highly appreciated.
    Thanks,
    Rahul

    Hi David,
    Advanced Pricing comes with 6 x seeded pricing attributes for cross-order volume d-iscounts: Period 1/2/3 Item Qty and Period 1/2/3 Order Amount ... which relate to the tables I mentioned previously.
    Those Periods 1, 2 and 3 are based on the values in the 3 profile options I mentioned. So if you have a quarterly volume d-iscount structure you might use 30, 60, 90 as the values (i.e. not 30, 30, 30) which would bucket 1-30, 31-60 and 61-90 and ignore orders older than 90 days.
    The Cross Order Volume Load takes place only for booked sales orders containing items/customers which qualify for a modifier/price list using cross-order volume pricing attributes/qualifiers+. To that end, when you're testing this, remember to run QP: Maintains the denormalized data in QP Qualifiers after creating/assigning qualifiers and before running the Cross Order Volume Load.
    It is also important to note that the order amounts which are accumulated are gross only – i.e. they are based on the unit list price not the unit sell price post d-iscounts etc. Also, the cross-order amount does not include the current order being priced since the expected process is that the Cross Order Volume Load will be scheduled to run periodically, probably at the end of the business day. (You may feel that these two riders reduce the value of this functionality - they do for me!)
    Note that there is also a Cross Order Volume Report which will list the accumulated data from the Cross Order Volume Load for you.
    Hope that helps...
    Regards,
    Jon

  • Updating Price Breaks through API

    Hi,
    We have a requirement to update the existing price break information. We have found an API for inserting a new price break for a given price list. The API name is
    QP_PRICE_LIST_PUB.Process_Price_List.
    Can any one let us know is there a way to update existing pricebreak using a standard API and how.
    Thanks & Regards,
    Parvathi S

    Check the product related documents. They will have a mention of all the public APIs if they exist.
    --Shiv                                                                                                                                                                                                                           

  • Process_Order API is not working in OM - r12.1.3

    Hello,
    I am writing a process_order API to create sales orders in Oracle from  Blanket Sales Agreements.  But below mentioned API is neither throwing any errors nor it is importing. Not sure what am I missing.   Complete code is mentioned below.
    Hope to get lucky in getting advise from gurus on this forum.
    code
    /* Formatted on 8/15/2013 2:54:52 PM (QP5 v5.252.13127.32867) */
    CREATE OR REPLACE PACKAGE BODY XXCH_BSA_ORDER
    IS
       PROCEDURE BSA_PROCESS_ORDER (errbuf             OUT VARCHAR2,
                                    retcode            OUT VARCHAR2,
                                    p_blanket_number       NUMBER,
                                    p_blanket_line         NUMBER,
                                    p_select               VARCHAR2,
                                    p_order_type           NUMBER,
                                    p_copies               NUMBER)
       AS
          v_error   VARCHAR2 (2000);
       BEGIN
          INSERT INTO LOGFILE (STEPID, MODULE)
               VALUES (1, 'VERIZON');
          COMMIT;
          FOR i IN 1 .. p_copies
          LOOP
             INSERT INTO LOGFILE (STEPID, MODULE)
                  VALUES (2, 'VERIZON');
             BSA_API (p_blanket_number   => p_blanket_number,
                      p_blanket_line     => p_blanket_line,
                      p_select           => p_select,
                      p_order_type       => p_order_type);
          END LOOP;
       EXCEPTION
          WHEN OTHERS
          THEN
             v_error := SQLERRM;
             RAISE_APPLICATION_ERROR (-20001, v_error);
       END;
       PROCEDURE BSA_API (p_blanket_number    NUMBER,
                          p_blanket_line      NUMBER,
                          p_select            VARCHAR2,
                          p_order_type        NUMBER)
       AS
          l_header_rec                   oe_order_pub.header_rec_type;
          l_line_tbl                     oe_order_pub.line_tbl_type;
          l_action_request_tbl           oe_order_pub.request_tbl_type;
          l_header_adj_tbl               oe_order_pub.header_adj_tbl_type;
          l_line_adj_tbl                 oe_order_pub.line_adj_tbl_type;
          l_header_scr_tbl               oe_order_pub.header_scredit_tbl_type;
          l_line_scredit_tbl             oe_order_pub.line_scredit_tbl_type;
          l_request_rec                  oe_order_pub.request_rec_type;
          l_return_status                VARCHAR2 (3000);
          l_msg_count                    NUMBER;
          l_msg_data                     VARCHAR2 (3000);
          p_api_version_number           NUMBER := 1.0;
          p_init_msg_list                VARCHAR2 (1000) := fnd_api.g_true;
          p_return_values                VARCHAR2 (1000) := fnd_api.g_true;
          p_action_commit                VARCHAR2 (1000) := fnd_api.g_true;
          x_return_status                VARCHAR2 (10);
          x_msg_count                    NUMBER;
          x_msg_data                     VARCHAR2 (3000);
          p_header_rec                   oe_order_pub.header_rec_type
                                            := oe_order_pub.g_miss_header_rec;
          p_old_header_rec               oe_order_pub.header_rec_type
                                            := oe_order_pub.g_miss_header_rec;
          p_header_val_rec               oe_order_pub.header_val_rec_type
                                            := oe_order_pub.g_miss_header_val_rec;
          p_old_header_val_rec           oe_order_pub.header_val_rec_type
                                            := oe_order_pub.g_miss_header_val_rec;
          p_header_adj_tbl               oe_order_pub.header_adj_tbl_type
                                            := oe_order_pub.g_miss_header_adj_tbl;
          p_old_header_adj_tbl           oe_order_pub.header_adj_tbl_type
                                            := oe_order_pub.g_miss_header_adj_tbl;
          p_header_adj_val_tbl           oe_order_pub.header_adj_val_tbl_type
                                            := oe_order_pub.g_miss_header_adj_val_tbl;
          p_old_header_adj_val_tbl       oe_order_pub.header_adj_val_tbl_type
                                            := oe_order_pub.g_miss_header_adj_val_tbl;
          p_header_price_att_tbl         oe_order_pub.header_price_att_tbl_type
             := oe_order_pub.g_miss_header_price_att_tbl;
          p_old_header_price_att_tbl     oe_order_pub.header_price_att_tbl_type
             := oe_order_pub.g_miss_header_price_att_tbl;
          p_header_adj_att_tbl           oe_order_pub.header_adj_att_tbl_type
             := oe_order_pub.g_miss_header_adj_att_tbl;
          p_old_header_adj_att_tbl       oe_order_pub.header_adj_att_tbl_type
             := oe_order_pub.g_miss_header_adj_att_tbl;
          p_header_adj_assoc_tbl         oe_order_pub.header_adj_assoc_tbl_type
             := oe_order_pub.g_miss_header_adj_assoc_tbl;
          p_old_header_adj_assoc_tbl     oe_order_pub.header_adj_assoc_tbl_type
             := oe_order_pub.g_miss_header_adj_assoc_tbl;
          p_header_scredit_tbl           oe_order_pub.header_scredit_tbl_type
             := oe_order_pub.g_miss_header_scredit_tbl;
          p_old_header_scredit_tbl       oe_order_pub.header_scredit_tbl_type
             := oe_order_pub.g_miss_header_scredit_tbl;
          p_header_scredit_val_tbl       oe_order_pub.header_scredit_val_tbl_type
             := oe_order_pub.g_miss_header_scredit_val_tbl;
          p_old_header_scredit_val_tbl   oe_order_pub.header_scredit_val_tbl_type
             := oe_order_pub.g_miss_header_scredit_val_tbl;
          p_line_tbl                     oe_order_pub.line_tbl_type
                                            := oe_order_pub.g_miss_line_tbl;
          p_old_line_tbl                 oe_order_pub.line_tbl_type
                                            := oe_order_pub.g_miss_line_tbl;
          p_line_val_tbl                 oe_order_pub.line_val_tbl_type
                                            := oe_order_pub.g_miss_line_val_tbl;
          p_old_line_val_tbl             oe_order_pub.line_val_tbl_type
                                            := oe_order_pub.g_miss_line_val_tbl;
          p_line_adj_tbl                 oe_order_pub.line_adj_tbl_type
                                            := oe_order_pub.g_miss_line_adj_tbl;
          p_old_line_adj_tbl             oe_order_pub.line_adj_tbl_type
                                            := oe_order_pub.g_miss_line_adj_tbl;
          p_line_adj_val_tbl             oe_order_pub.line_adj_val_tbl_type
             := oe_order_pub.g_miss_line_adj_val_tbl;
          p_old_line_adj_val_tbl         oe_order_pub.line_adj_val_tbl_type
             := oe_order_pub.g_miss_line_adj_val_tbl;
          p_line_price_att_tbl           oe_order_pub.line_price_att_tbl_type
             := oe_order_pub.g_miss_line_price_att_tbl;
          p_old_line_price_att_tbl       oe_order_pub.line_price_att_tbl_type
             := oe_order_pub.g_miss_line_price_att_tbl;
          p_line_adj_att_tbl             oe_order_pub.line_adj_att_tbl_type
             := oe_order_pub.g_miss_line_adj_att_tbl;
          p_old_line_adj_att_tbl         oe_order_pub.line_adj_att_tbl_type
             := oe_order_pub.g_miss_line_adj_att_tbl;
          p_line_adj_assoc_tbl           oe_order_pub.line_adj_assoc_tbl_type
             := oe_order_pub.g_miss_line_adj_assoc_tbl;
          p_old_line_adj_assoc_tbl       oe_order_pub.line_adj_assoc_tbl_type
             := oe_order_pub.g_miss_line_adj_assoc_tbl;
          p_line_scredit_tbl             oe_order_pub.line_scredit_tbl_type
             := oe_order_pub.g_miss_line_scredit_tbl;
          p_old_line_scredit_tbl         oe_order_pub.line_scredit_tbl_type
             := oe_order_pub.g_miss_line_scredit_tbl;
          p_line_scredit_val_tbl         oe_order_pub.line_scredit_val_tbl_type
             := oe_order_pub.g_miss_line_scredit_val_tbl;
          p_old_line_scredit_val_tbl     oe_order_pub.line_scredit_val_tbl_type
             := oe_order_pub.g_miss_line_scredit_val_tbl;
          p_lot_serial_tbl               oe_order_pub.lot_serial_tbl_type
                                            := oe_order_pub.g_miss_lot_serial_tbl;
          p_old_lot_serial_tbl           oe_order_pub.lot_serial_tbl_type
                                            := oe_order_pub.g_miss_lot_serial_tbl;
          p_lot_serial_val_tbl           oe_order_pub.lot_serial_val_tbl_type
             := oe_order_pub.g_miss_lot_serial_val_tbl;
          p_old_lot_serial_val_tbl       oe_order_pub.lot_serial_val_tbl_type
             := oe_order_pub.g_miss_lot_serial_val_tbl;
          p_action_request_tbl           oe_order_pub.request_tbl_type
                                            := oe_order_pub.g_miss_request_tbl;
          x_header_val_rec               oe_order_pub.header_val_rec_type;
          x_header_adj_tbl               oe_order_pub.header_adj_tbl_type;
          x_header_adj_val_tbl           oe_order_pub.header_adj_val_tbl_type;
          x_header_price_att_tbl         oe_order_pub.header_price_att_tbl_type;
          x_header_adj_att_tbl           oe_order_pub.header_adj_att_tbl_type;
          x_header_adj_assoc_tbl         oe_order_pub.header_adj_assoc_tbl_type;
          x_header_scredit_tbl           oe_order_pub.header_scredit_tbl_type;
          x_header_scredit_val_tbl       oe_order_pub.header_scredit_val_tbl_type;
          x_line_val_tbl                 oe_order_pub.line_val_tbl_type;
          x_line_adj_tbl                 oe_order_pub.line_adj_tbl_type;
          x_line_adj_val_tbl             oe_order_pub.line_adj_val_tbl_type;
          x_line_price_att_tbl           oe_order_pub.line_price_att_tbl_type;
          x_line_adj_att_tbl             oe_order_pub.line_adj_att_tbl_type;
          x_line_adj_assoc_tbl           oe_order_pub.line_adj_assoc_tbl_type;
          x_line_scredit_tbl             oe_order_pub.line_scredit_tbl_type;
          x_line_scredit_val_tbl         oe_order_pub.line_scredit_val_tbl_type;
          x_lot_serial_tbl               oe_order_pub.lot_serial_tbl_type;
          x_lot_serial_val_tbl           oe_order_pub.lot_serial_val_tbl_type;
          x_action_request_tbl           oe_order_pub.request_tbl_type;
          x_debug_file                   VARCHAR2 (100);
          l_line_tbl_index               NUMBER;
          l_msg_index_out                NUMBER;
          l_user_id                      fnd_user.user_id%TYPE;
          l_appl_id                      fnd_application.application_id%TYPE;
          l_resp_id                      fnd_responsibility.responsibility_id%TYPE;
          l_org_id                       hr_operating_units.organization_id%TYPE;
          l_sold_to_org_id               hz_cust_accounts.cust_account_id%TYPE;
          l_ship_to_org_id               hz_cust_site_uses_all.site_use_id%TYPE;
          l_cust_acct_site_id            hz_cust_acct_sites_all.cust_acct_site_id%TYPE;
          l_party_id                     hz_parties.party_id%TYPE;
          l_price_list_id                qp_list_headers_b.list_header_id%TYPE;
          l_primary_salesrep_id          ra_salesreps.salesrep_id%TYPE;
          l_order_type_id                oe_transaction_types_all.transaction_type_id%TYPE;
          l_order_line_type_id           oe_transaction_types_all.transaction_type_id%TYPE;
          l_order_category_code          oe_transaction_types_all.order_category_code%TYPE;
          l_inventory_item_id            mtl_system_items_b.inventory_item_id%TYPE;
          l_currency_code                qp_list_headers.currency_code%TYPE;
          l_party_site_id                hz_party_sites.party_site_id%TYPE;
          xbreak                         VARCHAR2 (33);
          errorx                         VARCHAR2 (3000);
          k                              INTEGER := 0;
          CURSOR BlanketHeader
          IS
             SELECT *
               FROM oe_blanket_headers_all
              WHERE header_id = p_blanket_number;
          CURSOR BlanketLines (
             v_agreement_id    NUMBER)
          IS
             SELECT *
               FROM oe_blanket_lines_all
              WHERE     header_id = v_agreement_id
                    AND line_number = NVL (p_blanket_line, line_number);
       BEGIN
          -- Create Header
          xbreak := '100';
          fnd_global.apps_initialize (12647, 51839, 660);
          --       pass in user_id, responsibility_id, and application_id
          oe_msg_pub.initialize;
          oe_debug_pub.initialize;
          l_org_id := fnd_profile.VALUE ('ORG_ID');
          xbreak := '101';
          fnd_file.Put_line (
             fnd_file.LOG,
             '*********************************************** BOOK ORDER **************************');
          fnd_file.put_line (fnd_file.LOG,
                             'Begining of the procedure Book Order');
          --    Initialize header record
          xbreak := '102';
          FOR i IN BlanketHeader
          LOOP
          insert into logfile(stepid,module) values (23,'BPO:'||to_char(i.header_id));
           l_header_rec := oe_order_pub.g_miss_header_rec;
             xbreak := '103';
             l_header_rec.cust_po_number := i.cust_po_number;
             l_header_rec.ordered_date := SYSDATE;
             l_header_rec.salesrep_id := i.salesrep_id;
             l_header_rec.order_type_id := p_order_type;
             l_header_rec.operation := oe_globals.g_opr_create; --Specifies that Order is getting created
             --xbreak := '104';
             l_header_rec.order_category_code := 'ORDER';
             --         l_num_tbl_index := 1;
             l_header_rec.booked_flag := 'Y';
             xbreak := '105';
             l_header_rec.sold_to_org_id := i.sold_to_org_id;
             l_header_rec.invoice_to_org_id := i.invoice_to_org_id;
             l_header_rec.ship_to_org_id := i.ship_to_org_id;
             l_header_rec.price_list_id := i.price_list_id;
             --Create Line record
             FOR j IN BlanketLines(i.header_id)
             LOOP
                l_line_tbl_index := 1;
                -- FIRST LINE RECORD
                -- Initialize record to missing
                l_line_tbl (l_line_tbl_index) := oe_order_pub.g_miss_line_rec;
                -- Line attributes
                l_line_tbl (l_line_tbl_index).inventory_item_id :=
                   j.inventory_item_id;
                l_line_tbl (l_line_tbl_index).ordered_quantity := 1;
                -- Set to 'N' when you need to pass unit_selling_price
                l_line_tbl (l_line_tbl_index).calculate_price_flag := 'N';
                l_line_tbl (l_line_tbl_index).unit_selling_price := NULL;
                l_line_tbl (l_line_tbl_index).ship_from_org_id := j.org_id;
                l_line_tbl (l_line_tbl_index).operation := oe_globals.g_opr_create;
             END LOOP;
    x_debug_file := oe_debug_pub.set_debug_mode ('FILE');
    oe_debug_pub.setdebuglevel (5);
             oe_order_pub.process_order (
                p_org_id  => l_org_id,
                p_operating_unit => l_org_id,
                p_api_version_number       => 1.0,
                p_init_msg_list            => fnd_api.g_true,
                p_return_values            => fnd_api.g_true,
                p_action_commit            => fnd_api.g_true,
                x_return_status            => l_return_status,
                x_msg_count                => l_msg_count,
                x_msg_data                 => l_msg_data,
                p_header_rec               => l_header_rec,
                p_line_tbl                 => l_line_tbl,
                p_action_request_tbl       => l_action_request_tbl -- OUT PARAMETERS
                x_header_rec               => l_header_rec,
                x_header_val_rec           => x_header_val_rec,
                x_header_adj_tbl           => x_header_adj_tbl,
                x_header_adj_val_tbl       => x_header_adj_val_tbl,
                x_header_price_att_tbl     => x_header_price_att_tbl,
                x_header_adj_att_tbl       => x_header_adj_att_tbl,
                x_header_adj_assoc_tbl     => x_header_adj_assoc_tbl,
                x_header_scredit_tbl       => x_header_scredit_tbl,
                x_header_scredit_val_tbl   => x_header_scredit_val_tbl,
                x_line_tbl                 => l_line_tbl,
                x_line_val_tbl             => x_line_val_tbl,
                x_line_adj_tbl             => x_line_adj_tbl,
                x_line_adj_val_tbl         => x_line_adj_val_tbl,
                x_line_price_att_tbl       => x_line_price_att_tbl,
                x_line_adj_att_tbl         => x_line_adj_att_tbl,
                x_line_adj_assoc_tbl       => x_line_adj_assoc_tbl,
                x_line_scredit_tbl         => x_line_scredit_tbl,
                x_line_scredit_val_tbl     => x_line_scredit_val_tbl,
                x_lot_serial_tbl           => x_lot_serial_tbl,
                x_lot_serial_val_tbl       => x_lot_serial_val_tbl,
                x_action_request_tbl       => l_action_request_tbl);
             COMMIT;
             INSERT INTO LOGFILE (STEPID, MODULE)
                     VALUES (
                               22,
                                  TO_CHAR (l_header_rec.header_id)
                               || '-'
                               || l_msg_data);
             COMMIT;
             xbreak := '106';
          END LOOP;
          FOR i IN 1 .. l_msg_count
          LOOP
             k := k + 1;
             xbreak := '108';
             Oe_Msg_Pub.get (p_msg_index       => k,
                             p_encoded         => Fnd_Api.G_FALSE,
                             p_data            => l_msg_data,
                             p_msg_index_out   => l_msg_index_out);
                               INSERT INTO LOGFILE (STEPID, MODULE)
                     VALUES (
                               24,l_msg_data);
          END LOOP;
          /* Check if the process order goes through then it prints the success message, otherwise it prints failed message.*/
          IF l_return_status = FND_API.G_RET_STS_SUCCESS
          THEN
             xbreak := '109';
             fnd_file.put_line (
                fnd_file.LOG,
                   'Return from the API:-'
                || 'return status'
                || l_return_status
                || '-'
                || l_header_rec.header_id);
          ELSE
             xbreak := '110';
             fnd_file.put_line (
                fnd_file.LOG,
                   'Return from the API'
                || 'return status'
                || l_return_status
                || '-'
                || TO_CHAR (l_header_rec.header_id));
          END IF;
       EXCEPTION
          WHEN OTHERS
          THEN
             errorx := xbreak || '-' || SQLERRM;
             raise_application_error (-20002, errorx);
       END;
    END;
    Thanks
    Darsh

    Hussein,
    As always - Thank you.   I have passed the above issue but now in the same API, it is not importing lines.  I need to enter multiple lines for a given sales order through this API. As per the note from you on this thread, I am now maintaining separate set of input and output variables.
    When I searched metalink and google, there are countless examples of process_order APIs  giving example of importing one sales order line along with header at the time of creation.  Then, they ask to add subsequent lines through an UPDATE operations for existing order that was just created. Thus, forcing me to write process_order api call two times.
    Can't I just create a loop and add multiple lines right at the time of order creation? Please see the revised code as shown below.  This code is not working - it throws "no data found" for a weird reason.  I know for a fact that data is fetched properly by blanketLines cursor.
    /* Formatted on 8/16/2013 4:23:09 PM (QP5 v5.252.13127.32867) */
    CREATE OR REPLACE PACKAGE BODY XXCH_BSA_ORDER
    IS
       PROCEDURE BSA_PROCESS_ORDER (errbuf             OUT VARCHAR2,
                                    retcode            OUT VARCHAR2,
                                    p_blanket_number       NUMBER,
                                    p_select               VARCHAR2,
                                    p_blanket_line         NUMBER,
                                    p_order_type           NUMBER,
                                    p_copies               NUMBER)
       AS
          v_error          VARCHAR2 (2000);
          o_order_number   NUMBER;
       BEGIN
          INSERT INTO LOGFILE (STEPID, MODULE)
               VALUES (1, 'VERIZON');
          COMMIT;
          FOR i IN 1 .. p_copies
          LOOP
             INSERT INTO LOGFILE (STEPID, MODULE)
                  VALUES (2, 'VERIZON');
             BSA_API (p_blanket_number   => p_blanket_number,
                      p_blanket_line     => p_blanket_line,
                      p_select           => p_select,
                      p_order_type       => p_order_type,
                      p_order_number     => o_order_number);
             fnd_file.put_line (fnd_file.OUTPUT,
                                'Order Number Created:-' || o_order_number);
          END LOOP;
       EXCEPTION
          WHEN OTHERS
          THEN
             v_error := SQLERRM;
             RAISE_APPLICATION_ERROR (-20001, v_error);
       END;
       PROCEDURE BSA_API (p_blanket_number       NUMBER,
                          p_blanket_line         NUMBER,
                          p_select               VARCHAR2,
                          p_order_type           NUMBER,
                          p_order_number     OUT NUMBER)
       AS
          l_header_rec                   oe_order_pub.header_rec_type;
          l_header_rec_out               oe_order_pub.header_rec_type;
          l_line_tbl                     oe_order_pub.line_tbl_type;
          l_line_tbl_out                 oe_order_pub.line_tbl_type;
          l_action_request_tbl           oe_order_pub.request_tbl_type;
          l_header_adj_tbl               oe_order_pub.header_adj_tbl_type;
          l_line_adj_tbl                 oe_order_pub.line_adj_tbl_type;
          l_header_scr_tbl               oe_order_pub.header_scredit_tbl_type;
          l_line_scredit_tbl             oe_order_pub.line_scredit_tbl_type;
          l_request_rec                  oe_order_pub.request_rec_type;
          l_return_status                VARCHAR2 (3000);
          l_msg_count                    NUMBER;
          l_msg_data                     VARCHAR2 (3000);
          p_api_version_number           NUMBER := 1.0;
          p_init_msg_list                VARCHAR2 (1000) := fnd_api.g_true;
          p_return_values                VARCHAR2 (1000) := fnd_api.g_true;
          p_action_commit                VARCHAR2 (1000) := fnd_api.g_true;
          x_return_status                VARCHAR2 (10);
          x_msg_count                    NUMBER;
          x_msg_data                     VARCHAR2 (3000);
          p_header_rec                   oe_order_pub.header_rec_type
                                            := oe_order_pub.g_miss_header_rec;
          p_old_header_rec               oe_order_pub.header_rec_type
                                            := oe_order_pub.g_miss_header_rec;
          p_header_val_rec               oe_order_pub.header_val_rec_type
                                            := oe_order_pub.g_miss_header_val_rec;
          p_old_header_val_rec           oe_order_pub.header_val_rec_type
                                            := oe_order_pub.g_miss_header_val_rec;
          p_header_adj_tbl               oe_order_pub.header_adj_tbl_type
                                            := oe_order_pub.g_miss_header_adj_tbl;
          p_old_header_adj_tbl           oe_order_pub.header_adj_tbl_type
                                            := oe_order_pub.g_miss_header_adj_tbl;
          p_header_adj_val_tbl           oe_order_pub.header_adj_val_tbl_type
                                            := oe_order_pub.g_miss_header_adj_val_tbl;
          p_old_header_adj_val_tbl       oe_order_pub.header_adj_val_tbl_type
                                            := oe_order_pub.g_miss_header_adj_val_tbl;
          p_header_price_att_tbl         oe_order_pub.header_price_att_tbl_type
             := oe_order_pub.g_miss_header_price_att_tbl;
          p_old_header_price_att_tbl     oe_order_pub.header_price_att_tbl_type
             := oe_order_pub.g_miss_header_price_att_tbl;
          p_header_adj_att_tbl           oe_order_pub.header_adj_att_tbl_type
             := oe_order_pub.g_miss_header_adj_att_tbl;
          p_old_header_adj_att_tbl       oe_order_pub.header_adj_att_tbl_type
             := oe_order_pub.g_miss_header_adj_att_tbl;
          p_header_adj_assoc_tbl         oe_order_pub.header_adj_assoc_tbl_type
             := oe_order_pub.g_miss_header_adj_assoc_tbl;
          p_old_header_adj_assoc_tbl     oe_order_pub.header_adj_assoc_tbl_type
             := oe_order_pub.g_miss_header_adj_assoc_tbl;
          p_header_scredit_tbl           oe_order_pub.header_scredit_tbl_type
             := oe_order_pub.g_miss_header_scredit_tbl;
          p_old_header_scredit_tbl       oe_order_pub.header_scredit_tbl_type
             := oe_order_pub.g_miss_header_scredit_tbl;
          p_header_scredit_val_tbl       oe_order_pub.header_scredit_val_tbl_type
             := oe_order_pub.g_miss_header_scredit_val_tbl;
          p_old_header_scredit_val_tbl   oe_order_pub.header_scredit_val_tbl_type
             := oe_order_pub.g_miss_header_scredit_val_tbl;
          p_line_tbl                     oe_order_pub.line_tbl_type
                                            := oe_order_pub.g_miss_line_tbl;
          p_old_line_tbl                 oe_order_pub.line_tbl_type
                                            := oe_order_pub.g_miss_line_tbl;
          p_line_val_tbl                 oe_order_pub.line_val_tbl_type
                                            := oe_order_pub.g_miss_line_val_tbl;
          p_old_line_val_tbl             oe_order_pub.line_val_tbl_type
                                            := oe_order_pub.g_miss_line_val_tbl;
          p_line_adj_tbl                 oe_order_pub.line_adj_tbl_type
                                            := oe_order_pub.g_miss_line_adj_tbl;
          p_old_line_adj_tbl             oe_order_pub.line_adj_tbl_type
                                            := oe_order_pub.g_miss_line_adj_tbl;
          p_line_adj_val_tbl             oe_order_pub.line_adj_val_tbl_type
             := oe_order_pub.g_miss_line_adj_val_tbl;
          p_old_line_adj_val_tbl         oe_order_pub.line_adj_val_tbl_type
             := oe_order_pub.g_miss_line_adj_val_tbl;
          p_line_price_att_tbl           oe_order_pub.line_price_att_tbl_type
             := oe_order_pub.g_miss_line_price_att_tbl;
          p_old_line_price_att_tbl       oe_order_pub.line_price_att_tbl_type
             := oe_order_pub.g_miss_line_price_att_tbl;
          p_line_adj_att_tbl             oe_order_pub.line_adj_att_tbl_type
             := oe_order_pub.g_miss_line_adj_att_tbl;
          p_old_line_adj_att_tbl         oe_order_pub.line_adj_att_tbl_type
             := oe_order_pub.g_miss_line_adj_att_tbl;
          p_line_adj_assoc_tbl           oe_order_pub.line_adj_assoc_tbl_type
             := oe_order_pub.g_miss_line_adj_assoc_tbl;
          p_old_line_adj_assoc_tbl       oe_order_pub.line_adj_assoc_tbl_type
             := oe_order_pub.g_miss_line_adj_assoc_tbl;
          p_line_scredit_tbl             oe_order_pub.line_scredit_tbl_type
             := oe_order_pub.g_miss_line_scredit_tbl;
          p_old_line_scredit_tbl         oe_order_pub.line_scredit_tbl_type
             := oe_order_pub.g_miss_line_scredit_tbl;
          p_line_scredit_val_tbl         oe_order_pub.line_scredit_val_tbl_type
             := oe_order_pub.g_miss_line_scredit_val_tbl;
          p_old_line_scredit_val_tbl     oe_order_pub.line_scredit_val_tbl_type
             := oe_order_pub.g_miss_line_scredit_val_tbl;
          p_lot_serial_tbl               oe_order_pub.lot_serial_tbl_type
                                            := oe_order_pub.g_miss_lot_serial_tbl;
          p_old_lot_serial_tbl           oe_order_pub.lot_serial_tbl_type
                                            := oe_order_pub.g_miss_lot_serial_tbl;
          p_lot_serial_val_tbl           oe_order_pub.lot_serial_val_tbl_type
             := oe_order_pub.g_miss_lot_serial_val_tbl;
          p_old_lot_serial_val_tbl       oe_order_pub.lot_serial_val_tbl_type
             := oe_order_pub.g_miss_lot_serial_val_tbl;
          p_action_request_tbl           oe_order_pub.request_tbl_type
                                            := oe_order_pub.g_miss_request_tbl;
          l_header_val_rec_out           oe_order_pub.header_val_rec_type;
          l_header_adj_tbl_out           oe_order_pub.header_adj_tbl_type;
          l_header_adj_val_tbl_out       oe_order_pub.header_adj_val_tbl_type;
          l_header_price_att_tbl_out     oe_order_pub.header_price_att_tbl_type;
          l_header_adj_att_tbl_out       oe_order_pub.header_adj_att_tbl_type;
          l_header_adj_assoc_tbl_out     oe_order_pub.header_adj_assoc_tbl_type;
          l_header_scredit_tbl_out       oe_order_pub.header_scredit_tbl_type;
          l_header_scredit_val_tbl_out   oe_order_pub.header_scredit_val_tbl_type;
          l_line_val_tbl_out             oe_order_pub.line_val_tbl_type;
          l_line_adj_tbl_out             oe_order_pub.line_adj_tbl_type;
          l_line_adj_val_tbl_out         oe_order_pub.line_adj_val_tbl_type;
          l_line_price_att_tbl_out       oe_order_pub.line_price_att_tbl_type;
          l_line_adj_att_tbl_out         oe_order_pub.line_adj_att_tbl_type;
          l_line_adj_assoc_tbl_out       oe_order_pub.line_adj_assoc_tbl_type;
          l_line_scredit_tbl_out         oe_order_pub.line_scredit_tbl_type;
          l_line_scredit_val_tbl_out     oe_order_pub.line_scredit_val_tbl_type;
          l_lot_serial_tbl_out           oe_order_pub.lot_serial_tbl_type;
          l_lot_serial_val_tbl_out       oe_order_pub.lot_serial_val_tbl_type;
          l_action_request_tbl_out       oe_order_pub.request_tbl_type;
          x_debug_file                   VARCHAR2 (100);
          l_line_tbl_index               INTEGER := 0;
          l_msg_index_out                NUMBER;
          l_user_id                      fnd_user.user_id%TYPE;
          l_appl_id                      fnd_application.application_id%TYPE;
          l_resp_id                      fnd_responsibility.responsibility_id%TYPE;
          l_org_id                       hr_operating_units.organization_id%TYPE;
          l_sold_to_org_id               hz_cust_accounts.cust_account_id%TYPE;
          l_ship_to_org_id               hz_cust_site_uses_all.site_use_id%TYPE;
          l_cust_acct_site_id            hz_cust_acct_sites_all.cust_acct_site_id%TYPE;
          l_party_id                     hz_parties.party_id%TYPE;
          l_price_list_id                qp_list_headers_b.list_header_id%TYPE;
          l_primary_salesrep_id          ra_salesreps.salesrep_id%TYPE;
          l_order_type_id                oe_transaction_types_all.transaction_type_id%TYPE;
          l_order_line_type_id           oe_transaction_types_all.transaction_type_id%TYPE;
          l_order_category_code          oe_transaction_types_all.order_category_code%TYPE;
          l_inventory_item_id            mtl_system_items_b.inventory_item_id%TYPE;
          l_currency_code                qp_list_headers.currency_code%TYPE;
          l_party_site_id                hz_party_sites.party_site_id%TYPE;
          xbreak                         VARCHAR2 (33);
          errorx                         VARCHAR2 (3000);
          k                              INTEGER := 0;
          ln_kount                       INTEGER := 0;
          v_order                        NUMBER;
          CURSOR BlanketHeader
          IS
             SELECT *
               FROM oe_blanket_headers_all
              WHERE header_id = p_blanket_number;
          CURSOR BlanketLines (
             v_agreement_id    NUMBER)
          IS
             SELECT *
               FROM oe_blanket_lines_all
              WHERE     header_id = v_agreement_id
                    AND line_number = NVL (p_blanket_line, line_number);
       BEGIN
          -- Create Header
          xbreak := '100';
          l_org_id := fnd_profile.VALUE ('ORG_ID');
          INSERT INTO logfile (stepid, module)
               VALUES (1, 'orgid:' || TO_CHAR (l_org_id));
          oe_msg_pub.initialize;
          oe_debug_pub.initialize;
          mo_global.set_policy_context ('S', l_org_ID);
          mo_global.init ('ONT');
          fnd_global.apps_initialize (12647, 51839, 660);
          --       pass in user_id, responsibility_id, and application_id
          oe_debug_pub.setdebuglevel (5);
          x_debug_file := oe_debug_pub.set_debug_mode ('FILE');
          INSERT INTO logfile (stepid, module)
               VALUES (25, 'debug:' || x_debug_File);
          COMMIT;
          l_org_id := fnd_profile.VALUE ('ORG_ID');
          xbreak := '101';
          fnd_file.Put_line (
             fnd_file.LOG,
             '*********************************************** BOOK ORDER **************************');
          fnd_file.put_line (fnd_file.LOG,
                             'Begining of the procedure Book Order');
          --    Initialize header record
          xbreak := '102';
          FOR i IN BlanketHeader
          LOOP
             INSERT INTO logfile (stepid, module)
                  VALUES (23, 'BPO:' || TO_CHAR (i.header_id));
             l_header_rec := oe_order_pub.g_miss_header_rec;
             xbreak := '103';
             l_header_rec.cust_po_number := i.cust_po_number;
             l_header_rec.ordered_date := SYSDATE;
             l_header_rec.salesrep_id := i.salesrep_id;
             l_header_rec.order_type_id := p_order_type;
             l_header_rec.operation := oe_globals.g_opr_create; --Specifies that Order is getting created
             --xbreak := '104';
             l_header_rec.order_category_code := 'ORDER';
             --         l_num_tbl_index := 1;
             l_header_rec.booked_flag := 'N';
             l_header_rec.flow_status_code := 'ENTERED';
             xbreak := '105';
             l_header_rec.sold_to_org_id := i.sold_to_org_id;
             l_header_rec.invoice_to_org_id := i.invoice_to_org_id;
             l_header_rec.ship_to_org_id := i.ship_to_org_id;
             l_header_rec.price_list_id := i.price_list_id;
             l_header_rec.shipping_instructions := i.shipping_instructions;
             l_header_rec.freight_terms_code := i.freight_terms_code;
             l_header_rec.attribute10 := i.attribute1;
             l_header_rec.salesrep_id := i.salesrep_id;
             l_action_request_tbl (1) := OE_ORDER_PUB.G_MISS_REQUEST_REC;
             INSERT INTO logfile (stepid, module)
                  VALUES (53, 'BPO:' || TO_CHAR (i.header_id));  -- Create Lines .
             xbreak := '206';
             FOR j IN BlanketLines (i.header_id)
             LOOP
                xbreak := '205';
                ln_kount := ln_kount + 1;
                l_line_tbl_index := 1;
                l_line_tbl (l_line_tbl_index) := oe_order_pub.g_miss_line_rec;
                l_line_tbl (l_line_tbl_index).operation := oe_globals.g_opr_create;
                l_line_tbl (l_line_tbl_index).inventory_item_id :=
                   j.inventory_item_id;
                INSERT INTO logfile (stepid, module)
                     VALUES (57, 'BPO:' || TO_CHAR (j.inventory_item_id));
                l_line_tbl (l_line_tbl_index).order_quantity_uom := 'EA';
                l_line_tbl (l_line_tbl_index).payment_term_id := 1000;
                l_line_tbl (l_line_tbl_index).schedule_arrival_date := SYSDATE + 1;
                l_line_tbl (l_line_tbl_index).schedule_ship_date := SYSDATE + 1;
                l_line_tbl (l_line_tbl_index).request_date := SYSDATE;
                l_line_tbl (l_line_tbl_index).promise_date := SYSDATE;
                l_line_tbl (l_line_tbl_index).shipping_method_code := NULL;
                l_line_tbl (l_line_tbl_index).freight_terms_code := NULL;
                l_line_tbl (l_line_tbl_index).line_number := 1;
                l_line_tbl (l_line_tbl_index).ordered_quantity := 1;
                l_line_tbl (l_line_tbl_index).calculate_price_flag := 'N';
                l_line_tbl (l_line_tbl_index).unit_selling_price := NULL;
                l_line_tbl (l_line_tbl_index).ship_from_org_id := j.org_id;
                l_line_tbl (l_line_tbl_index).ship_to_org_id := j.ship_to_org_id;
             END LOOP;
             oe_order_pub.process_order (
                p_org_id                   => l_org_id,
                p_operating_unit           => NULL,
                p_api_version_number       => 1.0,
                --            p_init_msg_list => fnd_api.g_true,
                --                                p_return_values => fnd_api.g_true,
                --                                p_action_commit => fnd_api.g_true,
                p_header_rec               => l_header_rec,
                p_line_tbl                 => l_line_tbl,
                p_action_request_tbl       => l_action_request_tbl -- OUT PARAMETERS
                x_header_rec               => l_header_rec_out,
                x_header_val_rec           => l_header_val_rec_out,
                x_header_adj_tbl           => l_header_adj_tbl_out,
                x_header_adj_val_tbl       => l_header_adj_val_tbl_out,
                x_header_price_att_tbl     => l_header_price_att_tbl_out,
                x_header_adj_att_tbl       => l_header_adj_att_tbl_out,
                x_header_adj_assoc_tbl     => l_header_adj_assoc_tbl_out,
                x_header_scredit_tbl       => l_header_scredit_tbl_out,
                x_header_scredit_val_tbl   => l_header_scredit_val_tbl_out,
                x_line_tbl                 => l_line_tbl_out,
                x_line_val_tbl             => l_line_val_tbl_out,
                x_line_adj_tbl             => l_line_adj_tbl_out,
                x_line_adj_val_tbl         => l_line_adj_val_tbl_out,
                x_line_price_att_tbl       => l_line_price_att_tbl_out,
                x_line_adj_att_tbl         => l_line_adj_att_tbl_out,
                x_line_adj_assoc_tbl       => l_line_adj_assoc_tbl_out,
                x_line_scredit_tbl         => l_line_scredit_tbl_out,
                x_line_scredit_val_tbl     => l_line_scredit_val_tbl_out,
                x_lot_serial_tbl           => l_lot_serial_tbl_out,
                x_lot_serial_val_tbl       => l_lot_serial_val_tbl_out,
                x_action_request_tbl       => l_action_request_tbl_out,
                x_return_status            => l_return_status,
                x_msg_count                => l_msg_count,
                x_msg_data                 => l_msg_data);
             COMMIT;
             FND_FILE.PUT_LINE (
                FND_FILE.LOG,
                   'OM Debug file: '
                || oe_debug_pub.g_dir
                || '/'
                || oe_debug_pub.g_file);
             INSERT INTO LOGFILE (STEPID, MODULE)
                     VALUES (
                               22,
                                  TO_CHAR (l_header_rec_out.header_id)
                               || '-'
                               || l_msg_data);
             COMMIT;
             xbreak := '106';
             SELECT order_number
               INTO v_order
               FROM oe_order_headerS_all
              WHERE header_id = l_header_rec_out.header_id;
             p_order_number := v_order;
          END LOOP;
          FOR i IN 1 .. l_msg_count
          LOOP
             k := k + 1;
             xbreak := '108';
             Oe_Msg_Pub.get (p_msg_index       => k,
                             p_encoded         => Fnd_Api.G_FALSE,
                             p_data            => l_msg_data,
                             p_msg_index_out   => l_msg_index_out);
             INSERT INTO LOGFILE (STEPID, MODULE)
                  VALUES (24, l_msg_data);
             fnd_file.put_line (
                fnd_file.LOG,
                   'Return from the API:-'
                || 'return status:-'
                || l_return_status
                || '-'
                || l_msg_data);
          END LOOP;
          /* Check if the process order goes through then it prints the success message, otherwise it prints failed message.*/
          IF l_return_status = FND_API.G_RET_STS_SUCCESS
          THEN
             xbreak := '109';
             fnd_file.put_line (
                fnd_file.LOG,
                   'Return from the API:-'
                || 'return status:-'
                || l_return_status
                || '-'
                || l_header_rec_out.header_id);
          ELSE
             xbreak := '110';
             fnd_file.put_line (
                fnd_file.LOG,
                   'Return from the API:-'
                || 'return status:-'
                || l_return_status
                || '-'
                || TO_CHAR (l_header_rec_out.header_id));
          END IF;
       EXCEPTION
          WHEN OTHERS
          THEN
             errorx := xbreak || '-' || SQLERRM;
             raise_application_error (-20002, errorx);
       END;
    END;

  • Problem In Creating Sales Order Through DI API

    Hi
    I am Creating The Sales Order Through DI API.
    the Error Is Coming - " [OACT] , 'No matching records found (ODBC -2028)'"
    anyone  can help me solving it.

    Hi vivek,
    Have you tried adding the same document with the client ?
    OACT is the accounts table and this error message typically indicates that there is an account parameter missing somewhere in the system.
    Possible causes include:
    - you are using a tax group or warehouse which does not have all the required accounts set
    - There is a price rounding and the rounding price account has not been set in the account settings
    - etc.
    The first things I would check include the tax group settings and the G/L Account determination settings.
    Henry

  • Daily sales report with last  selling price

    Dear All,
    how to query daily sales record with last selling price as  following:
    cust. code ,  item  , unit price, last selling price to this cust. within 3 month ,  highest  selling price of  this item with 3months
    I'm new to both  SAP and SQL, Please help! Many Thanks!!
    Wing

    Hi,
       Try this........
    SELECT P.CardCode,P.CardName,P.ItemCode,
    [1] as [Jan],
    [2] as [Feb],
    [3] as [Mar],
      [4] as [Apr],
    [5] as [May],
    [6] as [Jun],
    [7] as [Jul],
    [8] as [Aug],
    [9] as [Sep],
    [10] as [Oct],
    [11] as [Nov],
    [12] as [Dec]
    FROM (SELECT (T0.CardCode),T0.CardName,t1.ItemCode,T1.price,MONTH(T1.Docdate)as month
    FROM dbo.OINV  T0
    inner join INV1 T1 ON T0.DocEntry=T1.DocEntry
    inner join OITM t2 on T1.ItemCode=t2.ItemCode 
    WHERE T1.DocDate>='[%0]' and T1.DocDate<='[%1]' and T1.ITEMCODE='[%2]'
    and T0.CardCode='[%3]'
    ) S
      PIVOT  (max(price) FOR [month] IN
    ([4],[5],[6],[7],[8],[9],[10],[11],[12],[1],[2],[3])) P
    ORDER BY P.[CardCode]
    Check this link for SQL tutorials.........
    http://beginner-sql-tutorial.com/sql-subquery.htm
    http://w3schools.com/sql/default.asp

Maybe you are looking for

  • Can i use the same number as my tablet

    I want to add my prepaid basic phone to my more everything tablet, making both devices more everything. can I keep my phone number or do I need to change it and what will happen to the prepaid balance when I make the change?

  • About "the transaction is no longer active" exception

    Hi all My application is deployed on the weblogic 7 SP2 and whenever i am trying to ship the orders which involves the Database interactions i am getting the following error. I increased the transaction time out periods to 5000 seconds in config.xml

  • Sales order with reference Contract

    Hi Gurus, i want to create a sales order with refrence to a contract. While iam clicking on withreference button in VA01 i am getting inquiry,quatation, contract tabs. But i want only contract tab shoul reflect. so how can i set this in SD. Cheers, S

  • OWB_REMOTE_ADMIN value for remote control centre service?

    We're upgrading from OWB 10.2 to 11gR2, and it's failing with a message saying that the 'owb\UnifiedRepos\remote_owb_install.sql' script needs to be run to set the OWB_REMOTE_HOME to the OWB home on the database server. However, as with our version 1

  • Meter's scale color

    Hi anyone who can programtically change the property of the meter, Scale.MarkerVals?  I could not find ways to pass the values to control the colour range properly..  I have attached it for you. That's how it works. After the colour ranges for the me