Search This Blog

Tuesday, April 7, 2015

1. Creating XML Report Steps

1)Develop the Report(.rdf) Only  DataModel

2)Save the report and Compoile and Generate the data in .xml Format
  File=>Generate to File => XML

3)Open the Ms-WOrd document  Design the Layout
  include the follwing Tool Bar options called Form  and Templete builder

4)Define the Table and Specify the Titles and Labels whatever we would like to print

5)Include 'Text Form Field' Double CLick => Add Help Text button enter the following
  syntax
  <?for-each:G_USER_ID?>  : Here G_USER_ID is Group name from .rdf Data Model
 Note: It means Indirectley Repeating Frame starting

6)Define the Fields which we would like to display
 
  Include 'Text Form Field' Double CLick => Add Help Text button enter the following
  syntax 
  <?Column Name>?

Note: Define all the fields like this

7)We have to close the Repeating Frame (For each Loop)
  Include 'Text Form Field' Double CLick => Add Help Text button enter the following
  syntax 
<?end for-each?>

8)Save the document in .rtf(Rich Text File format)

9)Load the .xml file data and generate the Output in pdf Format
  Data=>Load XMl Data=>Load the .xml File=>Once Data is Loaded succesfully

10)Generate the Preview as per this Preview=>PDF


11) xml registration.

go to xml administrator resp> there we have to define data definition and template.

in data definition there is column called : code


12) template define.



13) Register concurrent executable

14) Register concurrent program

15) Add the conccurent program to request group.




Courtesy Gandham Technologies....

Monday, April 6, 2015

Steps to view arabic letters in Toad



To view arabic letters in Toad:
Step 1:
Change the registry value:
HKEY_LM>SOFTWARE>WOW6432NODE>ORACLE>KEY_SUITEHOME2>

RIGHT SIDE DOUBLE CLICK NLS_LANG KEY AND CHANGE THE VALUE TO AMERICAN_AMERICA.AR8MSWIN1256



STEP2:
Go to control panel>Region and language>
Last tab> Administrative

Change Change System Locale to Arabic (U.A.E)

It will prompt to restart, restart the pc and u can view the Arabic data in Arabic script itself.

Thanks to Mostafa by colleague.

Tables (User tables)

USER_TABLES    Lists each table that belongs to your Oracle user.
USER_TAB_COMMENTS    Shows comments on the tables and views.
USER_TAB_COLUMNS    Tells you the names, data types, default values, etc. of each column in each table.
USER_COL_COMMENTS    Shows comments on the columns.
USER_CONSTRAINTS    Gives you all constraints (either single- or multi-column), such as primary key, foreign key, not null, check constraints, etc.
USER_CONS_COLUMNS    Maps constraints to columns (since a constraint can act on one or many columns).
USER_INDEXES    Lists indexes defined on columns (either defined explicitly when creating the data model or defined automatically by Oracle, as is the case with indexes on primary keys).
USER_IND_COLUMNS    Maps indexes to columns.
USER_VIEWS    Lists all views, along with the text used to originally create them.
USER_SYNONYMS    Lists the synonyms and original table names.
USER_SEQUENCES    Lists all sequences, including min value, max value, and amount by which to increment.
USER_TRIGGERS    Contains trigger names, criteria for activating each trigger, and the code that is run.
USER_SOURCE    Contains the source code for all PL/SQL objects, including functions, procedures, packages, and package bodies.

Thanks to my colleague Mr. Hissam for above info.

api to register table, columns easily with cursor using user tables.

0.

begin
ad_dd.register_table
(p_appl_short_name =>  'XXCUST',    --Application name in which you want to register
p_tab_name      =>'XX_FFRD_PER_INFO_HEADER', --Table Name
p_tab_type      =>'T',   -- T for Transaction data , S for seeded data
p_next_extent     =>  512,   -- default 512
p_pct_free        =>  10,   -- Default 10
p_pct_used        =>  70 --Default 70
);
end;


1.

