Total Pageviews

Showing posts with label EBS : API : OM. Show all posts
Showing posts with label EBS : API : OM. Show all posts

Sunday, 13 September 2020

EBS: Sales Order Lines Update API in Oracle Apps


--++---------------------------------------------------------

-- Api to Update Sales Order SHIP To

--++---------------------------------------------------------

BEGIN
   l_return_status := NULL;
   l_error_msg := NULL;
   l_line_tbl_index := 1;
   l_header_rec := oe_order_pub.g_miss_header_rec;
   l_header_rec.header_id := p_order_header_id;
   l_header_rec.operation := oe_globals.g_opr_update;
   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_update;
   l_line_tbl (l_line_tbl_index).line_id := p_new_line_id;
   l_line_tbl (l_line_tbl_index).ship_to_org_id := p_ship_to_id;

   BEGIN
      ---------- CALL TO Standard PROCESS ORDER API to Split Order Lines--------------
      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_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                  => 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
                       );
   EXCEPTION
      WHEN OTHERS
      THEN
         DBMS_OUTPUT.put_line
                           (   'Error calling  oe_order_pub.Process_order  :'
                            || l_msg_data
                           );
   END;

   IF l_return_status = fnd_api.g_ret_sts_success
   THEN
      p_return_status := fnd_api.g_ret_sts_success;
      l_error_msg :=
            'Order Line updated Successfully :'
         || x_line_tbl.COUNT
         || ','
         || p_return_status;
      DBMS_OUTPUT.put_line (l_error_msg);
   ELSE
      l_error_msg := 'Order Line updation Failed  :';
      DBMS_OUTPUT.put_line (l_error_msg);

      FOR i IN 1 .. l_msg_count
      LOOP
         oe_msg_pub.get (p_msg_index          => i,
                         p_encoded            => fnd_api.g_false,
                         p_data               => l_msg_data,
                         p_msg_index_out      => l_msg_index_out
                        );
         l_error_msg := CHR (10) || l_error_msg || CHR (10) || ','
                        || l_msg_data;
         DBMS_OUTPUT.put_line (l_error_msg);
      END LOOP;
   END IF;
END;

--=========================================================================
#Sales Order #OM #API #Oracle Apps #EBS #ONT #r12

Sales Order Table

oe_order_headers_all
oe_order_lines_all


FUSION: Purchasing Query

  1) ---------CPA to PO Amount---------- select poh.segment1, (select sum(nvl(cpol.quantity,1)* cpol.unit_price) from po_headers_all cpoh,po...