2 Replies Latest reply: Mar 15, 2012 2:14 PM by 772723 RSS

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

    883360
      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
        • 1. Re: Need Sample API code to update Quote Line level Unit Selling Price alone.
          user170425
          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
          • 2. Re: Need Sample API code to update Quote Line level Unit Selling Price alone.
            772723
            Hi,

            I am trying to update Unit Selling Price using the program you gave.
            It is not updating, but API is returing S.
            Can you help me?

            Best regards,
            Satyendra