Get nth Salary

Get me nth largest salary without using
where
having
sub query
inline query
Thanks.

SELECT
NTH_VALUE(max(salary), 2) OVER (PARTITION By deptno ORDER BY empno ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) nv
FROM employee --- this will give 2nd highest salray..

Similar Messages

  • How to get Basic salary amount in the Housing formula to calculate the housing value as I used the DBI (NICDP_EMPLOYEE_BASIC_SALARY_AMOUNT_ASG_ENTRY_VALUE) but when run the Quick pay for the housing element alone result come 0, How to get Basic salary amo

    How to get Basic salary amount in the Housing formula to calculate the housing value as I used the DBI (NICDP_EMPLOYEE_BASIC_SALARY_AMOUNT_ASG_ENTRY_VALUE) but when run the Quick pay for the housing element alone result come 0, How to get Basic salary amount in the Housing formula to calculate the housing value as I used the DBI (NICDP_EMPLOYEE_BASIC_SALARY_AMOUNT_ASG_ENTRY_VALUE) but when run the Quick pay for the housing element alone result come 0

    Hi,
    Is your formula attached to basic salary element or some other element? You need to make sure that basic salary element has some value and is processed before this formula is called. Are you able to see value for basic salary element after payroll run?
    Regards,
    Pawan

  • Get gross salary

    Hi All,
    this is Naresh.
    i need to get Gross salary but not from any payroll cluster table.
    i am using 0008, 0015 infotypes.
    is it possible to get gross salary only from Infotypes?
    i need Yearly Salary even.
    thanks,
    naresh.

    Hi Ketul,
    thanks for your reply.
    i want to perform some calculations based upon basic salary and gross salary.
    i have basic from 0008 infotype, as a same way is it possible to get gross salary from infotype level only?
    regards,
    naresh.

  • How to get highest salary from salary column in sharepoint list

    Hello,
    I have one custom list in which there is one salary column so I want to get the highest salary.Can we do this OOTB or by using custom code by adding webpart(using CAML query).
    Thanks,

    http://stackoverflow.com/questions/516073/max-query-using-caml
    <Query>
    <OrderBy>
    <FieldRef Name="particularcolumn" Ascending="FALSE" />
    </OrderBy>
    </Query>
    http://stackoverflow.com/questions/8383616/caml-query-on-a-sharepoint-2010-list
    http://sharepoint.stackexchange.com/questions/16955/how-to-select-max-field-in-caml-query
    If this helped you resolve your issue, please mark it Answered

  • HR - Get Monthly Salary

    Hi All,
    I have to create a Report based on Montly Salary by employee; so i will report based on 0EMPLOYEE ; but here it come the "Anual Salary".
    My question is :
    Which is the best approach to get the exactly monthly salary ?
    Regards

    Hello Sab,
    in HR-PA there is an infotype called Basic Pay ( 0008) monthly or hourly wages entered there under a wage type.
    You can create your own generic datasource on the table PA0008 and you can create an infoset based on 0employee and this datasource. After that you can create queries based on this.
    Sarhan.

  • Getting all salary changes

    Hi all,
    I need to track all salary changes to send a benefit coverage report to our insurance company.
    I've tried a couple of things, but since there are many ways the benefit coverage can be affected, there always some changes I don't get.
    The latest I've tried looks like this:
    -Using PNP I first eliminated all employees without a infotype 0001 or 0008.
    -I'm checking last changes in 0015, 0008 and 0168, if there's something I extract  the info.
    The only way I succeeded in tracking ALL salary changes was to calculate the salary for each day of the report period and check the preceeding day for a change. This is OK for one employee buy WAY TO SLOW for all our 1350 employee!!.
    So any help would be greatly appreciated.

    Finally I stick with my first solution to check the salary for each days of the period. With some tuning it is now OK.

  • Get employees salary and worked hours history

    Hi guys,
    I am currently trying to model a control that we would like to implement. In short, we would like to check whether in the past, employees that worked less than a given amount of time per month (say X hours a month) did not receive any salary for that month.
    I struggle to find the appropriate reports that would allow me to do this.
    I saw that the report RPLEHSU0 can display the salary history, but I'm not sure whether this corresponds to the actual monthly wage of each employee.
    Could someome highlight what specific SAP reports would provide me these information?
    Thank you.
    Regards,
    François.

    I think what you need is the data from payroll results. That is only way you can determine if employee has been "paid". IT8 may have a dollar amount but this does not mean employee got paid. Are you using time evaluation and payroll..? You can develop a custom report...to read payroll results...you have to read actual hours worked...and compare with target...and then see if employee has any payment for the corresponding payroll period (s).
    I don't know if there is a one single standard report for this. You can get this in individual reports - get actual hours worked you can use PT_BAL00 which gives the hours worked provided your time evaluation is generating time types/time wage types for hours worked. You can use payroll wage type reporter to get the payment information for a given payroll period...you still have to combine these two to get your final report.

  • Get nth number of sets from user in proper set format in C#

    how to take nth number of sets from user using string type list in C#. 
    Each set should be in this format {1, 2 , 3, ab,....nth }.
    User can enter nth number of item in each set
    then count the number of item in each set
    Waiting for you answers 

    I think you still not got my point. okay once again i explain you what i want.
    User Enter set in WPF window in this format e.g {1,2,3,ab},{ab,cd,1,2}.
    User can enter nth number of set.
    User can enter nth number of elements\ items in each set.
    Count the number of elements in each set.
    Hopefully now you got my point
    If I understand you correctly, you want to get the number based on the string like "{1,2,3,ab},{ab,cd,1,2}". Maybe you could try Regular Expression:
    https://msdn.microsoft.com/en-us/library/az24scfc%28v=vs.110%29.aspx
    For example this code snippet is able to count the set numbers and element numbers for you:
    string input = "{1,2,3,ab},{ab,cd,1,2}";
    string pattern1 = @"{.*?}";
    string pattern2 = @"\w+,?";
    Regex reg = new Regex(pattern1);
    MatchCollection mc1 = reg.Matches(input);
    Console.WriteLine("Number of set:" + mc1.Count);
    for (int i = 0; i < mc1.Count; i++)
    reg = new Regex(pattern2);
    MatchCollection mc2 = reg.Matches(mc1[i].Value);
    Console.WriteLine("Set " + (i + 1) + " element number:" + mc2.Count);
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Function module to get actual salary paid for a particular period

    Hi All,
    I have a requirement to build a report on the monthly superannuation contributions the company makes to the employee [Australian Payroll], along with a few other information. We are on a weekly payroll and make super contributions once a month.
    Is there any Function module or table that stores the pay results for a period [from which I can calculate the superannuation amount] or superannuation pay ?
    Or is there an alternative way of approaching to get the information ?
    Thank you,
    Satish

    I used table hrpy_rgdir  to get sequence number for the given pernr, payroll area and dates.
    Using the sequence number, I am calling Function PYXX_READ_PAYROLL_RESULT to extract the payroll results.
    SELECT * INTO CORRESPONDING FIELDS OF TABLE it_hrpy_rgdir
      FROM hrpy_rgdir
      WHERE srtza = 'A'             
        AND paydt IN sopaydt
        AND abkrs IN soabkrs
        AND pernr IN sopernr.
    LOOP AT it_hrpy_rgdir.
      PERFORM get_rt USING it_hrpy_rgdir-pernr it_hrpy_rgdir-seqnr.
    ENDLOOP.
    *&      Form  get_rt
    *       text
    *      -->PERNR      text
    *      -->SEQNR      text
    FORM get_rt USING pernr seqnr.
      CLEAR: it_payroll_result.
      CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
        EXPORTING
          clusterid                    = 'RQ'
          employeenumber               = pernr
          sequencenumber               = seqnr
        CHANGING
          payroll_result               = it_payroll_result
        EXCEPTIONS
          illegal_isocode_or_clusterid = 1
          error_generating_import      = 2
          import_mismatch_error        = 3
          subpool_dir_full             = 4
          no_read_authority            = 5
          no_record_found              = 6
          versions_do_not_match        = 7
          error_reading_archive        = 8
          error_reading_relid          = 9
          OTHERS                       = 10.
    ENDFORM.                   
    For any period, the function module just returns sy-subrc = 6 [no_record_found].
    We are on Australian Payroll.  Could you please let me know what I might be missing or is there an alternative way of getting the information ?
    Thank you

  • How to retrieve top 5 employees getting maximum salary

    I have 100 employees, but I want to display only first 5 employee who are getting maximum salaries.

    SQL> select empno,ename,sal from emp;
    EMPNO ENAME            SAL
    7369 SMITH         800,00
    7499 ALLEN        1600,00
    7521 WARD         1250,00
    7566 JONES        2975,00
    7654 MARTIN       1250,00
    7698 BLAKE        2850,00
    7782 CLARK        2450,00
    7788 SCOTT        3000,00
    7839 KING         5000,00
    7844 TURNER       1500,00
    7876 ADAMS        1100,00
    7900 JAMES         950,00
    7902 FORD         3000,00
    7934 MILLER       1300,00
    14 rows selected
    SQL> select empno ,ename, sal from
      2  (
      3  select empno ,ename, sal from emp
      4    order by sal desc
      5  )
      6  where rownum<=5
      7  /
    EMPNO ENAME            SAL
    7839 KING         5000,00
    7788 SCOTT        3000,00
    7902 FORD         3000,00
    7566 JONES        2975,00
    7698 BLAKE        2850,00Regards,
    Simon

  • Sql query to get current salary

    hi,
    i have a table like below structure
    EMPID Date SALARY
    100 01-03-1990 3000
    200 03-07-1993 5000
    300 28-08-1997 6000
    100 27-07-1998 6000
    100 23-09-2000 5500
    400 30-09-2001 7000
    100 17-10-2008 10000
    I WANT TO RETRIEVE THE DATA LIKE THIS
    EX: If i give date as 18-07-1997 in query must fetch data like this------->100 3000
    If i give date as 18-10-2001 in query must fetch data like this------>400 7000
    If i give date as 24-10-2000 in query must fetch data like this------->100 5500
    If i give date as 18-07-2009 in query must fetch data like this------->100 10000
    based on date the query fetch latest data

    Job History
    EMPLOYEE_ID START_DAT JOB_ID
            101 21-SEP-89 AC_ACCOUNT
            101 28-OCT-93 AC_MGR
            102 13-JAN-93 IT_PROG
            114 24-MAR-98 ST_CLERK
            122 01-JAN-99 ST_CLERK
            176 24-MAR-98 SA_REP
            176 01-JAN-99 SA_MAN
            200 17-SEP-87 AD_ASST
            200 01-JUL-94 AC_ACCOUNT
            201 17-FEB-96 MK_REP
    10 rows selected.
    Job History, Latest to Date
    EMPLOYEE_ID MAX(JOB_ID
            101 AC_MGR
            102 IT_PROG
            114 ST_CLERK
            122 ST_CLERK
            176 SA_MAN
            200 AC_ACCOUNT
            201 MK_REP
    7 rows selected.
    Job History, Latest to 01-JAN-1990
    EMPLOYEE_ID MAX(JOB_ID
            101 AC_ACCOUNT
            200 AD_ASST
    SQL> l
      1  SELECT employee_id, Max(job_id) KEEP (DENSE_RANK LAST ORDER BY start_date)
      2    FROM job_history
      3   WHERE start_date < '01-JAN-1990'
      4   GROUP BY employee_id
      5*  ORDER BY 1
    SQL>Site is truncating the WHERE, it should be:
    3 WHERE start_date < 01-JAN-1990 in quotes

  • How to get the salary total.

    Hi Sirs,
    i am new to oaf.
    in my project i have one number column.
    how to displays total of that column plz help me
    Thanks
    latha.

    Hi
    Those field which appearing on the page where user can enter the value or the field used to display the value are beans like message text input bean ,lov input bean etc
    as you said
    my field data type is number in query and jdeveloper voso you shud confrim that the field (bean) where you want to enable total value in your table must be set the DataType as number.
    Thanks
    Pratap

  • Salary Statement in ESS is not getting displayed

    Hi ALL,
              When i am trying to get the salary statement from R/3 to portal this error is getting displayed.
                   Where as from the R/3 side we have a customaised HRFORM called ZOBT, it is generating report in R/3 where as it is not refelecting in PORTAL, its displaying error message as:
    A critical error has occured. Processing of the service had to be terminated. Unsaved data has been lost.
    Please contact your system administrator.
    Form ZOBT does not exist
    com.sap.pcuigp.xssfpm.java.FPMRuntimeException: Form ZOBT does not exist
         at com.sap.pcuigp.xssfpm.java.MessageManager.raiseException(MessageManager.java:111)
         at com.sap.pcuigp.xssfpm.java.MessageManager.raiseException(MessageManager.java:121)
         at com.sap.xss.hr.rep.fcrfw.FcRepFramework.reportBapiRet2Error(FcRepFramework.java:525)
         at com.sap.xss.hr.rep.fcrfw.FcRepFramework.callRfcGetForm(FcRepFramework.java:394)
         at com.sap.xss.hr.rep.fcrfw.FcRepFramework.processFollowingActions(FcRepFramework.java:484)
         at com.sap.xss.hr.rep.fcrfw.FcRepFramework.callRfcExecAction(FcRepFramework.java:378)
         at com.sap.xss.hr.rep.fcrfw.FcRepFramework.initModel(FcRepFramework.java:292)
         at com.sap.xss.hr.rep.fcrfw.wdp.InternalFcRepFramework.initModel(InternalFcRepFramework.java:256)
         at com.sap.xss.hr.rep.fcrfw.FcRepFrameworkInterface.initModel(FcRepFrameworkInterface.java:136)
         at com.sap.xss.hr.rep.fcrfw.wdp.InternalFcRepFrameworkInterface.initModel(InternalFcRepFrameworkInterface.java:198)
         at com.sap.xss.hr.rep.fcrfw.wdp.InternalFcRepFrameworkInterface$External.initModel(InternalFcRepFrameworkInterface.java:258)
         at com.sap.xss.hr.rem2.selection.VcRem2Selection.onInit(VcRem2Selection.java:245)
         at com.sap.xss.hr.rem2.selection.wdp.InternalVcRem2Selection.onInit(InternalVcRem2Selection.java:249)
         at com.sap.xss.hr.rem2.selection.VcRem2SelectionInterface.onInit(VcRem2SelectionInterface.java:161)
         at com.sap.xss.hr.rem2.selection.wdp.InternalVcRem2SelectionInterface.onInit(InternalVcRem2SelectionInterface.java:144)
         at com.sap.xss.hr.rem2.selection.wdp.InternalVcRem2SelectionInterface$External.onInit(InternalVcRem2SelectionInterface.java:220)
         at com.sap.pcuigp.xssfpm.wd.FPMComponent.doProcessEvent(FPMComponent.java:563)
         at com.sap.pcuigp.xssfpm.wd.FPMComponent.doEventLoop(FPMComponent.java:437)
         at com.sap.pcuigp.xssfpm.wd.FPMComponent.wdDoInit(FPMComponent.java:195)
         at com.sap.pcuigp.xssfpm.wd.wdp.InternalFPMComponent.wdDoInit(InternalFPMComponent.java:110)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.doInit(DelegatingComponent.java:108)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)
         at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.init(ClientComponent.java:430)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:362)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.initApplication(ApplicationSession.java:748)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:283)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingPortal(ClientSession.java:779)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:714)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:261)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
         at com.sap.tc.webdynpro.clientserver.session.core.ApplicationHandle.doProcessing(ApplicationHandle.java:73)
         at com.sap.tc.webdynpro.portal.pb.impl.AbstractApplicationProxy.sendDataAndProcessActionInternal(AbstractApplicationProxy.java:860)
         at com.sap.tc.webdynpro.portal.pb.impl.AbstractApplicationProxy.create(AbstractApplicationProxy.java:220)
         at com.sap.portal.pb.PageBuilder.updateApplications(PageBuilder.java:1244)
         at com.sap.portal.pb.PageBuilder.createPage(PageBuilder.java:354)
         at com.sap.portal.pb.PageBuilder.init(PageBuilder.java:547)
         at com.sap.portal.pb.PageBuilder.wdDoRefresh(PageBuilder.java:591)
         at com.sap.portal.pb.PageBuilder$1.doPhase(PageBuilder.java:822)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processPhaseListener(WindowPhaseModel.java:755)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doPortalDispatch(WindowPhaseModel.java:717)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:136)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:313)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:730)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:261)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
                  Help me.
    Regards,
    Kishore

    Hi Subhash,
    Go to the transaction : PC00_M40_CLSTR
    here 40 stands for India. Assign the Molga number as per the country code of your payroll.
    Check if the pay roll has been run till the current period or not.
    Hope this resolves your issue.
    Regards,
    Sandeep Tudumu

  • How to Get Previous Month Salary for a particular employee?

    Hi
    I am developing a report to get the Net Pay Difference from Previous month.
    I am using logical database pnp.
    My question is how can we get the last month (Previous from current selected month) salary of perticular employee. I read the thread which is related to this but I can't understand the reply's. I think it is due to that I am new in ABAP and my experience in only 22 days. If someone reply with code example then it will more helpful for me.
    Also If you can tell me the table name from where we can get the salary of particular month of particular employee then it will also helpful for me.
    Regards
    Iftikhar

    Hi,
    Payroll data is stored in cluster tables.
    You can either use macro for retrieving the data or Function module.
    1. Use FM -CU_READ_RGDIR for getting the RG directory values.Pass  
      employee Number and molga.You will get all the sequence Numbers from this
      FM.
        The last record will be the latest  one.
    2.  Then Use FM - PYXX_READ_PAYROLL_RESULT for getting the payroll  
         results table.Pass cluster ID- 'IN'  ,pernr ,sequence number for which period
          you want (In your case ,current period minus   1) and
          READ_ONLY_INTERNATIONAL            = 'X',
    3. You will get all the results from PAYROLL_RESULT                     = it_result
      Then you can loop this internal table like LOOP at it_result-inter-rt into wa..
    Get the net pay value(/560 wage type)
    Reward points if helpful.
    Regards,
    Manoj.

  • Get previous and latest salary from IT0008 Record

    Hey guys, i am trying to develop a letter that needs to show an increment, i.e. grab the current and previous records from IT0008..
    I have tried a few things:
          CALL FUNCTION 'HR_READ_INFOTYPE'
    >> this does not get the salary i need.. but gives me dates that i used in:
          CALL FUNCTION 'RP_FILL_WAGE_TYPE_TABLE'
    >> this is returning the current salary and future salarys (we have some postdated increments in the system) but does not get me the previous no matter what i put in for dates.
    also tried:
          CALL FUNCTION 'RP_FILL_WAGE_TYPE_TABLE_EXT'
    >> same as above.
    thoughts? i want to get the last two records as they appear in Pa20/30 for IT0008.
    Thanks!
    -Jason

    Jason:
    My suggestion
    SELECT * FROM PA0008 WHERE  INTO it_0008
       PERNR EQ P_PERNR.
    SORT it_0008 BY ENDDA DESCENDING.
    READ TABLE it_0008 INDEX 1.
    MOVE it_0008 TO WA_LAST.
    READ TABLE it_0008 INDEX 2
    MOVE it_0008 to WA_PREV.
    Obvious,  wa_last and wa_prev there are work area LIKE PA0008.
    I think this can work fine.
    Regards.
    José Luis

Maybe you are looking for

  • Unique id

    Can each form submission have a unique id number assigned to it automatically?

  • Brand new iMac, and the load time for internet use is very poor

    Brought my new iMac home today. 2.7 GHz intel core i5 Got it set up with my wireless and i am very unimpressed with the internet and loading speed. My phone, 1 lap top, and 1 ipad use wireless in our house along with the iMac. i have a cisco linksys

  • Problem in script

    What is bad into my script? When I run it, everything seems to work well, the alter tablespace command appears, but the tablespace CPT_DATA is never put in begin backup mode. SET SERVEROUTPUT ON SET FEEDBACK OFF DECLARE v_ts_name    varchar2(30); sql

  • I am trying to reinstall my creative suite 3

    I am trying to reinstall my creative suite 3.  I insert disc and cannot find the setup.exe file.  It is just reading content.  I am sure it is an easy solution I am just so far out of the design and computer world that I can't figure it out.  I am ru

  • My itunes recognizes my ipod touch2g but it doesn´t let me do anything.

    my itunes recognizes my ipod touch2g but it doesn´t let me do anything to my ipod and i´ve restored it 7 times already and installed the most recent itunes