Monday, 7 September 2020

Manual Testing Overview

Manual Testing Overview


What is Testing?

What is Testing Types?

What are Verification and Validation?

What is a Linear Model for Testing?

- What is the waterfall model
- What is the V Model
What is the Dynamic Model for Testing? <Mostly for Big Size Projects by creating multiple sections>
- RAD<Rapid Application Development> Model
- Prototype Model
- Spiral Model
- Agile Model



Software Development/Testing Models


Which model to be used for testing small projects, where 100% quality is required?

V-Model is used


Which model to be used for testing for small-size projects with Step-by-Step requirement?

Waterfall model


Which model to be used for testing for Big Size projects within a small/limited time?

RAD Model


Which model to be used for testing an online portal, where requirements are unknown or constantly changing

Spiral Model

Wednesday, 2 September 2020

One Sample to write Standardized and awesome Code for oracle Apps EBS


We all write packages with different structures and formats based on the different guidelines provided by the organizations or projects.


I have tried to formalize one way of writing, which can be edited for your standard. 

Hope this helps you to give you a little booster to start your code


CREATE OR REPLACE PACKAGE XXCUST_AP_PKG IS
------------------------------------------------------------------------------------
-- * PL/SQL PACKAGE    :  XXCUST_AP_PKG                                              
-- * DATE              :  01-Jan-2020                                                
-- * PURPOSE           :  <Program Information - Project Request Reference>          
--*  XXAPCUSTPROG      :  <Concurrent Programs  Information 
------------------------------------------------------------------------------------
-- * VERSION     DD-MON-YYYY     PERSON             CHANGES MADE                  
-- * ----------  -------------   -------------      --------------------------------
-- * 1.0         01-Jan-2020     Developer          Initiated                       
-- ---------------------------------------------------------------------------------


    ---------------------------------------------------------------------------------
    --XXAPCUSTPROG--<Program Name>
    --PROCEDURE main Parameters
    --p_inv_create_dt_from varchar2 --FND_DATE_STANDARD -- Invoice Creation Date From
    --p_inv_create_dt_to   varchar2 --FND_DATE_STANDARD -- Invoice Creation Date To
    --p_org_id             number   --XX_ORG_ID_VS      -- Organization Name
    --p_vendor_ID          varchar2 --XXAP_VENDOR_NAME  -- Vendor Name
    --p_vendoe_site_code   varchar2 --XXAP_AP_VENDOR_SITE  -- Vendor Site Code
    --p_invoice_num        varchar2 --XXAP Invoice Numbers -- Invoice Number
    --p_print_log          varchar2 DEFAULT 'Y'
    ---------------------------------------------------------------------------------
    PROCEDURE main ( p_err_buff       out varchar2
                   , p_err_code       out varchar2
                   , p_inv_create_dt_from varchar2
                   , p_inv_create_dt_to   varchar2
                   , p_org_id             number  
                   , p_vendor_ID          varchar2
                   , p_vendoe_site_code   varchar2
                   , p_invoice_num        varchar2
                   , p_print_log          varchar2 DEFAULT 'Y'
                   );

END XXCUST_AP_PKG;




CREATE OR REPLACE PACKAGE BODY XXCUST_AP_PKG IS
------------------------------------------------------------------------------------
-- * PL/SQL PACKAGE    :  XXCUST_AP_PKG                                              
-- * DATE              :  01-Jan-2020                                                
-- * PURPOSE           :  <Program Information - Project Request Reference>          
--*  XXAPCUSTPROG      :  <Concurrent Programs  Information 
------------------------------------------------------------------------------------
-- * VERSION     DD-MON-YYYY     PERSON             CHANGES MADE                  
-- * ----------  -------------   -------------      --------------------------------
-- * 1.0         01-Jan-2020     Developer          Initiated                       
-- ---------------------------------------------------------------------------------
 gp_print_log     VARCHAR2(10) := 'Y';
 gp_delimiter     CHAR(1)      := '~';
 ------------------------------------
 procedure write_log(p_str varchar2) IS
 BEGIN
    IF gp_print_log = 'Y'  THEN
       fnd_file.put_line(fnd_file.log,to_char(sysdate,'HH24:MI:SS')||':'||p_str);
       dbms_output.put_line(to_char(sysdate,'HH24:MI:SS')||':'||p_str);
    END IF;   
 end write_log;     

 procedure write_msg(p_str varchar2) IS
 BEGIN
    fnd_file.put_line(fnd_file.log,to_char(sysdate,'HH24:MI:SS')||':'||p_str);
 end write_msg;    

 procedure write_out(p_str varchar2) IS
 BEGIN
    fnd_file.put_line(fnd_file.output,p_str);
 end write_out;   
