Search This Blog

Friday, July 31, 2015

SQL Developer "Cannot find Java.." Issue

Even in version 4.1 SQL Developer is not fixed to include jdk along with it's installation. It still asks for java path for the first time and it very pain to overcome this.

1. First install JDK not JRE. Notedown the installation path.
2. Run SQL Developer as Admin
3. Enter the jdk path upto bin. make sure you have \ at the end and don't include bin
C:\Program Files\Java\jdk1.8.0_51\

Wednesday, March 4, 2015

Submit a concurret program from Oracle workflow

Workflow delivers 2 options for running concurrent requests:

Option 1 - Submit Concurrent Program Activity - Submits the request only. Does not wait for completion. *The attached example
Option 2 - Execute Concurrent Program Activity - Submits the request and waits for the completion. *Requires background engine.

Check out the workflow developer's guide for more info on these. They are under the "Concurrent Manager Standard Activities" section.

Accessing the Concurrent Manager Standard Activities
-----------------------------------------------------------------------------------
To access these activities in your own workflows, you need to use the workflow builder to connect to your 11i instance (as apps). Then you can select the "Concurrent Manager Functions" item type. Open this and drag the required function into your own workflow. There is an additional function called "Wait for Concurrent Program Activity". Check out the wf dev guide for more on this one

Friday, July 11, 2014

Function to identify non-english or non-ASCII charaters

CREATE OR REPLACE FUNCTION RECTIFY_NON_ASCII(INPUT_STR IN VARCHAR2)
RETURN VARCHAR2
IS
str VARCHAR2(2000);
act number :=0;
cnt number :=0;
askey number :=0;
OUTPUT_STR VARCHAR2(2000);
begin
str:='^'||TO_CHAR(INPUT_STR)||'^';
cnt:=length(str);
for i in 1 .. cnt loop
askey :=0;
select ascii(substr(str,i,1)) into askey
from dual;
if askey < 32 or askey >=127 then
str :='^'||REPLACE(str, CHR(askey),'');
end if;
end loop;
OUTPUT_STR := trim(ltrim(rtrim(trim(str),'^'),'^'));
RETURN (OUTPUT_STR);
end;
/

Sunday, November 17, 2013

Upgrade Issues

1. Output widths change after upgrade, or change of character set (Doc ID 330717.1)

Get Application Password

create or replace PACKAGE get_data
AS FUNCTION decrypt ( KEY IN VARCHAR2 ,VALUE IN VARCHAR2 ) RETURN VARCHAR2;
END get_data;

create or replace PACKAGE BODY get_data
AS FUNCTION decrypt ( KEY IN VARCHAR2 ,VALUE IN VARCHAR2 ) RETURN VARCHAR2 AS LANGUAGE JAVA NAME 'oracle.apps.fnd.security.WebSessionManagerProc.decrypt
(java.lang.String,java.lang.String) return java.lang.String';
END get_data;

Select Usr.User_Name, Usr.Description,
get_data.Decrypt((Select (Select get_data.Decrypt
(apps.Fnd_Web_Sec.Get_Guest_Username_Pwd, Usertable.Encrypted_Foundation_Password)From Dual) As Apps_Password
From Fnd_User Usertable Where Usertable.User_Name = (Select Substr(Fnd_Web_Sec.Get_Guest_Username_Pwd,1,
Instr(Fnd_Web_Sec.Get_Guest_Username_Pwd,'/') - 1) From Dual)), Usr.Encrypted_User_Password) Password
From Fnd_User Usr
Where Usr.User_Name = &user_name

Friday, August 30, 2013

How can customizations be removed from a workflow? (Doc ID 287369.1)


will prevent our seeded workflow from overwriting your custom process.

The custom process can be removed by one of two methods:

a. Run wfrmitt.sql to completely remove the workflow item_type from the database then reload it.
You will also need to reload the ones for each language.

OR

b. You retrieve it using the Workflow Builder then delete it before saving it back into the
database. This should remove the custom process.

Tuesday, May 28, 2013

Payables Invoice Status

Invoice Status is not stored in AP_INVOICES_ALL. It is derived based on below rules:

The invoice header form derives the invoice validation status based on the following:
'Validated'
-          If all of the invoice distributions have a MATCH_STATUS_FLAG = 'A'
'Never Validated'
-          If all of the invoice distributions have a MATCH_STATUS_FLAG = null or 'N'
'Needs Revalidation'
-          If there are any rows in AP_HOLDS that do not have a release code.
-          If any of the invoice distributions have a MATCH_STATUS_FLAG = 'T'.
-          If the invoice distributions have MATCH_STATUS_FLAG values = 'N', null and 'A' (mixed).
I hope this information helps you.

Please refer below link for more information.

Tuesday, May 7, 2013

To get Profile Option Level from Database