DECLARE
CURSOR C1 IS
SELECT  * FROM  USER_TAB_COLUMNS
WHERE TABLE_NAME = 'XX_FFRD_PER_INFO_HEADER'
--AND COLUMN_NAME NOT IN ('PER_NAME','PER_EID')
;
begin
FOR I IN C1 LOOP
ad_dd.register_column
(p_appl_short_name =>   'XXCUST', --Application Name
p_tab_name      =>  'XX_FFRD_PER_INFO_HEADER', --Table Name
p_col_name     =>   I.COLUMN_NAME, --Column Name
p_col_seq      =>   I.COLUMN_ID, --Column Sequence
p_col_type     =>   I.DATA_TYPE, --Column Data type
p_col_width    =>   I.DATA_LENGTH, --Column Width
p_nullable        =>   'N', --Use'N' if mandatory column otherwise 'Y'
p_translate       =>   'N', --Use 'Y' if this has translatable values
p_precision       =>   null, --Decimal precision
p_scale           =>   NULL --Number of digits in number
);
END LOOP;
end;

Commit;

2.
Begin
ad_dd.register_primary_key
(p_appl_short_name =>   'XXCUST', --Application Name
p_key_name        =>   'XX_FFRD_PER_INFO_HEADER_PK', --Unique name for primary key
p_tab_name      =>   'XX_FFRD_PER_INFO_HEADER', --Table Name
p_description     =>   'EID PRIMARY KEY', --Description
p_key_type        =>   'S', --S for Surrogate, D for Developer
p_audit_flag      =>   'Y',
p_enabled_flag    =>   'Y');
end;
commit;

3.

USER.USER_ID

USER_RESP

Begin
ad_dd.register_primary_key_column
(p_appl_short_name =>  'XXCUST', --Application Name
p_key_name        =>  'XX_FFRD_PER_INFO_HEADER_PK', --Primary Key name given above
p_tab_name        =>  'XX_FFRD_PER_INFO_HEADER',--Table Name
p_col_name        =>  'PER_EID', --Primary Column name
p_col_sequence    =>  1); --Column seq
end;

api to delete person from the hrms

API to Purge an person from Oracle HRMS

DECLARE
l_person_org_manager_warning VARCHAR2 (200);
BEGIN
hr_person_api.delete_person
(p_validate => FALSE,
p_effective_date => SYSDATE,
p_person_id => :person_id,
p_perform_predel_validation => FALSE,
p_person_org_manager_warning => l_person_org_manager_warning
);
COMMIT;
END;

Before purging the person from Oracle HRMS we need to make sure that the employee and fnd_user link is been deleted and also the person should not have an active payroll.

If the employee has an active payroll then we cannot purge the record. The alternative way is to either end date the employee using the termination screen or you need to change the person from 'Employee' to 'Applicant' and then use the above API again to purge the record.

api to delete data definition and data template

Oracle application is not providing any option to delete the data definition and template but here I'm providing a script by which you can delete both from back end. But before running the script you have to take care of two things:
a)Give the proper template code in the variable var_template code of the script because you can't rollback.
b)If you to delete the data definition file with template then make the variable boo_deleteDataDef true unless make it as false.

SET SERVEROUTPUT ON
 DECLARE
   -- Change the following two parameters
   var_templateCode    VARCHAR2 (100) := 'Order_Details';     -- Template Code
   boo_deleteDataDef   BOOLEAN := TRUE;     -- delete the associated Data Def.
BEGIN
   FOR RS
      IN (SELECT T1.APPLICATION_SHORT_NAME TEMPLATE_APP_NAME,
                 T1.DATA_SOURCE_CODE,
                 T2.APPLICATION_SHORT_NAME DEF_APP_NAME
            FROM XDO_TEMPLATES_B T1, XDO_DS_DEFINITIONS_B T2
           WHERE T1.TEMPLATE_CODE = var_templateCode
                 AND T1.DATA_SOURCE_CODE = T2.DATA_SOURCE_CODE)
   LOOP
      XDO_TEMPLATES_PKG.DELETE_ROW (RS.TEMPLATE_APP_NAME, var_templateCode);

      DELETE FROM XDO_LOBS
            WHERE     LOB_CODE = var_templateCode
                  AND APPLICATION_SHORT_NAME = RS.TEMPLATE_APP_NAME
                  AND LOB_TYPE IN ('TEMPLATE_SOURCE', 'TEMPLATE');

      DELETE FROM XDO_CONFIG_VALUES
            WHERE     APPLICATION_SHORT_NAME = RS.TEMPLATE_APP_NAME
                  AND TEMPLATE_CODE = var_templateCode
                  AND DATA_SOURCE_CODE = RS.DATA_SOURCE_CODE
                  AND CONFIG_LEVEL = 50;

      DBMS_OUTPUT.PUT_LINE ('Selected template has been ' || var_templateCode || ' deleted.');

      IF boo_deleteDataDef
      THEN
         XDO_DS_DEFINITIONS_PKG.DELETE_ROW (RS.DEF_APP_NAME,
                                            RS.DATA_SOURCE_CODE);

         DELETE FROM XDO_LOBS
               WHERE LOB_CODE = RS.DATA_SOURCE_CODE
                     AND APPLICATION_SHORT_NAME = RS.DEF_APP_NAME
                     AND LOB_TYPE IN
                            ('XML_SCHEMA',
                             'DATA_TEMPLATE',
                             'XML_SAMPLE',
                             'BURSTING_FILE');

         DELETE FROM XDO_CONFIG_VALUES
               WHERE     APPLICATION_SHORT_NAME = RS.DEF_APP_NAME
                     AND DATA_SOURCE_CODE = RS.DATA_SOURCE_CODE
                     AND CONFIG_LEVEL = 30;

         DBMS_OUTPUT.PUT_LINE (
            'Selected Data Defintion has been ' || RS.DATA_SOURCE_CODE || ' deleted.');
      END IF;
   END LOOP;
  COMMIT;
