Friday, December 26, 2014

Script to change the oracle apps front end password.

Script to change the oracle apps front end password.



set serveroutput on;
DECLARE
   v_pwd                         VARCHAR2 (40);
BEGIN
   v_pwd := fnd_web_sec.change_password (p_user =>         'SANGU'
                                                                       ,p_new_pwd =>      'welcome123'
                                                                       );
   DBMS_OUTPUT.put_line ('pwd ' || v_pwd);

   IF (v_pwd = 'N') THEN
      DBMS_OUTPUT.put_line ('New Password Change' || ': ' || fnd_message.get
                                                                             ());
   END IF;
END;

/

Monday, June 2, 2014

Oracle FNDLOAD Commands (LDT commands)

Oracle FNDLOAD Commands (LDT commands)

1. Lookups

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/aflvmlu.lct XX_CUSTOM_LKP.ldt FND_LOOKUP_TYPE APPLICATION_SHORT_NAME="XXCUST" LOOKUP_TYPE="XX_LOOKUP_TYPE"

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/aflvmlu.lct XX_CUSTOM_LKP.ldt

 2. Concurrent Program

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct XX_CUSTOM_CP.ldt PROGRAM APPLICATION_SHORT_NAME="XXCUST" CONCURRENT_PROGRAM_NAME="XX_CONCURRENT_PROGRAM"

FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct XX_CUSTOM_CP.ldt

3. Profile

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afscprof.lct XX_CUSTOM_PRF.ldt PROFILE PROFILE_NAME="XX_PROFILE_NAME" APPLICATION_SHORT_NAME="XXCUST"

FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afscprof.lct XX_CUSTOM_PRF.ldt 

4. Request Set and Link

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct XX_CUSTOM_RS.ldt REQ_SET REQUEST_SET_NAME='REQUEST_SET_NAME'

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afcprset.lct  XX_CUSTOM_RS.ldt 

5. FND Message

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afmdmsg.lct XX_CUSTOM_MESG.ldt FND_NEW_MESSAGES APPLICATION_SHORT_NAME="XXCUST" MESSAGE_NAME="MESSAGE_NAME%"

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afmdmsg.lct XX_CUSTOM_MESG.ldt 

6. D2K FORMS

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct XX_CUSTOM_FRM.ldt FORM FORM_NAME="FORM_NAME"
      
FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afsload.lct XX_CUSTOM_FRM.ldt 

7. Form Function

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct XX_CUSTOM_FUNC.ldt FUNCTION FUNCTION_NAME="FORM_FUNCTION_NAME"

FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afsload.lct XX_CUSTOM_FUNC.ldt 

8. Menu

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct XXCUST_MENU.ldt MENU MENU_NAME="XXCUST_MENU"

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afsload.lct XXCUST_MENU.ldt

9. Alerts

FNDLOAD apps/apps 0 Y DOWNLOAD $ALR_TOP/patch/115/import/alr.lct XX_CUSTOM_ALR.ldt ALR_ALERTS APPLICATION_SHORT_NAME=XXCUST 
ALERT_NAME="XX - Alert Name"

FNDLOAD apps/apps 0 Y UPLOAD $ALR_TOP/patch/115/import/alr.lct XX_CUSTOM_ALR.ldt 

10. Value Set

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct XX_CUSTOM_VS.ldt VALUE_SET FLEX_VALUE_SET_NAME="XX Value Set Name"



FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afffload.lct XX_CUSTOM_VS.ldt  

Sunday, June 1, 2014

FND_GLOBAL.APPS_INITIALIZE in Oracle Apps R12

FND_GLOBAL.APPS_INITIALIZE in Oracle Apps R12


FND_GLOBAL.APPS_INITIALIZE is used for initializing the session before calling any public or private API's in Oracle Ebusiness suite. Its not required for all the API's but its recommended that you set this profile before making any calls to either private or public API. 


fnd_global.APPS_INITIALIZE(user_id=>l_user_id,
                                            resp_id=>l_resp_id,
                                            resp_appl_id=>l_resp_appl_id);


l_user_id is the fnd user ID.
l_resp_id is the responsibility ID
l_resp_appl_id is the responsibility application ID.


Query to get the user id, responsibility id and responsibility application id.

select fnd.user_id ,
       fresp.responsibility_id,
       fresp.application_id
from   fnd_user fnd
,      fnd_responsibility_tl fresp
where  fnd.user_name = 'SSPATIL'
and    fresp.responsibility_name = 'Order Management Super User';