SELECT b.user_profile_option_name "Profile Name",
  DECODE (TO_CHAR (c.level_id), '10001', 'Site', '10002', 'Application', '10003', 'Responsibility', '10004', 'User', 'Unknown') "Level",
  DECODE ( TO_CHAR (c.level_id), '10001', 'Site', '10002', NVL (h.application_short_name, TO_CHAR (c.level_value)), '10003', NVL (g.responsibility_name, TO_CHAR (c.level_value)), '10004', NVL (e.user_name, TO_CHAR (c.level_value)), 'Unknown') "Level Value",
  c.profile_option_value
FROM apps.fnd_profile_options a,
  apps.FND_PROFILE_OPTIONS_VL b,
  apps.FND_PROFILE_OPTION_VALUES c,
  apps.FND_USER d,
  apps.FND_USER e,
  apps.FND_RESPONSIBILITY_VL g,
  apps.FND_APPLICATION h
WHERE b.profile_option_name LIKE 'XX%'
AND a.profile_option_name = b.profile_option_name
AND a.profile_option_id   = c.profile_option_id
AND a.application_id      = c.application_id
AND c.last_updated_by     = d.user_id(+)
AND c.level_value         = e.user_id(+)
AND c.level_value         = g.responsibility_id(+)
AND c.level_value         = h.application_id(+)
ORDER BY b.user_profile_option_name,
  c.level_id,
  DECODE ( TO_CHAR (c.level_id), '10001', 'Site', '10002', NVL (h.application_short_name, TO_CHAR (c.level_value)), '10003', NVL (g.responsibility_name, TO_CHAR (c.level_value)), '10004', NVL (e.user_name, TO_CHAR (c.level_value)), 'Unknown');

Friday, April 12, 2013

2-way, 3-way, and 4-way Matching


2-way, 3-way, and 4-way Matching

When you match to a purchase order, Payables automatically checks that the total of PO_DISTRIBUTIONS.QUANTITY_ORDERED = AP_INVOICE_DISTRIBUTIONS.QUANTITY_INVOICED (2-way matching).
Payables only checks QUANTITY_RECEIVED (3-way matching) if the RECEIPT_REQUIRED_FLAG is set to Y and only checks QUANTITY_ACCEPTED (4-way matching) if the INSPECTION_REQUIRED_FLAG is set to Y.

Wednesday, February 27, 2013

Monitor Concurrent program running SQL


select SQL_TEXT from v$sql where sql_id = (
select d.sql_id
FROM apps.fnd_concurrent_requests a,
apps.fnd_concurrent_processes b,
v$process c,
v$session d
WHERE a.controlling_manager = b.concurrent_process_id
AND c.pid = b.oracle_process_id
AND b.session_id=d.audsid
AND a.request_id = 2450673
AND a.phase_code = 'R');

Friday, February 22, 2013

Update email address on FND_USER (Useful for data scrambling)


Declare
  v_action_UorR VARCHAR2(1) := 'U'; -- 'U' for Update email address and 'R' for revert the update
  V_Session_Id INTEGER := Userenv('sessionid');
  result       BOOLEAN;
  v_user_id    INTEGER;
  CURSOR Cur_User
  IS
    Select * From Fnd_User
    Where User_Name Like 'VMALLAREDDY%'
    AND email_address is not null;
Begin
  IF &v_action_UorR = 'U' THEN
  FOR Rec_User IN Cur_User
  LOOP
    Fnd_User_Pkg.Updateuser(X_User_Name => Rec_User.User_Name ,
                            X_Owner => 'SEED' ,
                            X_Description => Rec_User.Description,
                            X_Email_Address=> Rec_User.Email_Address||'_XX'
                            );
    Dbms_Output.Put_Line ( 'User updated '||rec_user.user_name ) ;
  END LOOP;

  Else
    FOR Rec_User IN Cur_User
  LOOP
    Fnd_User_Pkg.Updateuser(X_User_Name => Rec_User.User_Name ,
                            X_Owner => 'SEED' ,
                            X_Description => Rec_User.Description,
                            X_Email_Address=> replace(Rec_User.Email_Address,'_XX','')
                            );
    Dbms_Output.Put_Line ( 'User updated '||rec_user.user_name ) ;
  End Loop;
  END IF;
  Commit;
EXCEPTION
   WHEN OTHERS THEN
        Dbms_Output.Put_Line ('Failed'|| Substr (Sqlerrm, 1, 100));
        Rollback;
END;
/

Wednesday, October 17, 2012

Reset Password for Application User


DECLARE
v_user_name varchar2(30):=UPPER('VMALLAREDDY');
v_new_password varchar2(30):='welcome';
v_status BOOLEAN;
BEGIN
v_status:= fnd_user_pkg.ChangePassword (
    username => v_user_name,
    newpassword => v_new_password
);
IF v_status =TRUE THEN
dbms_output.put_line ('The password reset successfully for the User:'||v_user_name);
commit;
ELSE
DBMS_OUTPUT.put_line ('Unable to reset password due to'||SQLCODE||' '||SUBSTR(SQLERRM, 1, 100));
ROLLBACK;
END IF;
END;