EXCEPTION
   WHEN OTHERS
   THEN
      ROLLBACK;
      DBMS_OUTPUT.PUT_LINE (
         'Unable to delete XML Publisher Template ' || var_templateCode);
      DBMS_OUTPUT.PUT_LINE (SUBSTR (SQLERRM, 1, 200));
END;
/

Query 'like' function with parameter

select UNIQUE FU.USER_NAME,--FL.START_TIME Login_Time,
--limit_time, limit_connects,
 to_char(FIRST_connect, 'DD-MON-RR HH:MI:SS') "Session_Start",
 to_char(last_connect, 'DD-MON-RR HH:MI:SS') "Session_End",
ics.user_id, disabled_flag,
round((last_connect -  first_connect) * 24 * 60) Time_of_session
from icx_sessions ics,fnd_user fu, fnd_logins fl
where last_connect BETWEEN :P_START_DATE AND :P_END_DATE
AND FL.START_TIME BETWEEN :P_START_DATE AND :P_END_DATE
AND UPPER(FU.USER_NAME) LIKE UPPER(:P_USER_NAME)||'%'
 --OR UPPER(FU.USER_NAME) = NVL(:P_USER_NAME, FU.USER_NAME)
and (ICS.USER_ID = :P_USER_ID or :P_USER_ID is null )
and ics.user_id = fu.user_id
and fl.user_ID = FU.USER_ID
ORDER BY USER_NAME

Query to find Payroll details posted to GL in R12


Query to find Payroll details posted to GL in R12

select
  PAPF.EMPLOYEE_NUMBER,
  PAPF.FIRST_NAME ||' '||PAPF.LAST_NAME EMPLOYEENAME,
  XAL.DESCRIPTION,
  NVL(NVL(-xal.accounted_cr,xal.accounted_dr),0) amount
FROM xla.xla_ae_headers xah,
  xla.xla_ae_lines xal,
  xla_distribution_links xdl,
  gl_code_combinations gcc,
  xla.xla_transaction_entities xte,
  gl_import_references gir,
  gl_je_headers gjh,
  gl_je_lines gjl,
  pay_assignment_actions paa,
  per_all_assignments_f paaf,
  PER_ALL_PEOPLE_F PAPF
WHERE XAH.AE_HEADER_ID       = XAL.AE_HEADER_ID
AND gcc.code_combination_id  = xal.code_combination_id
AND xdl.ae_header_id         = xah.ae_header_id
AND xdl.ae_line_num          = xal.ae_line_num
AND xte.entity_id            = xah.entity_id
AND xal.gl_sl_link_id        = gir.gl_sl_link_id
AND gir.je_header_id         = gjl.je_header_id
AND gir.je_line_num          = gjl.je_line_num
AND gir.je_header_id         = gjh.je_header_id
AND gjl.je_header_id         = gjh.je_header_id
AND paa.assignment_action_id = xdl.source_distribution_id_num_1
AND paa.assignment_id        = paaf.assignment_id
AND PAAF.PERSON_ID           = PAPF.PERSON_ID
AND TRUNC(sysdate) BETWEEN TRUNC(paaf.EFFECTIVE_START_DATE) AND TRUNC(paaf.EFFECTIVE_END_DATE)
and TRUNC(sysdate) between TRUNC(PAPF.EFFECTIVE_START_DATE) and TRUNC(PAPF.EFFECTIVE_END_DATE)
and  GJH.PERIOD_NAME='DEC-10'
and JE_CATEGORY_NAME='Payroll'