or

fnd_global.apps_initialize( user_id => FND_GLOBAL.USER_ID,
                                            resp_id => FND_GLOBAL.RESP_ID,
                                            resp_appl_id => FND_GLOBAL.RESP_APPL_ID);

Monday, May 5, 2014

How to Get the Active sessions of database in SQL Developer


How to Get the Active sessions of database in SQL Developer

Steps to get the active sessions.

1) Connect to the server through SQL Developer.
2) Click on ‘View’ menu.
3) Select Reports.
4) Open Data Dictionary Reports.
5) Open Database Administration.
6) Open Session.
7) Double-Click on Active Sessions.

Now you will get the list of all active sessions.

           

Sunday, May 4, 2014

Steps for Moving the Function from one Responsibility to another.



Steps for Moving the Function from one Responsibility to another.

Step1:-Go to the responsibility where your function is there.
                For ex:- SYN US OM SUPER USER.

           

Step2:-Note down the menu attached to that Responsibility.
                Navigation:-System Administrator-- >Security-- >Responsibility-- >Define.



Step3:-Go to that menu and remove the function from there.
                Navigation:-Application Developer-- >Application-- >Menu



Step4:-Go to the responsibility where u want to put the function.
                Suppose if u want to put this function in SYN US Purchasing
               

Step5:- Note down the menu attached to that Responsibility.


Step6:-Go to the menu and attach the function to that.



Now the function is successfully attached to the new responsibility.

Saturday, May 3, 2014

OE_ORDER_PUB.PROCESS_ORDER (Script for Updating Sales Order)

OE_ORDER_PUB.PROCESS_ORDER (Script for Updating Sales Order)

Below is the sample script to update the promise_date of sales order lines.


 set serveroutput on
DECLARE
            l_error             VARCHAR2 (1000);     
            PRAGMA AUTONOMOUS_TRANSACTION;
            line_id NUMBER;
            l_count NUMBER := 0;
            ----for API
            l_archive_file_name VARCHAR2(1000);
            l_shipment_exists NUMBER:=0;
            l_header_id NUMBER;
            l_line_id NUMBER;
            p_header_rec Oe_Order_Pub.Header_Rec_Type;
            l_line_tbl oe_order_pub.line_tbl_type := oe_order_pub.g_miss_line_tbl;
            l_header_rec OE_ORDER_PUB.Header_Rec_Type;
            l_header_val_out_rec OE_ORDER_PUB.Header_Val_Rec_Type;
            l_header_adj_out_tbl OE_Order_PUB.Header_Adj_Tbl_Type;
            l_header_adj_val_out_tbl OE_Order_PUB.Header_Adj_Val_Tbl_Type;
            l_header_price_att_out_tbl OE_ORDER_PUB.Header_Price_Att_Tbl_Type;
            l_header_adj_att_out_tbl OE_ORDER_PUB.Header_Adj_Att_Tbl_Type;
            l_header_adj_assoc_out_tbl OE_ORDER_PUB.Header_Adj_Assoc_Tbl_Type;
            l_header_scredit_out_tbl OE_Order_PUB.Header_Scredit_Tbl_Type;
            l_header_scredit_val_out_tbl OE_Order_PUB.Header_Scredit_Val_Tbl_Type;
            l_line_rec OE_ORDER_PUB.line_rec_type;
           
            l_line_out_tbl OE_ORDER_PUB.Line_Tbl_Type;
            l_line_val_out_tbl OE_ORDER_PUB.Line_Val_Tbl_Type;
            l_line_adj_out_tbl OE_ORDER_PUB.Line_Adj_Tbl_Type;
            l_line_adj_val_out_tbl OE_ORDER_PUB.Line_Adj_Val_Tbl_Type;
            l_line_price_att_out_tbl OE_ORDER_PUB.Line_Price_Att_Tbl_Type;
            l_line_adj_att_out_tbl OE_ORDER_PUB.Line_Adj_Att_Tbl_Type;
            l_line_adj_assoc_out_tbl OE_ORDER_PUB.Line_Adj_Assoc_Tbl_Type;
            l_line_scredit_out_tbl OE_Order_PUB.Line_Scredit_Tbl_Type;
            l_line_scredit_val_out_tbl OE_Order_PUB.Line_Scredit_Val_Tbl_Type;
            l_lot_serial_out_tbl OE_Order_PUB.Lot_Serial_Tbl_Type;
            l_lot_serial_val_out_tbl OE_Order_PUB.Lot_Serial_Val_Tbl_Type;
            l_action_request_out_tbl OE_Order_PUB.Request_Tbl_Type;
            l_msg_count NUMBER;
            l_msg_data VARCHAR2(2000);
            l_return_status VARCHAR2(1);
            l_index NUMBER;
            l_rows_processed NUMBER:=0;
            l_line_mawb VARCHAR2(240);
            l_line_hawb VARCHAR2(240);
            l_line_flight_num VARCHAR2(240);
            l_org_id NUMBER :=FND_GLOBAL.ORG_ID;
            l_resp_id NUMBER:=FND_GLOBAL.RESP_ID;
            l_resp_appl_id NUMBER:=FND_GLOBAL.RESP_APPL_ID;
            l_user_id number := FND_GLOBAL.USER_ID;
            l_promise_date date;
            v_line_count number:=0;
            x_debug_file                   VARCHAR2 (100);
            g_error_message VARCHAR2(2000):= null;
            i number:=0;