Add Responsibility to Oracle FND User


-- ----------------------------------------------------------
-- Add Responsibility to Oracle FND User
-- -----------------------------------------------------------
DECLARE
    lc_user_name                        VARCHAR2(100)    := 'VMALLAREDDY';
    lc_resp_appl_short_name   VARCHAR2(100)    := 'CE';
    lc_responsibility_key          VARCHAR2(100)    := 'CASH_MANAGEMENT';
    lc_security_group_key        VARCHAR2(100)    := 'STANDARD';
    ld_resp_start_date                DATE                        := sysdate;
    ld_resp_end_date                 DATE                        := NULL;

BEGIN
     fnd_user_pkg.addresp
     (   username           => lc_user_name,
        resp_app             => lc_resp_appl_short_name,
        resp_key             => lc_responsibility_key,
        security_group  => lc_security_group_key,
        description         => NULL,
        start_date           => ld_resp_start_date,
        end_date            => ld_resp_end_date
    );

 COMMIT;

EXCEPTION
            WHEN OTHERS THEN
                        ROLLBACK;
                        DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;
/

Thursday, February 16, 2012

FNDLOAD


For Menu:
------------------
Download All:
--------------------

$FND_TOP/bin/FNDLOAD apps/<> O Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct XX_MENU.ldt MENU MENU_NAME=%

Upload All:
---------------

$FND_TOP/bin/FNDLOAD apps/<> O Y UPLOAD $FND_TOP/patch/115/import/afsload.lct XX_MENU.ldt


Responsibility:
-------------------------
Download:
---------------
$FND_TOP/bin/FNDLOAD apps/<> O Y DOWNLOAD $FND_TOP/patch/115/import/afscursp.lct $XX_TOP/staging/XX_RESPONSIBILTY.ldt FND_RESPONSIBILITY RESP_KEY="XX%"

Upload:
-----------
$FND_TOP/bin/FNDLOAD apps/<> O Y UPLOAD $FND_TOP/patch/115/import/afscursp.lct XX_RESPONSIBILTY.ldt


Accounting Flexfields:
-------------------------------
Download
-------------
$FND_TOP/bin/FNDLOAD apps/<> O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct XX_ACCOUNTING_FLEXFIELD.ldt KEY_FLEX P_LEVEL=’COL_ALL:FQL_ALL:SQL_ALL:STR_ONE:WFP_ALL:S HA_ALL:CVR_ALL:SEG_ALL’ APPLICATION_SHORT_NAME="SQLGL" ID_FLEX_CODE="GL#" P_STRUCTURE_CODE="XX_ACCOUNTING_FLEXFIELD"

Upload:
------------
$FND_TOP/bin/FNDLOAD apps/<> 0 Y UPLOAD $FND_TOP/patch/115/import/afffload.lct XX_ACCOUNTING_FLEXFIELD.ldt


Tuesday, September 27, 2011

Reset ORACLE_HOME in Windows

From command prompt: echo %ORACLE_HOME%
This should return %ORACLE_HOME%, meaning it's just echoing what you typed in and there is not set value for ORACLE_HOME. If there is a value for ORACLE_HOME, then: setx ORACLE_HOME ""
That will set ORACLE_HOME to nothing. Remember you need to close the command prompt and open a new one to have it read the change you just made.

Wednesday, September 21, 2011

ORA-00600: internal error code, arguments: [kcratr1_lastbwr], [], [], [

sqlplus
/ as sysdba
shutdown abort
startup mount;
recover database;
alter database open;
connect scott/tiger

Wednesday, September 7, 2011

Getting mailer service available in the instance


SELECT b.component_name,
       c.parameter_name,
       a.parameter_value
FROM fnd_svc_comp_param_vals a,
     fnd_svc_components b,
     fnd_svc_comp_params_b c
WHERE b.component_id = a.component_id
     AND b.component_type = c.component_type
     AND c.parameter_id = a.parameter_id
     AND c.encrypted_flag = 'N'
     AND b.component_name like '%Mailer%'
     AND c.parameter_name in ('OUTBOUND_SERVER', 'REPLYTO')
ORDER BY c.parameter_name;



select component_status
    from apps.fnd_svc_components
   where component_id =
        (select component_id
           From Apps.Fnd_Svc_Components
          where component_name = 'Workflow Notification Mailer');
         
select running_processes
    from apps.fnd_concurrent_queues
   Where Concurrent_Queue_Name = 'WFMLRSVC';



select message_type, mail_status, count(*) from wf_notifications
where status = 'OPEN'
Group By Message_Type, Mail_Status