Apply adjustments thru process_order API

I have created an order and order lines .
Then I am trying to apply a modifier ( manual ) thru process_order API by giving the header_id of order , list_header_id,list_line id of modifier , line_index as 1 ( for line 1 ) , automatic_flag as 'N' .
But the adjustment is not applying .
When I am navigating thru ACTIONS -> view adjustments and applying the same manual modifier it is applying .

Any idea any one ....................................
why this is not happening

Similar Messages

  • 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

  • Process_order api - Validation Failed for Field Bill To

    I am relatively new to the EBS world and I'm having some issues with calling the OE_Order_Pub.Process_order API. When I call this API I am getting a return error of "Validation failed for field - Bill To".
    For a background...I have an APEX application where users can choose parts from a small part master list to add to an existing order. The existing order will not have a status of Closed or Cancelled and there will be atleast 1 line in the order before the new parts are added. The parts will be added as new lines to the order with some of the new line data defaulting to the same information as the first line. I am using EBS version 12.1.3 with a multi-org setup. It seems that the orders under one org (id=3) are working fine, but another org(id=569) they never work and keep getting the error. I am setting the context to the org of the order and initializing the apps user information with the responsibility "Order Management Super User".
    Do you have any idea what could be wrong or how I can debug the error to get a little more detail?
    Here is the procedure I have.
    PROCEDURE TEK_ORD_PROCESS_ORDER(p_order_id IN NUMBER, p_return_code OUT NOCOPY VARCHAR2, p_status OUT NOCOPY VARCHAR2) IS
        CURSOR c_order_parts IS
          SELECT *
            FROM TEK_APEX.TEK_ORD_ORDER_PARTS
           WHERE ORDER_ID = p_order_id;
        TYPE t_parts IS TABLE OF TEK_APEX.TEK_ORD_ORDER_PARTS%ROWTYPE;
        v_order_parts t_parts;
        --Setup variables
        H_Op_Code      VARCHAR2(25) DEFAULT OE_GLOBALS.G_OPR_UPDATE;
        L_Op_Code      VARCHAR2(25) DEFAULT OE_GLOBALS.G_OPR_CREATE;
        v_install_type VARCHAR2(25) := 'PTO';
        v_source_id    NUMBER;
        v_user_id      NUMBER;
        v_resp_id      NUMBER;
        v_app_id       NUMBER;
        v_debug        VARCHAR2(32767);
        v_oracle_order OE_ORDER_HEADERS_ALL%ROWTYPE;
        v_apex_order   TEK_APEX.TEK_ORD_SALES_ORDERS%ROWTYPE;
        p_header_rec                    OE_Order_Pub.Header_Rec_Type;
        p_header_val_rec                OE_Order_Pub.Header_Val_Rec_Type;
        p_Header_Adj_tab                OE_Order_Pub.Header_Adj_Tbl_Type;
        p_Header_Adj_val_tab            OE_Order_Pub.Header_Adj_Val_Tbl_Type;
        p_Header_price_Att_tab          OE_Order_Pub.Header_Price_Att_Tbl_Type;
        p_Header_Adj_Att_tab            OE_Order_Pub.Header_Adj_Att_Tbl_Type;
        p_Header_Adj_Assoc_tab          OE_Order_Pub.Header_Adj_Assoc_Tbl_Type;
        p_Header_Scredit_tab            OE_Order_Pub.Header_Scredit_Tbl_Type;
        p_Header_Scredit_val_tab        OE_Order_Pub.Header_Scredit_Val_Tbl_Type;
        p_line_tab                      OE_Order_Pub.Line_Tbl_Type;
        p_line_val_tab                  OE_Order_Pub.Line_Val_Tbl_Type;
        p_Line_Adj_tab                  OE_Order_Pub.Line_Adj_Tbl_Type;
        p_Line_Adj_val_tab              OE_Order_Pub.Line_Adj_Val_Tbl_Type;
        p_Line_price_Att_tab            OE_Order_Pub.Line_Price_Att_Tbl_Type;
        p_Line_Adj_Att_tab              OE_Order_Pub.Line_Adj_Att_Tbl_Type;
        p_Line_Adj_Assoc_tab            OE_Order_Pub.Line_Adj_Assoc_Tbl_Type;
        p_Line_Scredit_tab              OE_Order_Pub.Line_Scredit_Tbl_Type;
        p_Line_Scredit_val_tab          OE_Order_Pub.Line_Scredit_Val_Tbl_Type;
        p_Lot_Serial_tab                OE_Order_Pub.Lot_Serial_Tbl_Type;
        p_Lot_Serial_val_tab            OE_Order_Pub.Lot_Serial_Val_Tbl_Type;
        p_action_request_tab            OE_Order_pub.Request_Tbl_Type;
        l_header_rec                    OE_Order_Pub.Header_Rec_Type;
        l_header_val_rec                OE_Order_Pub.Header_Val_Rec_Type;
        l_Header_Adj_tab                OE_Order_Pub.Header_Adj_Tbl_Type;
        l_Header_Adj_val_tab            OE_Order_Pub.Header_Adj_Val_Tbl_Type;
        l_Header_price_Att_tab          OE_Order_Pub.Header_Price_Att_Tbl_Type;
        l_Header_Adj_Att_tab            OE_Order_Pub.Header_Adj_Att_Tbl_Type;
        l_Header_Adj_Assoc_tab          OE_Order_Pub.Header_Adj_Assoc_Tbl_Type;
        l_Header_Scredit_tab            OE_Order_Pub.Header_Scredit_Tbl_Type;
        l_Header_Scredit_val_tab        OE_Order_Pub.Header_Scredit_Val_Tbl_Type;
        l_line_tab                      OE_Order_Pub.Line_Tbl_Type;
        l_line_val_tab                  OE_Order_Pub.Line_Val_Tbl_Type;
        l_Line_Adj_tab                  OE_Order_Pub.Line_Adj_Tbl_Type;
        l_Line_Adj_val_tab              OE_Order_Pub.Line_Adj_Val_Tbl_Type;
        l_Line_price_Att_tab            OE_Order_Pub.Line_Price_Att_Tbl_Type;
        l_Line_Adj_Att_tab              OE_Order_Pub.Line_Adj_Att_Tbl_Type;
        l_Line_Adj_Assoc_tab            OE_Order_Pub.Line_Adj_Assoc_Tbl_Type;
        l_Line_Scredit_tab              OE_Order_Pub.Line_Scredit_Tbl_Type;
        l_Line_Scredit_val_tab          OE_Order_Pub.Line_Scredit_Val_Tbl_Type;
        l_Lot_Serial_tab                OE_Order_Pub.Lot_Serial_Tbl_Type;
        l_Lot_Serial_val_tab            OE_Order_Pub.Lot_Serial_Val_Tbl_Type;
        l_ret_status                    VARCHAR2(200);
        l_msg_count                     NUMBER;
        l_msg_data                      VARCHAR2(200);
           --Email information
        v_email_address           varchar2(100);
           v_msg_text                varchar(1000);
           v_subject_text            varchar(1000);
           --Default line information
        v_item_id           NUMBER;
        v_contact_id        NUMBER;
        v_invoice_to_org_id oe_order_lines_all.INVOICE_TO_ORG_ID%TYPE;
        v_ship_to_org_id    oe_order_lines_all.SHIP_TO_ORG_ID%TYPE;
        v_sold_to_org_id    oe_order_lines_all.SOLD_TO_ORG_ID%TYPE;
        v_flow_status_code  oe_order_lines_all.FLOW_STATUS_CODE%TYPE;
        FUNCTION GET_ORACLE_ORDER(p_order_number IN OE_ORDER_HEADERS_ALL.ORDER_NUMBER%TYPE)
          RETURN OE_ORDER_HEADERS_ALL%ROWTYPE IS
          v_order OE_ORDER_HEADERS_ALL%ROWTYPE;
        BEGIN
          SELECT *
            INTO v_order
            FROM APPS.OE_ORDER_HEADERS_ALL
           WHERE ORDER_NUMBER = p_order_number;
          RETURN v_order;
        EXCEPTION
          WHEN OTHERS THEN
            RETURN NULL;
        END GET_ORACLE_ORDER;
        FUNCTION GET_APEX_ORDER(p_order_id IN TEK_APEX.TEK_ORD_SALES_ORDERS.ORDER_ID%TYPE)
          RETURN TEK_APEX.TEK_ORD_SALES_ORDERS%ROWTYPE IS
          v_order TEK_APEX.TEK_ORD_SALES_ORDERS%ROWTYPE;
        BEGIN
          SELECT *
            INTO v_order
            FROM TEK_APEX.TEK_ORD_SALES_ORDERS
           WHERE ORDER_ID = p_order_id;
          RETURN v_order;
        EXCEPTION
          WHEN OTHERS THEN
            RETURN NULL;
        END GET_APEX_ORDER;
        FUNCTION GET_SOURCE_ID(p_source_name IN VARCHAR2)
          RETURN OE_ORDER_SOURCES.ORDER_SOURCE_ID%TYPE IS
          v_source_id OE_ORDER_SOURCES.ORDER_SOURCE_ID%TYPE;
        BEGIN
          SELECT ORDER_SOURCE_ID
            INTO v_source_id
            FROM APPS.OE_ORDER_SOURCES
           WHERE NAME = p_source_name;
          RETURN v_source_id;
        EXCEPTION
          WHEN OTHERS THEN
            RETURN NULL;
        END GET_SOURCE_ID;
        FUNCTION GET_ITEM_ID(p_part_number IN VARCHAR2, p_org_id IN NUMBER)
          RETURN MTL_SYSTEM_ITEMS.INVENTORY_ITEM_ID%TYPE IS
          v_item_id MTL_SYSTEM_ITEMS.INVENTORY_ITEM_ID%TYPE;
        BEGIN
          SELECT INVENTORY_ITEM_ID
            INTO v_item_id
            FROM APPS.MTL_SYSTEM_ITEMS
           WHERE SEGMENT1 = p_part_number
             AND ORGANIZATION_ID = p_org_id;
          RETURN v_item_id;
        EXCEPTION
          WHEN OTHERS THEN
            RETURN NULL;
        END GET_ITEM_ID;
      BEGIN
        apps.mo_global.set_policy_context('S',3);
        apps.mo_global.init('XXTEK');
        BEGIN
          SELECT USER_ID
            INTO v_user_id
            FROM APPS.FND_USER
           WHERE USER_NAME = 'SYSADMIN';
        EXCEPTION
          WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20001, 'Error selecting user');
        END;
        BEGIN
          SELECT RESPONSIBILITY_ID, APPLICATION_ID
            INTO v_resp_id, v_app_id
            FROM TEK_APEX.TEK_RR_ACTIVE_RESP_VW
           WHERE UPPER(RESPONSIBILITY_NAME) = 'ORDER MANAGEMENT SUPER USER';
          --Set current user information
          fnd_global.apps_initialize (user_id      => v_user_id
                                     ,resp_id      => v_resp_id
                                     ,resp_appl_id => v_app_id);
        EXCEPTION
          WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20001, 'Error selecting responsibility');
        END;
        --Get the order information from Oracle and APEX
        v_apex_order := GET_APEX_ORDER(p_order_id);
        IF v_apex_order.ORDER_ID IS NULL THEN
          RAISE_APPLICATION_ERROR(-20001, 'APEX Order ID is invalid: ' || p_order_id);
        END IF;
        v_oracle_order := GET_ORACLE_ORDER(TO_NUMBER(v_apex_order.ORDER_NUMBER));
        IF v_oracle_order.ORDER_NUMBER IS NULL THEN
          RAISE_APPLICATION_ERROR(-20001, 'Order Number not found in Oracle: ' || v_apex_order.ORDER_NUMBER);
        END IF;
        apps.mo_global.set_policy_context('S', v_oracle_order.ORG_ID);
        v_source_id := GET_SOURCE_ID('IMPORT');
        IF v_source_id IS NULL THEN
          RAISE_APPLICATION_ERROR(-20001, 'Source ID not found for IMPORT');
        END IF;
        /* ********** Gather Order Header********** */
        /* ********** Info.              ********** */
        OE_Order_Pub.Get_Order(p_api_version_number    =>      1.0,
                               p_init_msg_list         =>      FND_API.G_TRUE,
                               p_return_values         =>      FND_API.G_TRUE,
                               x_return_status         =>      l_ret_status,
                               x_msg_count             =>      l_msg_count,
                               x_msg_data              =>      l_msg_data,
                               p_header_id             =>      v_oracle_order.HEADER_ID,
                               p_header                =>      NULL,
                               x_header_rec            =>      l_header_rec,
                               x_header_val_rec        =>      l_header_val_rec,
                               x_Header_Adj_tbl        =>      l_Header_Adj_tab,
                               x_Header_Adj_val_tbl    =>      l_Header_Adj_val_tab,
                               x_Header_price_Att_tbl  =>      l_Header_price_Att_tab,
                               x_Header_Adj_Att_tbl    =>      l_Header_Adj_Att_tab,
                               x_Header_Adj_Assoc_tbl  =>      l_Header_Adj_Assoc_tab,
                               x_Header_Scredit_tbl    =>      l_Header_Scredit_tab,
                               x_Header_Scredit_val_tbl=>      l_Header_Scredit_val_tab,
                               x_line_tbl              =>      l_line_tab,
                               x_line_val_tbl          =>      l_line_val_tab,
                               x_Line_Adj_tbl          =>      l_Line_Adj_tab,
                               x_Line_Adj_val_tbl      =>      l_Line_Adj_val_tab,
                               x_Line_price_Att_tbl    =>      l_Line_price_Att_tab,
                               x_Line_Adj_Att_tbl      =>      l_Line_Adj_Att_tab,
                               x_Line_Adj_Assoc_tbl    =>      l_Line_Adj_Assoc_tab,
                               x_Line_Scredit_tbl      =>      l_Line_Scredit_tab,
                               x_Line_Scredit_val_tbl  =>      l_Line_Scredit_val_tab,
                               x_Lot_Serial_tbl        =>      l_Lot_Serial_tab,
                               x_Lot_Serial_val_tbl    =>      l_Lot_Serial_val_tab);
        --Save defaults from first line
        IF l_line_tab.EXISTS(1) THEN
          v_contact_id        := l_line_tab(1).SHIP_TO_CONTACT_ID;
          v_invoice_to_org_id := l_line_tab(1).INVOICE_TO_ORG_ID;
          v_ship_to_org_id    := l_line_tab(1).SHIP_TO_ORG_ID;
          v_sold_to_org_id    := l_line_tab(1).SOLD_TO_ORG_ID;
          v_flow_status_code  := l_line_tab(1).FLOW_STATUS_CODE;
        END IF;
        --Clear out the line array before adding any new parts
        FOR i IN l_line_tab.FIRST..l_line_tab.LAST LOOP
          l_line_tab.DELETE(i);
          l_line_val_tab.DELETE(i);
          l_line_adj_tab.DELETE(i);
          l_line_adj_val_tab.DELETE(i);
          l_line_price_att_tab.DELETE(i);
          l_line_adj_att_tab.DELETE(i);
          l_line_adj_assoc_tab.DELETE(i);
          l_line_scredit_tab.DELETE(i);
          l_line_scredit_val_tab.DELETE(i);
          l_lot_serial_tab.DELETE(i);
          l_lot_serial_val_tab.DELETE(i);
        END LOOP;
        /* ********** Gather Order Lines ********** */
        OPEN c_order_parts;
        FETCH c_order_parts BULK COLLECT INTO v_order_parts;
        CLOSE c_order_parts;
        FOR i IN v_order_parts.FIRST..v_order_parts.LAST LOOP
          v_item_id := GET_ITEM_ID(v_order_parts(i).PART_NUMBER, v_oracle_order.SHIP_FROM_ORG_ID);
          IF v_item_id IS NULL THEN
            RAISE_APPLICATION_ERROR(-20001, 'Error selecting part number ' || v_order_parts(i).PART_NUMBER);
          END IF;
          --Clear line first
          l_line_tab(i)             := OE_Order_Pub.G_Miss_Line_Rec;
             l_line_val_tab(i)         := OE_ORDER_PUB.G_MISS_LINE_VAL_REC;
          l_line_adj_tab(i)             := OE_ORDER_PUB.G_MISS_LINE_ADJ_REC;
          l_line_adj_val_tab(i)     := OE_ORDER_PUB.G_MISS_LINE_ADJ_VAL_REC;
          l_line_price_att_tab(i)      := OE_ORDER_PUB.G_MISS_LINE_PRICE_ATT_REC ;
          l_line_adj_att_tab(i)     := OE_ORDER_PUB.G_MISS_LINE_ADJ_ATT_REC;
          l_line_adj_assoc_tab(i)   := OE_ORDER_PUB.G_MISS_LINE_ADJ_ASSOC_REC;
          l_line_scredit_tab(i)     := OE_ORDER_PUB.G_MISS_LINE_SCREDIT_REC;
          l_line_scredit_val_tab(i) := OE_ORDER_PUB.G_MISS_LINE_SCREDIT_VAL_REC;
          l_lot_serial_tab(i)       := OE_ORDER_PUB.G_MISS_LOT_SERIAL_REC;
          l_lot_serial_val_tab(i)   := OE_ORDER_PUB.G_MISS_LOT_SERIAL_VAL_REC;
          --Set line information
             l_line_tab(i).PRICE_LIST_ID          := v_oracle_order.PRICE_LIST_ID;
          l_line_tab(i).header_id              := v_oracle_order.header_id;
          l_line_tab(i).inventory_item_id      := v_item_id;
          l_line_tab(i).ordered_quantity       := v_order_parts(i).QUANTITY;
          l_line_tab(i).operation              := l_op_code;
          l_line_tab(i).unit_list_price        := 0;
          l_line_tab(i).ship_from_org_id       := v_oracle_order.ship_from_org_id;
          l_line_tab(i).program_id             := fnd_global.conc_program_id ;
          l_line_tab(i).program_application_id := fnd_global.PROG_APPL_ID;
          l_line_tab(i).order_source_id        := v_source_id;
          l_line_tab(i).calculate_price_flag   := 'N' ;
          l_line_tab(i).unit_selling_price     := 0.00 ;
             l_line_tab(i).request_date           := v_apex_order.onsite_date;
             l_line_tab(i).Schedule_ship_date     := v_apex_order.onsite_date;
             l_line_tab(i).promise_date           := null;
          l_line_tab(i).invoice_to_org_id      := v_invoice_to_org_id;
          l_line_tab(i).ship_to_org_id         := v_ship_to_org_id;
          l_line_tab(i).sold_to_org_id         := v_sold_to_org_id;
          l_line_tab(i).ship_to_contact_id     := v_contact_id;
        END LOOP;
    --OE_DEBUG_PUB.DEBUG_ON;
    --OE_DEBUG_PUB.Initialize;
    --OE_DEBUG_PUB.SetDebugLevel(5);
        --Add lines to order
        OE_Order_Pub.Process_order(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_FALSE,
                                   x_return_status                 =>      l_ret_status,
                                   x_msg_count                     =>      l_msg_count,
                                   x_msg_data                      =>      l_msg_data,
                                   p_header_rec                    =>  l_header_rec,
                                   p_old_header_rec                =>  l_header_rec,
                                   p_header_val_rec                =>  l_header_val_rec,
                                   p_old_header_val_rec            =>  l_header_val_rec,
                                   p_Header_Adj_tbl                =>  l_Header_Adj_tab,
                                   p_old_Header_Adj_tbl            =>  l_Header_Adj_tab,
                                   p_Header_Adj_val_tbl            =>  l_Header_Adj_val_tab,
                                   p_old_Header_Adj_val_tbl        =>  l_Header_Adj_val_tab,
                                   p_Header_price_Att_tbl          =>  l_Header_price_Att_tab,
                                   p_old_Header_Price_Att_tbl      =>  l_Header_price_Att_tab,
                                   p_Header_Adj_Att_tbl            =>  l_Header_Adj_Att_tab,
                                   p_old_Header_Adj_Att_tbl        =>  l_Header_Adj_Att_tab,
                                   p_Header_Adj_Assoc_tbl          =>  l_Header_Adj_Assoc_tab,
                                   p_old_Header_Adj_Assoc_tbl      =>  l_Header_Adj_Assoc_tab,
                                   p_Header_Scredit_tbl            =>  l_Header_Scredit_tab,
                                   p_old_Header_Scredit_tbl        =>  l_Header_Scredit_tab,
                                   p_Header_Scredit_val_tbl        =>  l_Header_Scredit_val_tab,
                                   p_old_Header_Scredit_val_tbl    =>  l_Header_Scredit_val_tab,
                                   p_line_tbl                      =>  l_line_tab,
                                   p_line_val_tbl                  =>  l_line_val_tab,
                                   p_Line_Adj_tbl                  =>  l_line_adj_tab,
                                   p_Line_Adj_val_tbl              =>  l_line_adj_val_tab,
                                   p_Line_price_Att_tbl            =>  l_line_price_att_tab,
                                   p_Line_Adj_Att_tbl              =>  l_line_adj_att_tab,
                                   p_Line_Adj_Assoc_tbl            =>  l_line_adj_assoc_tab,
                                   p_Line_Scredit_tbl              =>  l_line_scredit_tab,
                                   p_Line_Scredit_val_tbl          =>  l_line_scredit_val_tab,
                                   p_Lot_Serial_tbl                =>  l_lot_serial_tab,
                                   p_Lot_Serial_val_tbl            =>  l_lot_serial_val_tab,
                                   p_action_request_tbl            =>  OE_ORDER_PUB.G_MISS_REQUEST_TBL,
                                   x_header_rec                    =>      p_header_rec,
                                   x_header_val_rec                =>      p_header_val_rec,
                                   x_Header_Adj_tbl                =>      p_Header_Adj_tab,
                                   x_Header_Adj_val_tbl            =>      p_Header_Adj_val_tab,
                                   x_Header_price_Att_tbl          =>      p_Header_price_Att_tab,
                                   x_Header_Adj_Att_tbl            =>      p_Header_Adj_Att_tab,
                                   x_Header_Adj_Assoc_tbl          =>      p_Header_Adj_Assoc_tab,
                                   x_Header_Scredit_tbl            =>      p_Header_Scredit_tab,
                                   x_Header_Scredit_val_tbl        =>      p_Header_Scredit_val_tab,
                                   x_line_tbl                      =>      p_line_tab,
                                   x_line_val_tbl                  =>      p_line_val_tab,
                                   x_line_adj_tbl                  =>      p_line_adj_tab,
                                   x_line_adj_val_tbl              =>      p_line_adj_val_tab,
                                   x_line_price_att_tbl            =>      p_line_price_att_tab,
                                   x_line_adj_att_tbl              =>      p_line_adj_att_tab,
                                   x_line_adj_assoc_tbl            =>      p_line_adj_assoc_tab,
                                   x_line_scredit_tbl              =>      p_line_scredit_tab,
                                   x_line_scredit_val_tbl          =>      p_line_scredit_val_tab,
                                   x_lot_serial_tbl                =>      p_lot_serial_tab,
                                   x_lot_serial_val_tbl            =>      p_lot_serial_val_tab,
                                   x_action_request_tbl            =>      p_action_request_tab);
    --  OE_DEBUG_PUB.DEBUG_OFF;
        p_return_code := l_ret_status;
        IF l_ret_status != 'S' THEN
          DBMS_OUTPUT.PUT_LINE(l_msg_data);
          IF l_msg_count = 1 THEN
            p_status := OE_Msg_Pub.Get(1,'F');
          ELSE
            FOR i IN 1..l_msg_count LOOP
              p_status := OE_Msg_Pub.Get(i,'F') || '<br />';
            END LOOP;
          END IF;
          p_status := 'Error loading lines<br>' || p_status;
        ELSE
          p_status := 'Order Processed Successfully<br>' || v_order_parts.COUNT || ' Line(s) Loaded';
        END IF;
    --    WHILE OE_DEBUG_PUB.G_DEBUG_INDEX < OE_DEBUG_PUB.CountDebug LOOP
    --      OE_DEBUG_PUB.GetNext(v_debug);
    --      DBMS_OUTPUT.PUT_LINE(v_debug);
    --    END LOOP;
      EXCEPTION
        WHEN OTHERS THEN
          ROLLBACK;
          RAISE;
      END TEK_ORD_PROCESS_ORDER;Thanks!
    Jonathan Hart

    Hello,
    Try the following
    1) Check if any processing constraints are applied to customer/location
    2) Try to create a new customer and associate internal location.
    Create a new order to reproduce the issue
    Thanks
    -Arif

  • Re:Oracle Apps Adapter and invocation of Process_order API

    Hi,
    I am trying to create sales order in Oracle Apps 11.5.10.2 using Oracle Apps Adapter by invoking Process_order API and facing the following problem.
    file:/D:/SOA_SUITE/product/10.1.3.1/OracleAS_1/bpel/domains/default/tmp/.bpel_EDI850InboundService_1.0_973a35abc5c4e4b30f414886437b790d.tmp/writeEDIData
    2OracleService.wsdl [
    writeEDIData2OracleService_ptt::writeEDIData2OracleService(InputParameters,Outpu
    tParameters) ] - WSIF JCA Execute of operation 'writeEDIData2OracleService'
    failed due to: Error while converting to a Java struct object.
    Unable to convert the XSD element P_HEADER_REC whose user defined type is
    OE_ORDER_PUB_HEADER_REC_TYPE. Cause: java.sql.SQLException: Closed Connection
    [Caused by: Closed Connection]
    ; nested exception is:
    ORABPEL-11802
    Error while converting to a Java struct object.
    Unable to convert the XSD element P_HEADER_REC whose user defined type is OE_ORDER_PUB_HEADER_REC_TYPE. Cause:
    java.sql.SQLException: Closed Connection [Caused by: Closed Connection]
    Check to ensure that the XML data describing the user defined type matches the
    definition of the struct in the XSD. Contact oracle support if error is not
    fixable.
    I am using SOA-Suite 10.1.3.3.0.
    Can someone help me on this.
    Regards
    Lalit

    Hi lalit,
    Upgrade your database 10.0.2 to 10.1.0.5.
    You can apply the Oracle Database 10g release 10.1.0.5 patch set to the following Oracle Database 10g releases (10.1.0.2, 10.1.0.3, or 10.1.0.4) installations.
    See document 263719.1 on the OracleMetalink Web site:
    To locate document 263719.1:
    -->Log on to OracleMetalink.
    -->Click Advanced at the top of the OracleMetalink page.
    -->Enter 263719.1 in the Document ID field, then click Submit.
    Cheers,
    Abhi...

  • 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;

  • Process_Order API Error

    Hi to all,
    I want to create a new Sales Order using PL/SQL, so i used the process_order API to achieve this.
    I first set the client info using fnd_client_info.set_org_context(82) and then set the initialization parameters using fnd_global.apps_initilize (1090,21623,660).
    To get the initialization parameters i used this query:
    select fu.user_Id ,
    fur.responsibility_Id,
    fur.responsibility_application_Id,
    frt.responsibility_name
    from fnd_user fu,
    fnd_responsibility_tl frt,
    fnd_user_resp_groups fur
    where user_name = '<USER>'
    and fu.user_Id = fur.user_Id
    and fur.responsibility_Id = frt.responsibility_Id
    order by fur.responsibility_Id
    I then called my api but i get errors, such as ORA-01403: no data found and ORA-06512 at APPS.OE_ORDER_CACHE and ORA-01403 no data found in Package OE_ORDER_UTIL Procedure GET_ATTRIBUTE_NAME.
    Below is my code:
    BEGIN
         fnd_client_info.set_org_context(82);
         fnd_global.apps_initialize(1090,21623,660); -- pass in user_id, responsibility_id, and application_id     
    END;
    DECLARE
    --for get order
    x_return_status VARCHAR2(1000);
    x_msg_count NUMBER(20);
    x_msg_data VARCHAR2(1000);
    x_header_rec Oe_Order_Pub.Header_Rec_Type;
    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_tbl Oe_Order_Pub.Line_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;
    --for adding a new line to process order
    x_header_rec2 Oe_Order_Pub.Header_Rec_Type;
    x_line_tbl2 Oe_Order_Pub.Line_Tbl_Type;
    x_action_request_tbl Oe_Order_Pub.Request_Tbl_Type;
    --for getting messages
    v_msg_data VARCHAR2(8000);
    v_msg_index_out NUMBER(10);
    CCIDGOOD varchar2(1);
    X_RETURN_CCID number;
    X_CONCAT_SEGS varchar2(250);
    X_CONCAT_IDS varchar2(250);
    X_CONCAT_DESCRS varchar2(250);
    -- X_MSG_COUNT number;
    X_ERRMSG varchar2(1000);
    X_ORDER_LINE_ID number;
    X_FLEX_NUMBER number;
    X_DEBUG_FILE varchar2(100);
    x_fnd_debug varchar2(32000);
    x_status boolean;
    p_ship_from number;
    BEGIN
    fnd_global.apps_initialize(1318,21623,660); pass in user_id, responsibility_id, and application_id
    --dbms_application_info.SET_CLIENT_INFO('82');
    fnd_global.apps_initialize(1090,21623,660); pass in user_id, responsibility_id, and application_id
    oe_debug_pub.initialize;
    X_DEBUG_FILE := OE_DEBUG_PUB.Set_Debug_Mode('TABLE');
    oe_debug_pub.SetDebugLevel(1); -- Use 5 for the most debuging output, I warn you its a lot of data
    Oe_Msg_Pub.initialize;
    -- Setting Up the Header Record
    -- initialize record to (a record template?)
    x_header_rec2 := OE_ORDER_PUB.G_MISS_HEADER_REC;
    -- required attributes (e.g. Order Type and Customer)
    x_header_rec2.order_type_id := 1001; -- You need a valid Order_Type
    x_header_rec2.sold_to_org_id := 1049; -- You need to have a valid Org_id for your Customer AR_CUSTOMERS_V.CUSTOMER_ID
    --x_header_rec2.invoice_to_org_id := 1025;
    x_header_rec2.ship_to_org_id := 1040; -- You need to have a valid SHIP_TO_ORG_ID
    --x_header_rec2.ship_from_org_id := 207;
    --x_header_rec2.sold_from_org_id := 204;
    --x_header_rec2.payment_term_id := 1020;
    x_header_rec2.cust_po_number := 'PONUMBERORDER';
    -- Pricing
    --x_header_rec2.price_list_id := 6041;
    -- Null attribute: no defaulting for freight terms
    -- check biz rules on this, copied from sample code
    --x_header_rec2.freight_terms_code := NULL;
    -- Indicates to process order that a new header is being created
    x_header_rec2.operation := OE_GLOBALS.G_OPR_CREATE;
    -- FIRST LINE RECORD
    --x_line_tbl2(1) := Oe_Order_Pub.G_MISS_LINE_REC;
    -- x_line_tbl2(1).inventory_item_id := 3178; -- Your INVENTORY_ITEM_ID VALUE goes here
    --x_line_tbl2(1).ordered_quantity := 2;
    --x_line_tbl2(1).operation := Oe_Globals.G_OPR_CREATE;
    IF TRUE THEN -- enable/disable toggle for Process_Order
    Oe_Order_Pub.Process_Order
    ( 1
    , Fnd_Api.G_FALSE
    , Fnd_Api.G_FALSE
    , Fnd_Api.G_FALSE
    , x_return_status
    , x_msg_count
    , x_msg_data
    --IN PARAMETERS
    , p_line_tbl => x_line_tbl2
    , p_header_rec => x_header_rec2
    --OUT PARAMETERS
    , x_header_rec => x_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 => x_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 => x_action_request_tbl
    COMMIT;
    DBMS_OUTPUT.PUT_LINE('process ORDER ret status IS: ' || x_return_status);
    DBMS_OUTPUT.PUT_LINE('process ORDER msg data IS: ' || x_msg_data);
    DBMS_OUTPUT.PUT_LINE('process ORDER msg COUNT IS: ' || x_msg_count);
    DBMS_OUTPUT.PUT_LINE('header.order_number IS: ' || x_header_rec.order_number);
    DBMS_OUTPUT.PUT_LINE('header.return_status IS: ' || x_header_rec.return_status);
    DBMS_OUTPUT.PUT_LINE('header.booked_flag IS: ' || x_header_rec.booked_flag);
    DBMS_OUTPUT.PUT_LINE('header.header_id IS: ' || x_header_rec.header_id);
    DBMS_OUTPUT.PUT_LINE('header.order_source_id IS: ' || x_header_rec.order_source_id);
    DBMS_OUTPUT.PUT_LINE('header.flow_status_code IS: ' || x_header_rec.flow_status_code);
    END IF;
    FOR i IN 1 .. x_msg_count LOOP
    Oe_Msg_Pub.get(
    p_msg_index => i
    ,p_encoded => Fnd_Api.G_FALSE
    ,p_data => v_msg_data
    ,p_msg_index_out => v_msg_index_out);
    DBMS_OUTPUT.PUT_LINE('message is: ' || v_msg_data);
    DBMS_OUTPUT.PUT_LINE('message index is: ' || v_msg_index_out);
    END LOOP;
    DBMS_OUTPUT.PUT_LINE('oe_msg_pub.count_msg = ' || Oe_Msg_Pub.count_msg);
    DBMS_OUTPUT.PUT_LINE('****************************************************');
    DBMS_OUTPUT.PUT_LINE('* OUTPUT FROM OM: DEBUG LEVEL PROFILE SETTING *');
    DBMS_OUTPUT.PUT_LINE('****************************************************');
    for i in 1..OE_DEBUG_PUB.g_debug_count loop
    dbms_output.put_line(OE_DEBUG_PUB.G_debug_tbl(i));
    end loop;
    OE_DEBUG_PUB.DEBUG_OFF;
    DBMS_OUTPUT.PUT_LINE('****************************************************');
    DBMS_OUTPUT.PUT_LINE('* SUMMARY OF RETURNED RESULTS *');
    DBMS_OUTPUT.PUT_LINE('****************************************************');
    DBMS_OUTPUT.PUT_LINE('Output Parameters: ');
    DBMS_OUTPUT.PUT_LINE('Debug = ' || OE_DEBUG_PUB.G_DEBUG);
    DBMS_OUTPUT.PUT_LINE('Debug Level = ' || to_char(OE_DEBUG_PUB.G_DEBUG_LEVEL));
    DBMS_OUTPUT.PUT_LINE('Debug File = ' || OE_DEBUG_PUB.G_DIR||'/'||
    OE_DEBUG_PUB.G_FILE);
    DBMS_OUTPUT.PUT_LINE('X_RETURN_CCID = ' || to_char(X_RETURN_CCID));
    DBMS_OUTPUT.PUT_LINE('X_CONCAT_SEGS = ' || X_CONCAT_SEGS);
    DBMS_OUTPUT.PUT_LINE('X_CONCAT_IDS = ' || X_CONCAT_IDS);
    DBMS_OUTPUT.PUT_LINE('X_CONCAT_DESCRS = ' || X_CONCAT_DESCRS);
    DBMS_OUTPUT.PUT_LINE('X_ERRMSG = ' || X_ERRMSG);
    DBMS_OUTPUT.PUT_LINE('****************************************************');
    END;
    Please someone help me as i am stuck for days and i need to complete this as soon as possible.
    Thanks
    Antonis

    Antonis,
    I am using following process which is working fine
    create or replace procedure tnq_so_import_api ( retcode number,errbuff
    varchar2)
    is
    --gmigapi.item_rec_typ;
    l_header_rec OE_Order_PUB.Header_Rec_Type;
    l_line_tbl OE_Order_PUB.Line_Rec_Type;
    l_line_adj_tbl OE_Order_PUB.Line_Adj_Rec_Type;
    l_header_scr_tbl OE_Order_PUB.Header_Scredit_Tbl_Type;
    l_header_adj_tbl OE_Order_PUB.Header_Adj_Val_Tbl_Type;
    l_line_scredit_tbl OE_Order_PUB.Line_Scredit_Rec_Type;
    l_return_status VARCHAR2 (1) := fnd_api.g_ret_sts_success;
    l_msg_count NUMBER;
    l_msg_data VARCHAR2 (10000);
    begin --@1
    -- SETTING UP THE HEADER RECORD
    -- Initialize record to missing
    l_header_rec := OE_ORDER_PUB.G_MISS_HEADER_REC;
    -- Required attributes (e.g. Order Type and Customer)
    l_header_rec.order_type_id := 1000;
    l_header_rec.sold_to_org_id := 100;
    -- Other attributes
    l_header_rec.price_list_id := 10;
    -- Null attribute: no defaulting for freight terms
    l_header_rec.freight_terms_code := NULL;
    -- Indicates to process order that a new header is being created
    l_header_rec.operation := OE_GLOBALS.G_OPR_CREATE;
    -- FIRST LINE RECORD
    -- Initialize record to missing
    l_line_tbl := OE_ORDER_PUB.G_MISS_LINE_REC;
    -- Line attributes
    l_line_tbl.inventory_item_id := 311;
    l_line_tbl.ordered_quantity := 1;
    l_line_tbl.operation := OE_GLOBALS.G_OPR_CREATE;
    -- SECOND LINE RECORD
    -- Initialize record to missing
    --l_line_tbl(2) := OE_ORDER_PUB.G_MISS_LINE_REC;
    -- Line attributes
    --l_line_tbl(2).inventory_item_id := 312;
    --l_line_tbl(2).ordered_quantity := 2;
    --l_line_tbl(2).operation := OE_GLOBALS.G_OPR_CREATE;
    -- CALL TO PROCESS ORDER
    OE_Order_PUB.Process_Order
    ( -- Passing just the entity records that are a part of this order
    p_header_rec => l_header_rec
         ,p_line_tbl => l_line_tbl
         ,p_line_adj_tbl => l_line_adj_tbl
         -- OUT variables
         ,x_header_rec => l_header_rec
         ,x_header_scredit_tbl => l_header_scr_tbl
         ,x_header_adj_tbl => l_header_adj_tbl
         ,x_line_tbl => l_line_tbl
         ,x_line_scredit_tbl => l_line_scredit_tbl
         ,x_line_adj_tbl => l_line_adj_tbl
         ,x_return_status => l_return_status
         ,x_msg_count => l_msg_count
         ,x_msg_data => l_msg_data
    OE_Order_PUB.Process_Order
    ( -- Passing just the entity records that are a part of this order
    p_api_version_number IN NUMBER
    , p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
    , p_return_values IN VARCHAR2 := FND_API.G_FALSE
    , p_action_commit IN VARCHAR2 := FND_API.G_FALSE
    , x_return_status OUT VARCHAR2
    , x_msg_count OUT NUMBER
    , x_msg_data OUT VARCHAR2
    , p_header_rec IN Header_Rec_Type :=
    G_MISS_HEADER_REC
    , p_old_header_rec IN Header_Rec_Type :=
    G_MISS_HEADER_REC
    , p_header_val_rec IN Header_Val_Rec_Type :=
    G_MISS_HEADER_VAL_REC
    , p_old_header_val_rec IN Header_Val_Rec_Type :=
    G_MISS_HEADER_VAL_REC
    , p_Header_Adj_tbl IN Header_Adj_Tbl_Type :=
    G_MISS_HEADER_ADJ_TBL
    , p_old_Header_Adj_tbl IN Header_Adj_Tbl_Type :=
    G_MISS_HEADER_ADJ_TBL
    , p_Header_Adj_val_tbl IN Header_Adj_Val_Tbl_Type :=
    G_MISS_HEADER_ADJ_VAL_TBL
    , p_old_Header_Adj_val_tbl IN Header_Adj_Val_Tbl_Type :=
    G_MISS_HEADER_ADJ_VAL_TBL
    , p_Header_price_Att_tbl IN Header_Price_Att_Tbl_Type :=
    G_MISS_HEADER_PRICE_ATT_TBL
    , p_old_Header_Price_Att_tbl IN Header_Price_Att_Tbl_Type :=
    G_MISS_HEADER_PRICE_ATT_TBL
    , p_Header_Adj_Att_tbl IN Header_Adj_Att_Tbl_Type :=
    G_MISS_HEADER_ADJ_ATT_TBL
    , p_old_Header_Adj_Att_tbl IN Header_Adj_Att_Tbl_Type :=
    G_MISS_HEADER_ADJ_ATT_TBL
    , p_Header_Adj_Assoc_tbl IN Header_Adj_Assoc_Tbl_Type :=
    G_MISS_HEADER_ADJ_ASSOC_TBL
    , p_old_Header_Adj_Assoc_tbl IN Header_Adj_Assoc_Tbl_Type :=
    G_MISS_HEADER_ADJ_ASSOC_TBL
    , p_Header_Scredit_tbl IN Header_Scredit_Tbl_Type :=
    G_MISS_HEADER_SCREDIT_TBL
    , p_old_Header_Scredit_tbl IN Header_Scredit_Tbl_Type :=
    G_MISS_HEADER_SCREDIT_TBL
    , p_Header_Scredit_val_tbl IN Header_Scredit_Val_Tbl_Type :=
    G_MISS_HEADER_SCREDIT_VAL_TBL
    , p_old_Header_Scredit_val_tbl IN Header_Scredit_Val_Tbl_Type :=
    G_MISS_HEADER_SCREDIT_VAL_TBL
    , p_line_tbl IN Line_Tbl_Type :=
    G_MISS_LINE_TBL
    , p_old_line_tbl IN Line_Tbl_Type :=
    G_MISS_LINE_TBL
    , p_line_val_tbl IN Line_Val_Tbl_Type :=
    G_MISS_LINE_VAL_TBL
    , p_old_line_val_tbl IN Line_Val_Tbl_Type :=
    G_MISS_LINE_VAL_TBL
    , p_Line_Adj_tbl IN Line_Adj_Tbl_Type :=
    G_MISS_LINE_ADJ_TBL
    , p_old_Line_Adj_tbl IN Line_Adj_Tbl_Type :=
    G_MISS_LINE_ADJ_TBL
    , p_Line_Adj_val_tbl IN Line_Adj_Val_Tbl_Type :=
    G_MISS_LINE_ADJ_VAL_TBL
    , p_old_Line_Adj_val_tbl IN Line_Adj_Val_Tbl_Type :=
    G_MISS_LINE_ADJ_VAL_TBL
    , p_Line_price_Att_tbl IN Line_Price_Att_Tbl_Type :=
    G_MISS_LINE_PRICE_ATT_TBL
    , p_old_Line_Price_Att_tbl IN Line_Price_Att_Tbl_Type :=
    G_MISS_LINE_PRICE_ATT_TBL
    , p_Line_Adj_Att_tbl IN Line_Adj_Att_Tbl_Type :=
    G_MISS_LINE_ADJ_ATT_TBL
    , p_old_Line_Adj_Att_tbl IN Line_Adj_Att_Tbl_Type :=
    G_MISS_LINE_ADJ_ATT_TBL
    , p_Line_Adj_Assoc_tbl IN Line_Adj_Assoc_Tbl_Type :=
    G_MISS_LINE_ADJ_ASSOC_TBL
    , p_old_Line_Adj_Assoc_tbl IN Line_Adj_Assoc_Tbl_Type :=
    G_MISS_LINE_ADJ_ASSOC_TBL
    , p_Line_Scredit_tbl IN Line_Scredit_Tbl_Type :=
    G_MISS_LINE_SCREDIT_TBL
    , p_old_Line_Scredit_tbl IN Line_Scredit_Tbl_Type :=
    G_MISS_LINE_SCREDIT_TBL
    , p_Line_Scredit_val_tbl IN Line_Scredit_Val_Tbl_Type :=
    G_MISS_LINE_SCREDIT_VAL_TBL
    , p_old_Line_Scredit_val_tbl IN Line_Scredit_Val_Tbl_Type :=
    G_MISS_LINE_SCREDIT_VAL_TBL
    , p_Lot_Serial_tbl IN Lot_Serial_Tbl_Type :=
    G_MISS_LOT_SERIAL_TBL
    , p_old_Lot_Serial_tbl IN Lot_Serial_Tbl_Type :=
    G_MISS_LOT_SERIAL_TBL
    , p_Lot_Serial_val_tbl IN Lot_Serial_Val_Tbl_Type :=
    G_MISS_LOT_SERIAL_VAL_TBL
    , p_old_Lot_Serial_val_tbl IN Lot_Serial_Val_Tbl_Type :=
    G_MISS_LOT_SERIAL_VAL_TBL
    , p_action_request_tbl     IN Request_Tbl_Type :=
                             G_MISS_REQUEST_TBL
    , x_header_rec OUT Header_Rec_Type
    , x_header_val_rec OUT Header_Val_Rec_Type
    , x_Header_Adj_tbl OUT Header_Adj_Tbl_Type
    , x_Header_Adj_val_tbl OUT Header_Adj_Val_Tbl_Type
    , x_Header_price_Att_tbl OUT Header_Price_Att_Tbl_Type
    , x_Header_Adj_Att_tbl OUT Header_Adj_Att_Tbl_Type
    , x_Header_Adj_Assoc_tbl OUT Header_Adj_Assoc_Tbl_Type
    , x_Header_Scredit_tbl OUT Header_Scredit_Tbl_Type
    , x_Header_Scredit_val_tbl OUT Header_Scredit_Val_Tbl_Type
    , x_line_tbl OUT Line_Tbl_Type
    , x_line_val_tbl OUT Line_Val_Tbl_Type
    , x_Line_Adj_tbl OUT Line_Adj_Tbl_Type
    , x_Line_Adj_val_tbl OUT Line_Adj_Val_Tbl_Type
    , x_Line_price_Att_tbl OUT Line_Price_Att_Tbl_Type
    , x_Line_Adj_Att_tbl OUT Line_Adj_Att_Tbl_Type
    , x_Line_Adj_Assoc_tbl OUT Line_Adj_Assoc_Tbl_Type
    , x_Line_Scredit_tbl OUT Line_Scredit_Tbl_Type
    , x_Line_Scredit_val_tbl OUT Line_Scredit_Val_Tbl_Type
    , x_Lot_Serial_tbl OUT Lot_Serial_Tbl_Type
    , x_Lot_Serial_val_tbl OUT Lot_Serial_Val_Tbl_Type
    , x_action_request_tbl     OUT Request_Tbl_Type
    --For bug 3390458
    , p_rtrim_data IN Varchar2 :='N'
    -- Retrieve messages
    if l_msg_count > 0 then
    for l_index in 1..l_msg_count loop
         l_msg_data := oe_msg_pub.get(p_msg_index => l_index, p_encoded => 'F');
    end loop;
    end if;
    -- Check the return status
    if l_return_status = FND_API.G_RET_STS_SUCCESS then
    DBMS_OUTPUT.put_line ('Return Status =' || l_msg_data ||' Success ');
    else
    DBMS_OUTPUT.put_line ('Return Status =' || l_msg_data ||' Failure ');
    end if;
    exception --@1
    when others then
    fnd_file.put_line(fnd_file.log,' Exception others in main procedure @1
    :'||sqlerrm);
    end tnq_so_import_api;
    Check if you can get any help from this
    *** Regards
    Narender

  • Error - Addition of Batch wise GRPO thru DI API

    Dear All,
    I am facing the error "Can not release the item with selection of Batch/Serial" while adding the GRPO thru DI API.
    When I add only 1 line in GRPO with Batch Details thru coding,GRPO added successfully. But when there are more than 1 line then i get the above mentioned error.
    Edited by: anuj singh on May 7, 2011 11:31 AM

    Please show us your code, it's difficult to know the exact cause without seeing it.

  • Issues in creating the sales order with oe_order_pub.process_order api

    Hi All,
    I am trying to create a sales order with BOOKED status using oe_order_pub.process_order api, and I am getting response as
    <X_RETURN_STATUS>E</X_RETURN_STATUS>
              <X_MSG_COUNT>1</X_MSG_COUNT>
              <X_MSG_DATA>ONTOE_LOCK_ROW_DELETED</X_MSG_DATA>
    Can any one help me in fixing this issue ..!
    Thanks,
    Vamsi…
    Edited by: user11147471 on Jul 9, 2009 2:02 AM

    When using the API, are you trying to create the order as booked using the booked flag or the book action?  I would recommend using the action if you are not. To troubleshoot, I would try the API without booking and then use the following article to determine the issue:
    Unable To Setup A Credit Card Bank Account For The Customer. CC Information On The Order Is Not Valid (Doc ID 1450936.1)

  • How to create the service lines in a sales order using Process_order API

    Hi ,
    I have to create the service lines in a Config to order using process Order API. When i am trying to create a sercvice line , it is comming as new line all together. but i need that one to happen in the configuration itself after the option item but not like standalone line.
    what are the manditory fields for service lines to create using Process_order API.
    Apprciate your help on this.
    Thanks
    Rags

    Moderator message - Please do some analysis before posting here - thread locked
    Rob

  • Process_order API() with bank account process flow in 11i

    Hi all,
    I want to know the basic process flow for customer bank account creation and assignment process. I.e I had pass the customer details ,credit card information throw the oe_order_pub.process_order() API .after this processing this api ,how the bank account creation and updation process works? , and it's process flow.
    process_order API manual process:
    BEGIN
    l_header_rec := OE_ORDER_PUB.G_MISS_HEADER_REC;
    l_header_rec.header_id := '100192';
    l_header_rec.credit_card_holder_name := 'myname';
    l_header_rec.credit_card_number := 'xxxxxxxxxxxxxxxx1111';
    l_header_rec.credit_card_expiration_date := '1-Jan-28';
    l_header_rec.credit_card_code := 'VISA';
    l_header_rec.payment_type_code := 'CREDIT_CARD';
    l_header_rec.sold_to_org_id := '17118';
    l_header_rec.credit_card_approval_code := '34545656676';
    l_header_rec.operation := OE_GLOBALS.G_OPR_UPDATE;
    OE_ORDER_PUB.process_order (p_api_version_number => 1.0
    , p_init_msg_list => fnd_api.g_false
    , p_return_values => fnd_api.g_false
    , p_action_commit => fnd_api.g_false
    , 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
    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_tb
    ............etc );
    END;
    After this api process , how the bank account will update regarding this value.
    Thanks
    prabu

    Hi all,
    I want to know the basic process flow for customer bank account creation and assignment process. I.e I had pass the customer details ,credit card information throw the oe_order_pub.process_order() API .after this processing this api ,how the bank account creation and updation process works? , and it's process flow.
    process_order API manual process:
    BEGIN
    l_header_rec := OE_ORDER_PUB.G_MISS_HEADER_REC;
    l_header_rec.header_id := '100192';
    l_header_rec.credit_card_holder_name := 'myname';
    l_header_rec.credit_card_number := 'xxxxxxxxxxxxxxxx1111';
    l_header_rec.credit_card_expiration_date := '1-Jan-28';
    l_header_rec.credit_card_code := 'VISA';
    l_header_rec.payment_type_code := 'CREDIT_CARD';
    l_header_rec.sold_to_org_id := '17118';
    l_header_rec.credit_card_approval_code := '34545656676';
    l_header_rec.operation := OE_GLOBALS.G_OPR_UPDATE;
    OE_ORDER_PUB.process_order (p_api_version_number => 1.0
    , p_init_msg_list => fnd_api.g_false
    , p_return_values => fnd_api.g_false
    , p_action_commit => fnd_api.g_false
    , 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
    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_tb
    ............etc );
    END;
    After this api process , how the bank account will update regarding this value.
    Thanks
    prabu

  • Last image settings for auto apply adjustments?

    We're testing the watched folder setup for LR3 and it seems to work fairly well.  One very big snag we've come across though is with using auto apply adjustments and the apparent lack of a 'use previous image settings' option.
    We're using DSLR Remote Capture for the live preview functionality using a 7D and have LR set up to watch the Lightroom folder setup by DSLR Remote Catpure.  It would be fantastic if LR would automatically apply the last settings used to the new image file that pops up in the watched folder.  The flow and flexibility this would allow for would be ideal.
    Did I miss this setting somewhere or does anyone know of an easy workaround?  I'd really prefer not to have to save custom presets everytime which is the only workaround I've put into practice so far.  It's a clunky way of doing things and really racks up a whole bunch of presets that are only really relevant to a single shoot.

    carson.jones wrote:
    Lightroom doesn't support Liveview on the Canon's (7D in this case) and many studios and photographers need to use Liveview while working.  This means that tethering directly in to Lightroom is a no-go since Liveview isn't an option.
    The solution to date is to shoot using the Canon software or OnOne's Remote Capture to a target folder on the computer.
    understood.
    Lightroom can be told to watch the folder and import the files as they become available, however LR moves the files and the capture apps are no longer able to see them. 
    Why does the capture app (i.e. EOS Utility) still need to be seeing them?
    Re. the 'last settings used'...
    Let's say you're tethered to an app that is not LR for capture purposes and you're having LR automatically import the captures.  The ideal workflow would be to have LR leave the files in their original location as it can do when not using the watched folder.  When the photographer is on set and captures are coming into LR, they typically will tweek things like colour temp, levels, curves, vignette, etc. in LR.  Each time the photographer takes a new capture, they're forced to copy paste the settings used for the previous capture.  This is extremely annoying and cumbersome.  While lightroom can apply presets to incoming images, it has not allowed for the option to use the last settings from the last imported capture.  Currently we either have to copy/paste settings or save the current settings as a preset and have them applied as new captures come into LR.  Given that we're often tweeking the lighting, focus, etc. each shot, or short series of shots, is often different and applying the custom preset still requires further tweeking in LR.  If everything is aok (lighting, focus, composition, etc.) and we're simply capturing for variations of the subject or talent, it would be incredibly fantastic if LR would simply apply the settings used from the last capture.  I should note that no other raw software out there right now can do this either (C1 Pro for example).
    OK, I can see what you mean now. So more specifically, the setting you'd like to see copied to a new capture is the one from the last imported photo.
    An easy workaround I can suggest is to
    have a named preset called "Last Image"
    always have this preset applied during import
    update the preset values of "Last Image" every time you adjust something on an image
    By doing so, you don't have to manage preset names for different purposes, "Last Image" just contains all the settings from whenever you last chose to update it.
    Beat

  • Reservation with Process_order API

    HI
    When Passing the Reserved_quantity in Process_order API, is there any way to make reservation to particular Warehouse,
    for example i need to reseve quantity in 'WHS'(Subinventory) not on any others,
    i am able to do it using Reservation API, but can i do the same with Process_order
    Thanks
    Edited by: user469514 on Oct 10, 2008 10:32 AM

    If you create the order line with the subinventory and if the item is not serial, lot or revision controlled item then it will reserve automatically at the suinventory level. If the item has any of those controls, obviously you have to use reservation API.
    Thanks
    Nagamohan

  • How to use OE_ORDER_PUB.PROCESS_ORDER API for serial controlled items?

    Hi Guys
    We are using OE_ORDER_PUB.PROCESS_ORDER API with a custom application (R12 12.0.4/12.0.6) for booking sales orders. Right now we don't have serial controlled items, however pretty soon, we will launch medical equipment sales for which we have to start using serial controlled items.
    Anybody has a sample script for the API dealing with serial controlled items?
    Regards,
    Raj

    What kind of serial number related information do you capture during order creation?
    Most businesses either generate serial numbers at the time of Sales order issue OR at wip completion.
    Sometimes a serial number is generated at WIP assembly begin.
    In any case, as long as you don't ALLOCATE serial numbers to a sales order at the time of entry or booking or reservation, you won't need to worry about serial# for oe_order_pub.
    The serial# will come into picture for RMA processing. For that, you can use l_lot_serial_tbl_out oe_order_pub.lot_serial_tbl_type in the oe_order_pub. This will let you record the serial number for the product that is being returned.
    Sandeep Gandhi

  • Apply adjustments for highlights/midtones/shadows to the entire photo?

    Hi,
    I'm wondering whether it is possible to apply adjustments like sharpening, contrast etc. only for highlights (or midtones or shadows) to the entire photo. Applying it with a brush is no problem, but the brush size is limited for that and it's really cumbersome to brush it onto the entire photo.
    I thouhgt it might work to apply the adjustment to a small part of the photo and then invert it, but then it applies it to all shadows, midtones and highlights again.
    Does anyone know an easier way to do that?
    p.

    I do not.  Luminance range auto-masking is available only to brushes.
    I had assumed this limitation was put in place because the performance when applying adjustments to all the pixels that are in a particular luminance range was too slow, but then I realized that Curves and Levels do exactly that.  Perhaps it is because they are limited to the luminance channel.
    You options are few, but not halting.  You can create a brush mask that covers the entire Image.  This is slow and frustrating (computers are un-sweating slaves; you should be able to order "Do this until it's done", where the decision whether or not to proceed is yours, not the application's).  Or you can use an external graphics program such as Photoshop that allows you to create an image mask based on luminance and apply a modification to the pixels that come through the mask.
    Note that for modifications that are based on groups of pixels (such as sharpening), you will have (in theory if not in practice) unintended effects at the edges of the mask.

  • Applying adjustments to multiple photos

    I have about 50 photos that need the same edit adjustments (temperature, contrast, etc.) The copy and paste function is great, but as far as I can tell, it can only be applied to one photos at a time. Is there a way to chose all 50 photos and paste the adjustments in one full swoop?
    If the answer is no, could I do it by accessing the iPhoto Library in Aperture?

    Check out iPhoto Batch Enhancer this might work for you.
    could I do it by accessing the iPhoto Library in Aperture?
    No. Aperture is not an external editor like Photoshop. It just doesn't work that way. It would need to import all the photos into Aperture first. Thereafter they would be inaccessible from iPhoto
    Regards
    TD

Maybe you are looking for

  • InDesign: How can I export indd pages to layered psd files?

    I wish to create layered PSD files from the pages of InDesign marketing brochures so that they may be used as templates in Photoshop by photographers (or whomever) that neither possess nor understand how to use InDesign? I have seen offerings by othe

  • SAPME web service languageCode meaning?

    Dears, I found usually there are some attributes "languageCode" in SAPME web service.  What does it means?  What value I can fill? I posted a example "Start" as below.  How to use it? <me:Activity languageCode="?">?</me:Activity> Thanks! <soapenv:Env

  • Sql help (left outer join)

    Hi All, I am referring 2 regular tables from the HR schema which you get when you install Oracle 9i , Now the issue is that I want all the rows from my employees table even if the row doesnt have the salary equal to 2500. Here is my Sql: select e.emp

  • Help with wifi....PLEASE

    So i have an original iPhone and have been using it. As of recently, however, the wifi circle continuously spins with no networks found. At first, i thought this was a hardware issue, but i tried placing the phone in a freezer and the wifi worked for

  • Outgoing server problem again.

    Hi, I have serious problems as many others. I cant send mail from my Mac. I run 10.8.2 on my MacMini as well as macBook Air. On both I have entourage 2008 from MS. Here is the status: On my iPhone everything is running prefect. In Mac Mail every thin