Payroll process_rollback_reversal_retry


Payroll Processes In Oracle R12 HRMS

Payroll refers to the amount paid to employees for services they provided during a certain period of time. Gone are the days, where payroll included only printing of checks and handing out of payment issues. Nowadays, payroll process has been automated to such extent that only professionals and consultants who specialize can resolve such issues. In today’s scenario, every benefit, taxes, insurance coverage, worker’s compensation and funds for pension are mapped into an application.


In Oracle R12 HRMS, we define payroll as a group of employees who share a common payment date and frequency of payroll processing. Payroll contains information about payment methods and consolidation sets. The application uses elements to represent all types of earnings, deductions and benefits. Earnings in your salary may be basic, conveyance and medical allowances, taxable flexible or fringe benefits. Deductions can be voluntary, involuntary or pre-tax. Element classification also includes direct payment, court orders and balance initialization.

The setups in oracle HRMS payroll come up to be that if salary is suppose to be distributed to employees they must be eligible for an element when their assignment details match the link details. We can link each element (mentioned above) to any combination of organization, group, grade, job, position, payroll, location or salary basis. Then comes the process of running payroll.

While running payroll, mistakes may occur. Oracle HRMS has provided us with various functionalities for correcting those mistakes after payment has been made to employees. These functionalities are retry, rollback, reversal.

Retry is done when in your salary the payroll manager may have missed out to add entry values for an element, or any other changes that may not have been added. Here we mark that employee, make the changes and run the payroll.

Rollback is done to delete the entire payroll run as if it had never occurred. The condition is that when 10% salary hike is made for 1000 employees for a month. The increased salary did not get update for them. We rollback the payroll and rerun it.

Reversal, a post-payroll processing methodology, is done to correct any type of payroll information.

By using Oracle HRMS, we can make backdated and advance payments. A payroll manager makes backdated payments in the current payroll period.

For example: An employee is cut short of being paid (suppose Rs. 2000) in the month of April. Now in the month of June, his backdated amount (Rs. 2000) is credited through Retropay by element and following payroll process.

An employee can also be paid in advance for one or more months in his current pay period.

Oracle Payroll in HRMS covers all the above aspects in addition to defining compensation and benefits for employees.

Reference:
Check this all: http://hrmsnetwork.blogspot.ae/2009/05/oracle-payroll-r12-define-payroll.html

http://oraebizblog.wordpress.com/2012/09/18/30/

Queries after the Payroll is run in Oracle EBS R12



Which tables are affected when payroll is run
Following are some of the tables which are affected when payroll is run. 

Main Tables that are affected


1. PAY_PAYROLL_ACTIONS2. PAY_ASSIGNMENT_ACTIONS3. PAY_RUN_RESULTS 
4. PAY_RUN_RESULT_VALUES 

Linked tables

PAY_ELEMENT_TYPES_F
PAY_INPUT_VALUES
PER_TIME_PERIODS
 

PAY_PAYROLL_ACTIONS

It records each payroll actions identified by column ACTION_TYPE. Primary key of the table is PAYROLL_ACTION_ID. You can also know when the payroll was run and for which period through TIME_PERIOD_ID columns which can be linked with PER_TIME_PERIODS table.
 

PAY_ASSIGNMENT_ACTIONS

Through this table you can know which payroll has been run for which assignment. It links with PAY_PAYROLL_ACTION by PAYROLL_ACTION_ID and PER_ALL_ASSIGNMENTS_F through ASSIGNMENT_ID.

PAY_RUN_RESULTS

You can know how may elements have been used when payroll was run which can be known through ELEMENT_TYPE_ID column which can be linked with PAY_ELEMENT_TYPES_F.

PAY_RUN_RESULT_VALUES

This table tells you when payroll was run, which element carried what values. You can join this table with PAY_INPUT_VALUES though INPUT_VALUE_ID column in this table.
 



0. Run the quick pay for any employee and follow the below steps.

SELECT DISTINCT FULL_NAME, ASSIGNMENT_ID  
FROM PER_ALL_ASSIGNMENTS_F PAAF, 
PER_ALL_PEOPLE_F PAPF
WHERE PAAF.PERSON_ID = PAPF.PERSON_ID
--AND PAYROLL_ID = 106
AND ASSIGNMENT_ID IN (7658, 7661)
AND TRUNC(SYSDATE) BETWEEN PAPF.EFFECTIVE_START_DATE AND PAPF.EFFECTIVE_END_DATE