------------------------------------------------------------------------------------
--XXAPCUSTPROG--<Program Name>
--Parameters
--p_inv_create_dt_from varchar2 --FND_DATE_STANDARD    -- Invoice Creation Date From
--p_inv_create_dt_to   varchar2 --FND_DATE_STANDARD    -- Invoice Creation Date To
--p_org_id             number   --XX_ORG_ID_VS         -- Organization Name
--p_vendor_ID          varchar2 --XXAP_VENDOR_NAME     -- Vendor Name
--p_vendoe_site_code   varchar2 --XXAP_AP_VENDOR_SITE  -- Vendor Site Code
--p_invoice_num        varchar2 --XXAP Invoice Numbers -- Invoice Number
--p_print_log          varchar2 DEFAULT 'Y'
------------------------------------------------------------------------------------
 PROCEDURE main ( p_err_buff       out varchar2
                , p_err_code       out varchar2
                , p_inv_create_dt_from varchar2 
                , p_inv_create_dt_to   varchar2 
                , p_org_id             number   
                , p_vendor_ID          varchar2 
                , p_vendoe_site_code   varchar2 
                , p_invoice_num        varchar2 
                , p_print_log          varchar2 DEFAULT 'Y'
                ) IS
  CURSOR cur_inv is 
  SELECT '1' invoice_num from DUAL;
  --
  l_inv_rec_count     NUMBER := 0;
  l_inv_rec_psd_count NUMBER := 0;
  l_inv_rec_err_count NUMBER := 0;
  l_interface_line_id NUMBER;
  l_line_status       BOOLEAN;
  l_err_msg           VARCHAR2(4000);
 BEGIN
    write_msg('Program Starts');
    gp_print_log := p_print_log;

    FOR rec_inv in cur_inv LOOP
    BEGIN
      l_inv_rec_count := l_inv_rec_count + 1;
      write_out( l_inv_rec_count || '::' || rec_inv.invoice_num);
      l_interface_line_id:=XXAP_CUST_TBL_S.nextval;
  --
      insert into XXAP_CUST_TBL(interface_line_id,status) 
  values (l_interface_line_id, 'NEW');
      l_inv_rec_psd_count := l_inv_rec_psd_count + 1;          
      --
    EXCEPTION WHEN OTHERS THEN
      l_inv_rec_err_count := l_inv_rec_err_count + 1;
      write_out( l_inv_rec_count || '::' || rec_inv.invoice_num || ' :: Error');
    END;
    END LOOP;
    write_out('Invoice Total Count ::'||l_inv_rec_count);
    write_out('Invoice Processed Count ::'||l_inv_rec_psd_count);
    write_out('Invoice Error Count ::'||l_inv_rec_err_count);
    write_msg('Program Ends');  
 EXCEPTION WHEN OTHERS THEN
    write_out('Error ::'||SQLERRM);
    write_out('Invoice Total Count <when error occured>::'||l_inv_rec_count);
    write_out('Invoice Processed Count <when error occured>::'||l_inv_rec_psd_count);
    write_out('Invoice Error Count <when error occured>::'||l_inv_rec_err_count);
write_msg('Error ::'||SQLERRM);
    write_msg('Program Ends with Error');  
 END main;

END XXCUST_AP_PKG;

Friday, 28 August 2020

Oracle EBS - Script to reset password and assign required responsibilities

 This is very helpful when instances are cloned and we need to reset the password of any existing user for testing in a test instance. 


Of course, this can't be done by anybody unless specific rights are not allocated. 


SET serveroutput ON;
DECLARE
  v_user_name    VARCHAR2(30):= UPPER('SYSADMIN');v_new_password VARCHAR2(30):= 'welcome1';v_add_resp  VARCHAR2(5):='Y';
   v_status       BOOLEAN;
