Calculating DIrect and indirect reports for managers

Hi,
I have a flattened manager hierarchy. I want to calculate the direct and indirect reports for every manager. how can i do this.
Thanks
Edited by: user599926 on Apr 18, 2010 4:01 PM

I've never worked with Access as a database, before.  But, if this were SQL (and it might work), then, yes, a LEFT OUTER JOIN would do the trick.
SELECT ta.Lastname, ta.Firstname, ta.EmpID, ta.MgrEmpID, ta.Email, ta.Location
FROM TableA ta LEFT OUTER JOIN TableA tb ON tb.MgrEmpID = ta.EmpID
ORDER BY ta.Lastname, ta.Firstname, tb.Lastname, tb.FIrstname
Or something like that.
^_^

Similar Messages

  • SQL that provides direct and Indirect reports

    SELECT DISTINCT J.EMPLID ,J.EMPL_RCD ,A.NAME ,J.BUSINESS_UNIT ,J.JOBCODE ,JC.DESCR ,J.DEPTID ,D.DESCR
    ,J.SUPERVISOR_ID ,J.REPORTS_TO ,J.LOCATION ,J.COMPANY ,J.PAYGROUP ,J.GP_PAYGROUP ,ED.WORKGROUP ,ED.TASKGROUP
    ,J.POSITION_NBR ,L.BUILDING, WG.INCL_ML_BRK_FLG
    FROM PS_JOBCODE_TBL JC , PS_JOB J , PS_TL_EMPL_DATA ED, PS_TL_GROUP_DTL F ,PS_TL_GRP_SECURITY S
    ,PS_PERSON_NAME A , PS_DEPT_TBL D, PS_LOCATION_TBL L, PS_TL_WRKGRP_TBL WG
    WHERE S.GROUP_ID = F.GROUP_ID
    AND F.EMPLID = J.EMPLID
    AND F.EMPL_RCD = J.EMPL_RCD
    AND F.EMPLID = A.EMPLID
    AND F.EMPLID = ED.EMPLID
    AND F.EMPL_RCD = ED.EMPL_RCD
    AND S.ROWSECCLASS = 'DPALL'
    AND J.EFFDT = ( SELECT MAX(J1.EFFDT) FROM PS_JOB J1
    WHERE J1.EMPLID = J.EMPLID
    AND J1.EMPL_RCD = J.EMPL_RCD
    AND J1.EFFDT <= '22-MAY-2012')
    AND J.EFFSEQ = ( SELECT MAX(J2.EFFSEQ) FROM PS_JOB J2
    WHERE J2.EMPLID = J.EMPLID
    AND J2.EMPL_RCD = J.EMPL_RCD
    AND J2.EFFDT = J.EFFDT )
    AND ED.EFFDT = ( SELECT MAX(ED1.EFFDT) FROM PS_TL_EMPL_DATA ED1
    WHERE ED1.EMPLID = ED.EMPLID
    AND ED1.EMPL_RCD = ED.EMPL_RCD
    AND ED1.EFFDT <= '22-MAY-2012')
    AND JC.SETID = J.SETID_JOBCODE
    AND JC.JOBCODE = J.JOBCODE
    AND JC.EFFDT = ( SELECT MAX(JC1.EFFDT) FROM PS_JOBCODE_TBL JC1
    WHERE JC1.SETID = J.SETID_JOBCODE
    AND JC1.JOBCODE = J.JOBCODE
    AND JC1.EFFDT <= '22-MAY-2012')
    AND D.SETID = J.SETID_DEPT
    AND D.DEPTID = J.DEPTID
    AND D.EFFDT = ( SELECT MAX(D1.EFFDT) FROM PS_DEPT_TBL D1
    WHERE D1.SETID = J.SETID_DEPT
    AND D1.DEPTID = J.DEPTID
    AND D1.EFFDT <= '22-MAY-2012')
    AND L.SETID = J.SETID_LOCATION
    AND L.LOCATION = J.LOCATION
    AND L.EFFDT = ( SELECT MAX(EFFDT) FROM PS_LOCATION_TBL
    WHERE SETID = L.SETID
    AND LOCATION = L.LOCATION
    AND EFFDT <= '22-MAY-2012')
    AND J.SUPERVISOR_ID LIKE '76634%'
    AND A.EMPLID <> '76634'
    AND ED.WORKGROUP = WG.WORKGROUP
    AND WG.EFFDT = (SELECT MAX(WG1.EFFDT) FROM PS_TL_WRKGRP_TBL WG1
    WHERE WG.WORKGROUP = WG1.WORKGROUP
    AND WG1.EFFDT <= '22-MAY-2012'
    AND J.EMPL_STATUS IN ('A','L','P','S')
    AND J.EFFDT <= '20-MAY-2012');
    Above SQL provides me the list of employees (only direct reports) who report to EMPLID 76634. Now I want to modify this SQL so that It will also provide me the list of employees from a lower level (indirect reports).
    For example, if employees 1, 2 report to 76634. And 3,4 report to 1. And 5,6 report to 2. I want to modify the above SQL such that it will retrieve both direct and indirect reports for 76634 i.e 1,2,3,4,5 and 6.
    As of now above SQL will retrieve only 1,2. Any thoughts?

    SQLServer uses a recursive query for this.
    Just typing "SQLServer recursive query" in a search engine will provide you with tons of examples, but I will redirect you to the source MSDN,
    http://msdn.microsoft.com/en-us/library/ms175972%28SQL.90%29.aspx
    Look for the following example
    D. Using a recursive common table expression to display multiple levels of recursion
    The following example shows the hierarchical list of managers and the employees who report to them.
    USE AdventureWorks;
    GO
    WITH DirectReports(ManagerID, EmployeeID, EmployeeLevel) AS
    SELECT ManagerID, EmployeeID, 0 AS EmployeeLevel
    FROM HumanResources.Employee
    WHERE ManagerID IS NULL
    UNION ALL
    SELECT e.ManagerID, e.EmployeeID, EmployeeLevel + 1
    FROM HumanResources.Employee e
    INNER JOIN DirectReports d
    ON e.ManagerID = d.EmployeeID
    SELECT ManagerID, EmployeeID, EmployeeLevel
    FROM DirectReports ;
    GO

  • Finding direct and indirect dependency

    Hi,
    I have table say SAPECC, which is used in one of the procedure as given below :
    create or procedure test121
    as
    begin
    insert into sapecc2
    select * from sapecc;
    end;
    And SAPECC2 is used in another procedure as given below :
    create or procedure test122
    as
    begin
    insert into sapecc3
    select * from sapecc2;
    end;
    Now if I want to get what are the direct and indirect dependency for SAPECC, how can we get that? Say I want to see TEST121 procedure and SAPECC2 table are the 1st level dependency for SAPECC and TEST122 procedure and SAPECC3 table are the 2st level dependency for SAPECC.
    Regards,
    Koushik

    Hi Koushik,
    There are no dependencies as you describe them between the sapeccX tables.
    SQL> select level
              ,name
              ,type
              ,referenced_name
              ,referenced_type
          from user_dependencies
    start with referenced_name like 'SAPECC%'
    connect by prior referenced_name = name
    LEVEL NAME         TYPE         REFERENCED_N REFERENCED_T
        1 TEST121      PROCEDURE    SAPECC       TABLE      
        1 TEST121      PROCEDURE    SAPECC2      TABLE      
        1 TEST122      PROCEDURE    SAPECC2      TABLE      
        1 TEST122      PROCEDURE    SAPECC3      TABLE      
    4 rows selected.I don't know about 11g and PL/Scope maybe you can get something from there.
    As a final resort you can play with user_source:
    select *
      from user_source
    where name like 'TEST%';Regards
    Peter

  • Direct and Indirect

    Hi:
    can someone tell me whats the difference between direct and Indirect reports in SRM-BW.
    whats the functionality of them.
    how to figure out them
    where to find them, any T-codes, tables will of great help.
    it would be great if some one can tell the relation between R/3 PO and a SRM PO
    Thanks
    kedar

    Hi,
    If I understood Your question about direct and indirect reporting in SRM-BW.
    Direct reporting it is a SAP RemoteCube in BW. RemoteCube is and InfoProvider. This is a special RemoteCube that allows You to define queries with direct access to transaction data in other SAP systems. RemoteCubes are defined on the basis on an InfoSource with flexible updating, and assume the characteriscics and key figures of the InfoSource.
    Indirect reporting is like standard BW reporting with master data, transactional data, attributes and hierarchies.
    All BI content You may find in transaction RSA6 on SRM side.
    There is not many difference between SRM and R/3 PO's. On both side you may create PO from SC, PO with direct or indirect material etc.
    Please look into service.sap.com/instguides -> SRM -> Plan-Driven Procurement and Self-Service Procurement
    Regards,
    Marcin

  • Getting direct reporting and indirect reporting employee

    Hi,
    In one of my development, their is a requirement to have a screen of type Tcode PPMDT.
    My screen will be having tab strip for direct and indirect employee and on both tabs org structure will be displayed.
    I am using function module RH_STRUC_GET to get the org structure details. I need to know the logic of separating direct reporting employee from indirect reporting employee from the data returned from function module.
    Thanks
    Vishal Kapoor

    Hi,
    In one of my development, their is a requirement to have a screen of type Tcode PPMDT.
    My screen will be having tab strip for direct and indirect employee and on both tabs org structure will be displayed.
    I am using function module RH_STRUC_GET to get the org structure details. I need to know the logic of separating direct reporting employee from indirect reporting employee from the data returned from function module.
    Thanks
    Vishal Kapoor

  • Difference between Crsytal Report 2011 and Crystal Report for Enterprise 4

    difference between Crystal Report 2011 and Crystal Report for Enterprise 4.0?
    I think Crystl Reprt 2011 has more function, is it right?

    Hi,
    I recently attended a SAP Virtual trianing on SAP Business Objects BI 4.0.
    Here are few extracts from that which probably shows some light to you:
    SAP Crystal Reports 2011
    1. UI and associated processing servers remain the same as CR 2008
    2. Incremental update to CR 2008 with a few new features*
    3. Continue to provide current CR 2008 functionality as-is for existing customers
    SAP Crystal Reports for Enterprise 4.0
    1. Major update & redesign of the Crystal Reports Designer and associated processing servers
    2. Focus on streamlined report design, reporting against BI 4.0 Universe, & reporting against SAP BW data
    3. Provide the foundation for all future releases of Crystal Reports
    Differences between these two releases:
    Data Source & Usage Type                                       General Recommendation
    1. SAP BusinessObjects BI 4.0                                        SAP Crystal Reports Relational Universe (UNX) for Enterprise
    OLAP Universe (UNX)
    2. SAP NetWeaver BW 7 BEx Query (BICS)                    SAP Crystal Reports for Enterprise
    3. SAP NetWeaver BW 3.5 BEx Query                             SAP Crystal Reports 2011
    4. SAP Profitability Cost Management                              SAP Crystal Reports for Enterprise through Analysis View
    SAP Strategy Management
    SAP Budget, Planning and Consolidation
    SAP Extended Analytics
    5. Platform Driven Alerting                                                SAP Crystal Reports for Enterprise
    6. Business Views                                                           SAP Crystal Reports 2011
    7. Direct RDBMS or OLAP access                                    SAP Crystal Reports 2011
        SAP ERP/ Live Office Content/
        Enterprise search content
    Regards
    Gowtham

  • Which Function Module can find all direct and indirect subordinate.

    Hi,
        I have a employee number(Chief of a organizational unit A). Do you know which function module can get all the direct and indirect subordinate of this chief? Indirect subordinate means that this chief can also view the Organizational unit(for example, Org. unit B) that under Org. Unit A. Further more, this chief can also view all the employees in other org unit that under Org. Unit B. If there is no such function module, do anyone of you have the example coding to get it? Your help is greatly appreciated. Thanks.

    use RH_STRUC_GET
    ~Suresh

  • How to find both direct and indirect responsibilites attached to user

    Hi All,
    I have a requirement to write a sql to list all direct and indirect responsibilities attached to a particular user.
    Please help me.
    Thanks,
    Raghav.

    Hi;
    Pelase see below which could be helpful for your issue:
    responsibilty -to find any users assigned
    to find any users assigned to a responsibilty
    Regard
    Helios

  • Help on Direct and Indirect Exchange Rate formula

    Dear Experts,
    As per subject, can anyone write the formula of how both "direct" and "indirect" exchange rate calculation works in SAP B1?
    Warmest Regards,
    Chinho

    Hi Chinho,
    Direct: X units of local currency (LC) = 1 unit of foreign currency (FC)
    Indirect: 1 unit of LC = X units of FC
    Therefore, considert his example:
    LC = EUR
    FC = GBP
    GBP Rate is set as 1.23
    Document total = GBP 10.00
    GBP 10.00 = EUR 12.30 when using the 'Direct Method' (1.23 EUR = 1 GBP)
    GBP 10.00 = EUR 8.13 when using the 'Indirect Method' (1 EUR = 1.23 GBP)
    All the best,
    Kerstin

  • How to install the EUL5 Business Area and seeded reports for Ora Apps 11i

    Hi All,
    We have to install the EUL5 Business Area and seeded reports for Ora Apps 11i.
    I think there are scripts which need to be executed to create the BA and the Disco seeded reports. I am kind of confused about the whole think. Any pointers as to where to look foe the scripts would be really appreciated.
    I am using disco version 10.1.2.48.18.
    Thanks.

    Hi,
    You need to work though Metalink Note 313418.1.
    Rod West

  • Can I get from iConnect financijal and statistic report for single Newsstand application ?

    I have problem to get full financial and statistic report for one single application?
    Is there a posibilty thay kind of report doesn/t exist?
    I can't belive...!

    Welcome to AppleWorks, a discontinued application. I'll try to get you to the iPad forum.

  • What r the direct and indirect taxes

    hi gurus,
    can any one pls give me what r the direct and indirect taxes.
    Thanks in advance,
    RAVI
    Moderator: Please, respect SDN rules. As it's not your first warning, upon next violation your user will be banned

    Hi,
    the Tax tht we Pay directly to Govt is Direct tax and tax tht we pay indirectly is Indirect tax. Ex. Income tax on  salaries is direct tax and Sales Tax on Products is a indirect Tax.
    Hope you got clarify on the Both type of Taxes.
    Thanks
    Goutam
    Edited by: Goutam78 on May 27, 2011 3:07 PM

  • Direct and Flexible loading for  Attributes for a Info-object?

    Dear all,
          Is it possible to have both Direct and Flexible update for  Attributes of an Info-object from two different data sources from the same source system(R/3)  . The reason being that the first data source can not be extended in R/3.
    When this scenario is tried For Flexible loading The data loading  is not successful in BW.No errors/dumps found.
    Regards,
    Amu

    In this case I start and activate the whole data flow again to hopefully get an error message. If this still has no success I'd open an OSS message. Even if you have made a mistake you should get an error message somewhere.
    Some other places you might check:
    SM50 to see if the job is still running
    DB02 to see DB locks and tablespace problems
    Best regards
       Dirk

  • Setup and configuration for system monitoring and IT Reporting for Java sys

    Hi all,
    How to setup and configuration for system monitoring and IT Reporting for Java system ?
    How to connect Java system to Solman system?
    Regards,
    Neni

    HI,
    What is your OS? You can use SAPCCMSR.exe to monitoring  IT Reporting Java system on Solman.
    Go to solman rz21 create a csmreg user. and configuration fil for agent. copy configuration fil on usr/sap/ccms/..
    Go to comman line cd ../user/sap/xxx/sys/exe/.../ wite SAPCCMSR.00 -R pf=< ...../sys/profile/instans profile> .
    You can se agent on rz10 and use this connaction on rz20 to monitoring and IT Reporting Java system on Solman.
    I hope this help

  • Report for consumption for direct and indirect

    Can any body reply for if any consumption report is available for following requirement(1+2).
    1) Matl recd and issued to Prod order.
    2) Matl recd and at GR itself consumed for production (PO with acc assignment).
    so is there any report that will give me consumption report for the material for combination of above two.
    Regards,
    SDN Browser
    Edited by: Sdn Browser on Jan 12, 2010 7:15 AM

    Hi
    hi,
    go to MB51 and enter the movent types shown below for issues or consumption, then you will get list of all documents related to consuptions.
    201-consumption for cost centrer
    221-consumption for project
    231-consumption for sales order
    241-consumption for assest
    251-consumption for sales
    261-consumption for order
    281-consumption for network
    291-consumption for all account assignments.
    Vipin

Maybe you are looking for

  • Error while doing asset acquisition

    Hi Friends I am tryin to post an asset acquisition but gettin the following error- Contact your system administrator (table error) Message no. AA824 Diagnosis No accounts have been entered for depreciation area 01 for account allocation 11000 (chart

  • COproduct

    Dear All, In our client side, THey maintain coproduct in one case.. THey have auto GR option.. But auto GR is not happening successfully... please help in sorting this out.. karthick

  • Essbase Issue temp file location.

    Is there a way to change the location where Essbase writes a temp file when data load(text file) is being done. It usually writes to Windows Temp location. Also will Essbase writies similar temp file when data is loaded from sql too? If anyone are fa

  • Netinfo manager users are listed on my login screen

    Recently I found unknown users showing up my login screen along with my regular accounts. I searched around and found them in Netinfo manager: amavisd, clamav and others are listed on my login screen. They have network backgrounds as part of their pi

  • ABAP RICEF Estimating Guidelines

    Hi all - I am looking for ABAP estimating guidelines for RICEF development.  Typically in the past I have categorized development objects as low, medium, high very high complexity and attached total days effort to each.  If anyone has formalized docu