1 Reply Latest reply: Jan 26, 2013 9:17 AM by 986840 RSS

    BPA PRICE BREAK UPDATE

    986840
      Hi There,

      Greetings !!

      We are updating "BPA Price Breaks" as per an article
      http://erpschools.com/articles/importing-blanket-purchase-agreementsbpa-2

      We are successfully, create new price breaks however when we try to update existing price break through interface pgm
      We are facing issues.
      Error Message: Enter unique shipment num 2 already existing.

      We are using below header and line insert statements, from front end we are able to update it however from interface pgm it’s throwing up error.

      Could you pls. provide some pointers regarding this.

      BEGIN
      INSERT INTO po_headers_interface
      (interface_header_id,
      action,
      org_id,
      document_type_code,
      document_num,
      po_header_id,
      vendor_id,
      approval_status,
      created_by,
      creation_date,
      request_id,
      last_updated_by,
      last_update_date,
      last_update_login)
      VALUES(
      l_num_interface_header_id,
      'UPDATE',
      rec_header.org_id,
      'BLANKET',
      rec_header.document_num,
      rec_header.po_header_id,
      rec_header.vendor_id,
      'APPROVED',
      g_num_user_id,
      SYSDATE,
      l_num_req_id,
      g_num_user_id,
      SYSDATE,
      g_num_login_id
      );
      EXCEPTION
      WHEN OTHERS THEN
      Fnd_File.put_line(Fnd_File.LOG,'Error while inserting into PO_HEADERS_INTERFACE'||SQLERRM);
      RAISE l_exc_prog_exit;
      END;

      FOR rec_lines IN
      cur_get_po_lines (rec_header.document_num)
      LOOP

      BEGIN

      INSERT INTO po_lines_interface
      (interface_line_id,
      interface_header_id,
      action,
      line_num,
      item_id,
      unit_price,
      expiration_date,
      effective_date,
      po_line_id,
      po_header_id,
      po_release_id,
      shipment_num,
      line_location_id,
      release_num,
      created_by,
      creation_date,
      request_id,
      last_updated_by,
      last_update_date,
      last_update_login)
      VALUES (
      PO_LINES_INTERFACE_S.NEXTVAL,
      l_num_interface_header_id,
      'UPDATE',
      rec_lines.line_num,
      rec_lines.item_id,
      rec_lines.unit_price,
      rec_lines.l_expiration_date,
      rec_lines.l_effective_date,
      rec_lines.po_line_id,
      rec_lines.po_header_id,
      rec_lines.po_release_id,
      rec_lines.shipment_num,
      rec_lines.line_location_id,
      rec_lines.release_num,
      g_num_user_id,
      SYSDATE,
      l_num_req_id,
      g_num_user_id,
      SYSDATE,
      g_num_login_id);

      EXCEPTION
      WHEN OTHERS THEN
      Fnd_File.put_line(Fnd_File.LOG,'Error while inserting into PO_LINES_INTERFACE'||SQLERRM);
      RAISE l_exc_prog_exit;
      END;