procedure Add_responsibility(p_user_name varchar2,p_responsibility_name varchar2) is
   v_user_name             VARCHAR2 (30)  := p_user_name;
   v_responsibility_name   VARCHAR2 (100) := p_responsibility_name;
   v_application_name      VARCHAR2 (100) := NULL;
   v_responsibility_key    VARCHAR2 (100) := NULL;
   v_security_group        VARCHAR2 (100) := NULL;
   v_description           VARCHAR2 (100) := NULL;
BEGIN
   SELECT fa.application_short_name, fr.responsibility_key,
          fsg.security_group_key, frt.description
     INTO v_application_name, v_responsibility_key,
          v_security_group, v_description
     FROM apps.fnd_responsibility fr,
          fnd_application fa,
          fnd_security_groups fsg,
          fnd_responsibility_tl frt
    WHERE frt.responsibility_name = v_responsibility_name
      AND frt.LANGUAGE = USERENV ('LANG')
      AND frt.responsibility_id = fr.responsibility_id
      AND fr.application_id = fa.application_id
      AND fr.data_group_id = fsg.security_group_id
  AND rownum<=1;
   fnd_user_pkg.addresp (username            => v_user_name,
                         resp_app            => v_application_name,
                         resp_key            => v_responsibility_key,
                         security_group      => v_security_group,
                         description         => v_description,
                         start_date          => SYSDATE,
                         end_date            => NULL
                        );
   COMMIT;
   DBMS_OUTPUT.put_line ('Responsiblity '                         || v_responsibility_name|| ' is attached to the user '|| v_user_name || ' Successfully');
EXCEPTION WHEN OTHERS THEN
      DBMS_OUTPUT.put_line('Unable to attach responsibility to user due to'|| SQLCODE|| ' ' || SUBSTR (SQLERRM, 1, 250));
END; 
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;
  --- 
  IF v_add_resp = 'Y' THEN
     Add_responsibility(p_user_name => v_user_name,p_responsibility_name => 'Functional Administrator');
     Add_responsibility(p_user_name => v_user_name,p_responsibility_name => 'XML Publisher Administrator');
     Add_responsibility(p_user_name => v_user_name,p_responsibility_name => 'Application Developer');
     Add_responsibility(p_user_name => v_user_name,p_responsibility_name => 'Workflow Administrator');   
     Add_responsibility(p_user_name => v_user_name,p_responsibility_name => 'System Administrator');
     Add_responsibility(p_user_name => v_user_name,p_responsibility_name => 'Alert Manager');
     Add_responsibility(p_user_name => v_user_name,p_responsibility_name => 'Desktop Integration Manager');
  END If;
END;

Thursday, 27 August 2020