SELECT payroll_id,payroll_name
FROM PAY_ALL_PAYROLLS_F
ORDER BY PAYROLL_ID


1. PAY_PAYROLL_ACTIONS

SELECT PAYROLL_ACTION_ID, ACTION_TYPE, PPA.PAYROLL_ID,EFFECTIVE_DATE,
DISPLAY_RUN_NUMBER,PPA.CREATED_BY, PTP.TIME_PERIOD_ID, PTP.PERIOD_NAME,
PTP.END_DATE, TRIM(TO_CHAR(PTP.END_DATE,'MON-YYYY')) MONTH
 FROM PAY_PAYROLL_ACTIONS PPA, 
PER_TIME_PERIODS PTP
WHERE PPA.PAYROLL_ID = 106
AND ACTION_TYPE = 'Q'
AND DATE_EARNED = '27-AUG-2013'
AND PPA.TIME_PERIOD_ID = PTP.TIME_PERIOD_ID

2.

SELECT * FROM PAY_ASSIGNMENT_ACTIONS
WHERE PAYROLL_ACTION_ID IN
(SELECT PAYROLL_ACTION_ID
 FROM PAY_PAYROLL_ACTIONS PPA, PER_TIME_PERIODS PTP
WHERE PPA.PAYROLL_ID = 106
AND ACTION_TYPE = 'Q'
AND DATE_EARNED = '27-AUG-2013'
AND PPA.TIME_PERIOD_ID = PTP.TIME_PERIOD_ID)

SELECT * FROM PER_ALL_ASSIGNMENTS_F
WHERE  ASSIGNMENT_ID IN (7658, 7661)


3.

SELECT * FROM PAY_RUN_RESULTS
WHERE ASSIGNMENT_ACTION_ID IN
(SELECT ASSIGNMENT_ACTION_ID FROM PAY_ASSIGNMENT_ACTIONS
WHERE PAYROLL_ACTION_ID IN
(SELECT PAYROLL_ACTION_ID
 FROM PAY_PAYROLL_ACTIONS PPA, PER_TIME_PERIODS PTP
WHERE PPA.PAYROLL_ID = 106
AND ACTION_TYPE = 'Q'
AND DATE_EARNED = '27-AUG-2013'
AND PPA.TIME_PERIOD_ID = PTP.TIME_PERIOD_ID
AND ASSIGNMENT_ID = 7658))-- FOR ONE EMPLOYEE ASSIGNMENT


SELECT ELEMENT_TYPE_ID,ELEMENT_NAME FROM PAY_ELEMENT_TYPES_F
WHERE SYSDATE BETWEEN EFFECTIVE_START_DATE AND EFFECTIVE_END_DATE

SELECT PRR.RUN_RESULT_ID,PRR.ELEMENT_TYPE_ID,PRR.SOURCE_TYPE, PRR.STATUS,
PRR.ELEMENT_ENTRY_ID,PETF.ELEMENT_NAME
FROM PAY_RUN_RESULTS PRR, PAY_ELEMENT_TYPES_F PETF
WHERE
PRR.ELEMENT_TYPE_ID = PETF.ELEMENT_TYPE_ID
AND ASSIGNMENT_ACTION_ID IN
(SELECT ASSIGNMENT_ACTION_ID FROM PAY_ASSIGNMENT_ACTIONS
WHERE PAYROLL_ACTION_ID IN
(SELECT PAYROLL_ACTION_ID
 FROM PAY_PAYROLL_ACTIONS PPA, PER_TIME_PERIODS PTP
WHERE PPA.PAYROLL_ID = 106
AND ACTION_TYPE = 'Q'
AND DATE_EARNED = '27-AUG-2013'
AND PPA.TIME_PERIOD_ID = PTP.TIME_PERIOD_ID
AND ASSIGNMENT_ID = 7658))


4.

SELECT *
 FROM PAY_RUN_RESULT_VALUES PRRV


SELECT PRRV.INPUT_VALUE_ID, RUN_RESULT_ID, RESULT_VALUE, FORMULA_RESULT_FLAG
 FROM PAY_RUN_RESULT_VALUES PRRV


