5 Replies Latest reply: Oct 16, 2013 2:15 PM by EdHayes3 RSS

    Order Line not getting Created

    Aryan_styles
      Hi All,
      My client is on R12.1.3 Version.

      I am trying to create Order through "Order Import" Program and for that i am populating the Header and Line Interface Table as below
      [sourcecode language="sql"]
      INSERT INTO oe_headers_iface_all
      (order_source_id, orig_sys_document_ref, org_id,
      -- order_type,
      order_type_id,
      price_list, transactional_curr_code,
      salesrep, customer_po_number, sold_to_org_id,
      ship_to_org_id,
      -- customer_number,
      created_by,
      creation_date, last_updated_by,
      last_update_date, operation_code, ordered_date
      -- booked_flag
      )
      VALUES (g_num_order_source_id, i.cust_po_number, g_num_org_id,
      --i.order_type,
      1101,
      i.price_list, i.currency_code,
      g_chr_salesrep, i.cust_po_number, 2000,
      NULL,
      -- i.customer,
      i.created_by,
      i.creation_date, i.last_updated_by,
      i.last_update_date, g_chr_ops_code, NULL
      -- g_chr_booked_flag
      );
      INSERT INTO oe_actions_iface_all
      (orig_sys_document_ref,
      order_source_id,
      operation_code,
      request_id
      )
      VALUES (i.cust_po_number,
      g_num_order_source_id,
      'BOOK_ORDER',
      g_num_request_id
      );
      FOR j IN (SELECT ROWNUM row_num, xow.*
      FROM XYZ_TABLE
      WHERE 1 = 1
      AND batch_id = g_num_batch_id
      AND status_code = 'N'
      AND xow.cust_po_number = i.cust_po_number
      AND xow.customer = i.customer)
      LOOP
      INSERT INTO oe_lines_iface_all
      (org_id, line_number, orig_sys_document_ref,
      orig_sys_line_ref, customer_item_name,
      inventory_item, ordered_quantity,
      order_source_id, price_list, sold_to_org,
      ship_to_org, salesrep, unit_selling_price,
      promise_date, schedule_arrival_date,
      created_by, creation_date, last_updated_by,
      last_update_date, operation_code, request_date,
      schedule_date
      --
      ,SHIP_FROM_ORG_ID
      ,INVOICE_TO_ORG_ID
      ,order_quantity_uom
      ,LINE_TYPE_ID
      --
      )
      VALUES (g_num_org_id, j.row_num, i.cust_po_number,
      i.cust_po_number || j.row_num, j.customer_item,
      j.inv_item_number, j.ordered_quantity,
      g_num_order_source_id, j.price_list, j.customer,
      j.ship_to_location, g_chr_salesrep, j.unit_price,
      j.planned_date, j.need_by_date,
      j.created_by, j.creation_date, j.last_updated_by,
      j.last_update_date, g_chr_ops_code, j.need_by_date,
      j.need_by_date
      --
      ,100
      ,1100
      ,'Ea'
      ,1111
      --
      );
      [sourcecode]

      After this i am calling "Order Import" Program. This program is creating the Order in Booked Status but it is not creating Line.
      Kindly help me on this, as i searched metalink, forums, tried different combination but not getting any success in creating order with Success.

      Regards
      Aryan