Query to Extract Vacation Rules with Basic Employee Information

 SELECT papf_f.full_name from_user_name, RoutingRulesEO.ROLE from_user_id
    , ppos_f.name From_User_Function_Deptt, pjobs_f.name From_User_Designation, pgrade_f.name From_User_Band
    ,  papf_t.full_name to_user_name,RoutingRulesEO.ACTION_ARGUMENT to_user_id
    , ppos_t.name to_User_Function_Deptt, pjobs_t.name to_User_Designation, pgrade_t.name to_User_Band
    , LookupsEO.MEANING Action
    , nvl(ItemTypesEO.DISPLAY_NAME,'All')  Workflow_Name 
    , RoutingRulesEO.MESSAGE_TYPE, RoutingRulesEO.MESSAGE_NAME
    , to_char(RoutingRulesEO.begin_date, 'DD-MON-YYYY HH24:MI:SS') begin_date
    , to_char(RoutingRulesEO.end_date, 'DD-MON-YYYY HH24:MI:SS') end_date
    , trunc(nvl(RoutingRulesEO.end_date,sysdate+1000) - RoutingRulesEO.begin_date) no_of_days_for_rule
    , RoutingRulesEO.Rule_Comment
  FROM WF_ROUTING_RULES RoutingRulesEO, WF_ITEM_TYPES_VL ItemTypesEO, WF_MESSAGES_VL MessagesEO, WF_LOOKUPS LookupsEO
      ,fnd_user user_f, fnd_user user_t
      , per_all_people_f papf_f, per_all_people_f papf_T
      , per_all_assignments_f paaf_f, per_jobs pjobs_f,per_all_positions ppos_f, per_grades_tl pgrade_f
      , per_all_assignments_f paaf_t, per_jobs pjobs_t,per_all_positions ppos_t, per_grades_tl pgrade_t
 WHERE 1=1--RoutingRulesEO.ROLE = :1 
   and RoutingRulesEO.MESSAGE_TYPE = ItemTypesEO.NAME (+) and RoutingRulesEO.MESSAGE_TYPE = MessagesEO.TYPE (+) 
   and RoutingRulesEO.MESSAGE_NAME = MessagesEO.NAME (+) and RoutingRulesEO.ACTION = LookupsEO.LOOKUP_CODE 
   and LookupsEO.LOOKUP_TYPE = 'WFSTD_ROUTING_ACTIONS' 
   and sysdate between RoutingRulesEO.begin_date and RoutingRulesEO.end_date
   and nvl(RoutingRulesEO.end_date,sysdate+1000) - RoutingRulesEO.begin_date >= 15/*Rule applied for more than number of Days*/
   and RoutingRulesEO.ROLE = user_f.user_name
   and user_f.employee_id = papf_f.person_id
   --
   AND paaf_f.person_id(+) = papf_f.person_id
   --and papf_f.employee_number is not null
   AND pjobs_f.job_id(+) = paaf_f.job_id
   and nvl(paaf_f.primary_flag,'Y') = 'Y'
   AND pgrade_f.grade_id(+) = paaf_f.grade_id
   AND ppos_f.position_id(+) = paaf_f.position_id
   and sysdate between paaf_f.effective_start_date and paaf_f.effective_end_date
   --
   and sysdate between papf_f.effective_start_date and papf_f.effective_end_date
   and RoutingRulesEO.ACTION_ARGUMENT = user_t.user_name(+)   
   and user_t.employee_id = papf_t.person_id(+)
   and papf_t.effective_start_date(+)<= sysdate 
   and papf_t.effective_end_date (+) >= sysdate   
   --
   AND paaf_t.person_id(+) = papf_t.person_id
   --and papf_t.employee_number(+) is not null
   AND pjobs_t.job_id(+) = paaf_t.job_id
   and nvl(paaf_t.primary_flag(+),'Y') = 'Y'
   AND pgrade_t.grade_id(+) = paaf_t.grade_id
   AND ppos_t.position_id(+) = paaf_t.position_id
   and paaf_t.effective_start_date (+) <= sysdate
   and paaf_t.effective_end_date(+) >= sysdate
   --
 ORDER BY RoutingRulesEO.ROLE,RoutingRulesEO.ACTION_ARGUMENT,nvl(ItemTypesEO.DISPLAY_NAME,'All'),RoutingRulesEO.ACTION_ARGUMENT;

Tuesday, 25 August 2020

FNDLOAD for AME Setup migration

 select * from AME_CALLING_APPS where transaction_type_id like 'APINV' and sysdate between start_date and end_date;


--Download


FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesconk.lct APINVamecondition.ldt AME_CONDITIONS TRANSACTION_TYPE_ID='APINV' APPLICATION_SHORT_NAME='SQLAP'

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesappg.lct APINVameapprovalgroup.ldt AME_APPROVAL_GROUPS TRANSACTION_TYPE_ID='APINV' APPLICATION_SHORT_NAME='SQLAP'

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesaagc.lct APINVameapprovalgroupusage.ldt AME_APPROVAL_GROUP_CONFIG TRANSACTION_TYPE_ID='APINV' APPLICATION_SHORT_NAME='SQLAP'

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesrulk.lct APINVamerule.ldt AME_RULES TRANSACTION_TYPE_ID='APINV'  APPLICATION_SHORT_NAME='SQLAP'

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesactu.lct APINVameactionusage.ldt AME_ACTION_USAGES TRANSACTION_TYPE_ID='APINV' APPLICATION_SHORT_NAME='SQLAP'

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amescvar.lct APINVhubtrantype.ldt AME_CALLING_APPS TRANSACTION_TYPE_ID='APINV' APPLICATION_SHORT_NAME='SQLAP'

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesmatt.lct APINVhubattributes.ldt AME_ATTRIBUTES TRANSACTION_TYPE_ID= 'APINV' APPLICATION_SHORT_NAME='SQLAP'

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesmatr.lct APINVhubattributeusage.ldt AME_ATTRIBUTE_USAGES APPLICATION_SHORT_NAME='SQLAP'TRANSACTION_TYPE_ID= 'APINV'



