Total Pageviews

Monday, 12 October 2020

PLSQL: CONTEXT

 -------set context---

EXEC XX_OM_CTX_SET_PKG.pr_set_sun_ctx('P_CUST_GRP_ACC_NUM','415');


EXEC XX_OM_CTX_SET_PKG.pr_set_sun_ctx('P_CUST_ACC_NUM','430');


----retrive context value---------

SELECT SYS_CONTEXT('XX_OM_CTX_CON','P_CUSTOMER_ID')

FROM   dual;


---how to create syntax

CREATE OR REPLACE CONTEXT XX_OM_CTX_CON

 USING APPS.XX_OM_CTX_SET_PKG;


CREATE OR REPLACE PACKAGE BODY APPS.xx_om_ctx_set_pkg

AS

   PROCEDURE pr_set_sun_ctx (p_attrib varchar2, p_value varchar2)

   IS

   BEGIN

      DBMS_SESSION.set_context ('XX_OM_CTX_CON', p_attrib, p_value);

   END pr_set_sun_ctx;


   PROCEDURE pr_clear_sun_ctx (p_attrib varchar2)

   IS

   BEGIN

      DBMS_SESSION.clear_context ('XX_OM_CTX_CON', p_attrib);

   END pr_clear_sun_ctx;

END xx_om_ctx_set_pkg;

/

Friday, 25 September 2020

FND: Profile Option Value updation using API

 Declare

Result Boolean;

BEGIN

   Result:= fnd_profile.SAVE ('XX_OTC_ROLE_PF' , null, 'USER',1677);

   IF Result

   THEN

      DBMS_OUTPUT.put_line ('Profile Updated');

   ELSE

      DBMS_OUTPUT.put_line ('Profile Not Updated');

   END IF;

   COMMIT;

END;

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...