BEGIN
          dbms_output.enable(1000000);
          fnd_global.apps_initialize(1318,21623,660); -- pass in user_id, responsibility_id, and application_id
          p_header_rec := OE_ORDER_PUB.G_MISS_HEADER_REC;
          p_header_rec.header_id := l_header_id;
          l_line_tbl := oe_order_pub.g_miss_line_tbl;



            l_line_tbl(i) := oe_order_pub.g_miss_line_rec;
            l_line_tbl(i).header_id := l_header_id;
            l_line_tbl(i).line_id := l_line_id;
            l_line_tbl(i).promise_date := sysdate;     --l_promise_date;
            l_line_tbl(i).operation := oe_globals.g_opr_update;


-- CALL TO PROCESS ORDER
            BEGIN
                        x_debug_file := oe_debug_pub.set_debug_mode ('FILE');
                        oe_debug_pub.setdebuglevel (5);
                        apps.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_false
                                                       ,x_return_status => l_return_status
                                                       ,x_msg_count => l_msg_count
                                                       ,x_msg_data => l_msg_data
                                                       ,p_header_rec => p_header_rec
                                                       ,p_line_tbl => l_line_tbl
                                                       -- out variables
                                                       ,x_header_rec => l_header_rec
                                                       ,x_header_val_rec => l_header_val_out_rec
                                                       ,x_header_adj_tbl => l_header_adj_out_tbl
                                                       ,x_header_adj_val_tbl => l_header_adj_val_out_tbl
                                                       ,x_header_price_att_tbl => l_header_price_att_out_tbl
                                                       ,x_header_adj_att_tbl => l_header_adj_att_out_tbl
                                                       ,x_header_adj_assoc_tbl => l_header_adj_assoc_out_tbl
                                                       ,x_header_scredit_tbl => l_header_scredit_out_tbl
                                                       ,x_header_scredit_val_tbl => l_header_scredit_val_out_tbl
                                                       ,x_line_tbl => l_line_out_tbl
                                                       ,x_line_val_tbl => l_line_val_out_tbl
                                                       ,x_line_adj_tbl => l_line_adj_out_tbl
                                                       ,x_line_adj_val_tbl => l_line_adj_val_out_tbl
                                                       ,x_line_price_att_tbl => l_line_price_att_out_tbl
                                                       ,x_line_adj_att_tbl => l_line_adj_att_out_tbl
                                                       ,x_line_adj_assoc_tbl => l_line_adj_assoc_out_tbl
                                                       ,x_line_scredit_tbl => l_line_scredit_out_tbl
                                                       ,x_line_scredit_val_tbl => l_line_scredit_val_out_tbl
                                                      ,x_lot_serial_tbl => l_lot_serial_out_tbl
                                                      ,x_lot_serial_val_tbl => l_lot_serial_val_out_tbl
                                                      ,x_action_request_tbl => l_action_request_out_tbl
                                                       );
        
                                                      g_error_message:='Error in API --->'||SQLERRM;
       
             EXCEPTION when others then
                    g_error_message:='Exception inside order api-'||SQLERRM;
                    null;
            END;

             -- Retrieve messages
            IF l_return_status <> fnd_api.g_ret_sts_success THEN
                ROLLBACK;
                g_error_message:=g_error_message||'Error updating SO line attributes-';
            END IF;

 EXCEPTION     
      WHEN OTHERS
      THEN
         g_error_message := 'Error in process order api' || SQLERRM;
         p_error := g_error_message;
 END;
/

Commit;