SELECT PRRV.INPUT_VALUE_ID, RUN_RESULT_ID, RESULT_VALUE, FORMULA_RESULT_FLAG
 FROM PAY_RUN_RESULT_VALUES PRRV
      WHERE RUN_RESULT_ID
      IN
( SELECT PRR.RUN_RESULT_ID
FROM PAY_RUN_RESULTS PRR, PAY_ELEMENT_TYPES_F PETF
WHERE
PRR.ELEMENT_TYPE_ID = PETF.ELEMENT_TYPE_ID
AND ASSIGNMENT_ACTION_ID IN
(SELECT ASSIGNMENT_ACTION_ID FROM PAY_ASSIGNMENT_ACTIONS
WHERE PAYROLL_ACTION_ID IN
(SELECT PAYROLL_ACTION_ID
 FROM PAY_PAYROLL_ACTIONS PPA, PER_TIME_PERIODS PTP
WHERE PPA.PAYROLL_ID = 106
AND ACTION_TYPE = 'Q'
AND DATE_EARNED = '27-AUG-2013'
AND PPA.TIME_PERIOD_ID = PTP.TIME_PERIOD_ID
AND ASSIGNMENT_ID = 7658)))
    

SELECT  PRR.RUN_RESULT_ID,
PETF.ELEMENT_NAME,PRRV.INPUT_VALUE_ID, PIV.NAME,FORMULA_RESULT_FLAG, RESULT_VALUE
FROM
PAY_RUN_RESULT_VALUES PRRV, PAY_INPUT_VALUES_F PIV,
PAY_RUN_RESULTS PRR, PAY_ELEMENT_TYPES_F PETF
WHERE
PRR.ELEMENT_TYPE_ID = PETF.ELEMENT_TYPE_ID
AND PRRV.RUN_RESULT_ID = PRR.RUN_RESULT_ID
AND PIV.INPUT_VALUE_ID = PRRV.INPUT_VALUE_ID
AND ASSIGNMENT_ACTION_ID IN
(SELECT ASSIGNMENT_ACTION_ID FROM PAY_ASSIGNMENT_ACTIONS
WHERE PAYROLL_ACTION_ID IN
(SELECT PAYROLL_ACTION_ID
 FROM PAY_PAYROLL_ACTIONS PPA, PER_TIME_PERIODS PTP
WHERE PPA.PAYROLL_ID = 106
AND ACTION_TYPE = 'Q'
AND DATE_EARNED = '27-AUG-2013'
AND PPA.TIME_PERIOD_ID = PTP.TIME_PERIOD_ID
AND ASSIGNMENT_ID = 7658))

SELECT * FROM PAY_INPUT_VALUES_F

FINAL QUERY TO SEE ALL THE ELEMENTS AND THEIR VALUES IN THE PAYROLL RUN:

select papf.employee_number,papf.full_name,ppa.effective_date,pp.payroll_name,
pet.element_name,piv.name input_value,prrv.result_value,ppa.payroll_action_id
from apps.pay_payroll_actions ppa,
 pay_assignment_actions paa,
pay_payrolls_f pp,
pay_run_results prr,
pay_run_result_values prrv,
pay_input_values_f piv,
pay_element_types_f pet,
apps.per_all_assignments_f paaf,
apps.per_all_people_f papf
--where ppa.payroll_action_id = :payroll_action_id -- give your payroll_action_id
where ppa.payroll_id = :payroll_id
--and paa.assignment_action_id = :assignment_action_id
and ppa.payroll_action_id = paa.payroll_action_id
and ppa.payroll_id = pp.payroll_id
and paa.assignment_action_id = prr.assignment_action_id
and prr.run_result_id= prrv.run_result_id
and prrv.input_value_id = piv.input_value_id
and piv.element_type_id = pet.element_type_id
and paaf.assignment_id = paa.assignment_id
and paaf.person_id = papf.person_id
and trunc(sysdate) between pp.effective_start_date and pp.effective_end_date
and trunc(sysdate) between pet.effective_start_date and pet.effective_end_date
and trunc(sysdate) between piv.effective_start_date and piv.effective_end_date
and trunc(sysdate) between paaf.effective_start_date and paaf.effective_end_date
and trunc(sysdate) between papf.effective_start_date and papf.effective_end_date
and papf.employee_number = '3930'  --give your employee number here
--and ppa.effective_date = '27-JUN-2013'
and ELEMENT_NAME = 'Basic Salary' -- give your element name here
order by employee_number