--UPLOAD

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesconk.lct APINVamecondition.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesappg.lct APINVameapprovalgroup.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesaagc.lct APINVameapprovalgroupusage.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesrulk.lct APINVamerule.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesactu.lct APINVameactionusage.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amescvar.lct APINVhubtrantype.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesmatt.lct APINVhubattributes.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesmatr.lct APINVhubattributeusage.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE


FNDLOAD for Quality Plan Setup Migration

 --Get PLAN_ID using the following query  

SELECT * FROM QA_PLANS WHERE NAME='MRP APPROVAL QT PLAN';


--PLAN_ID=10078

--User following command to download the quality plan setup

--Download

FNDLOAD apps/password 0 Y DOWNLOAD $QA_TOP/patch/115/import/qltplans.lct MRP_APPROVAL_QT_PLAN.ldt QA_PLANS PLAN_ID="10078"

--Upload

FNDLOAD apps/password 0 Y UPLOAD $QA_TOP/patch/115/import/qltplans.lct MRP_APPROVAL_QT_PLAN.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE


Wednesday, 8 April 2020

Query to get concurrent Program Assignment with Concurrent Manager

Query to get concurrent Program Assignment with Concurrent Manager

As we all know, by default all programs assigned to the "Standard Manager" concurrent manager. We create specific queues for heavy or critical programs to avoid the normal queues and work in dedicated queues. 

It's like VIP queue created for special programs :)

Following is the query, which we can use to get the program exclusion from the specific queue and assign it to the VIP queue.


select fcqc.queue_application_id,fcqc.concurrent_queue_id
      ,fcqv.user_concurrent_queue_name,fcqv.enabled_flag
      ,fcqc.include_flag,fcqc.type_application_id
      ,fcqc.type_id,fcpt.user_concurrent_program_name 
  from FND_CONCURRENT_QUEUE_CONTENT fcqc
     , fnd_concurrent_programs_tl fcpt
     , FND_CONCURRENT_QUEUES_VL fcqv
 where fcqc.type_code = 'P'
   and fcqc.type_application_id = fcpt.application_id
   and fcqc.type_id = fcpt.concurrent_program_id
   and fcpt.user_concurrent_program_name = 'Check Periodic Alert'
   and fcqc.queue_application_id = fcqv.application_id
   and fcqc.concurrent_queue_id = fcqv.concurrent_queue_id
   and fcpt.language = 'US';

Monday, 27 January 2020

Improve Workflow Notification Response time



Quick Note: 

After user responds to a notification, the control returns after processing the subsequent function activities. In case of any costly activity; user can face delay in response. By setting up following, response processing will be deferred and control will return immediately.


Login from SYSADMIN

Go to “Workflow Administrator”=>” Administrator Workflow”=>”Administration”
Or “System Administrator”=> “Workflow”=>” Administrator Workflow”=>”Administration”


Add Following lines as per screenshot in “Notification Response” and test the AP Invoice Delay issue after approval


 


Wednesday, 15 January 2020

Function to Get GL Code Segment1 for the Organization ID

FUNCTION get_account_segment1 (p_org_id IN NUMBER) RETURN VARCHAR2  AS
  l_segment1 VARCHAR2 (25);
BEGIN
  SELECT gcc.segment1 INTO l_segment1
    FROM financials_system_params_all fsp,gl_ledgers gsb, gl_code_combinations gcc
   WHERE fsp.org_id = p_org_id
     AND fsp.set_of_books_id = gsb.ledger_id
     AND gsb.chart_of_accounts_id = gcc.chart_of_accounts_id
     AND fsp.accts_pay_code_combination_id = gcc.code_combination_id;
  RETURN (l_segment1);
EXCEPTION WHEN OTHERS THEN RETURN ('00'); 
END;