Find hierarchy of emp in compny

hi,
i wont to now how i can find who is above employee in hierarchy
in company ? (all manger above employee)
i now about RH_STRUC_GET but i dont now how to use it for this requirement
i reward
Regards

Hi ricardo,
may be i can give you an idea to broaden your scope.
you go in tcode PPIS, and under 'graphical display' select 'with persons' if you know the EE.
in the access object, you enter the highest org unit in the org unit field,
and in the display depth enter 6 which is the highest depth.
then execute it.
you will get the graphical display, from here select the object (i.e. the EE) and then go in the menu bar of graphical display where you select the 'object' and then 'display path'. you will get the whole hierarchy from the top to that particular EE in a different window.
hope this will be helpful.
reward points if it is helpful.
regards,
salman

Similar Messages

  • Need to find hierarchy  of employee

    hi,
    i wont to now how i can find who is above employee in hierarchy
    in company ?
    i now about RH_STRUC_GET but i dont now how to use it for this requirement
    i reward
    Regards

    Hi Arona,
    Very recently I had crossed this issue, Here I am pasting the code to get immediate manager of employee whome we entered as person number in input.
    Even this is late response, hope this is helpful.
    Do u have any idea to get lower hierarchy of employee,
    i.e i want the complete chain of the employee to whom he belongs.like.....
    manager-> his under employee> his under employee---> -
    > and so on..
    REPORT  ZEMP_MGR_NAME .
    TABLES: PA0001.
    DATA : BEGIN OF IT_PLANS OCCURS 0,
           PERNR LIKE PA0001-PERNR,
           PLANS LIKE PA0001-PLANS,
           SNAME LIKE PA0001-SNAME,
           END OF IT_PLANS,
           BEGIN OF IT_SOBID OCCURS 0,
           SOBID LIKE HRP1001-SOBID,
           END OF IT_SOBID,
           BEGIN OF IT_SNAME OCCURS 0,
           PERNR LIKE PA0001-PERNR,
           SNAME LIKE PA0001-SNAME,
           END OF IT_SNAME.
    DATA: P_ENDDA LIKE PA0001-ENDDA.
               P_ENDDA = SY-DATUM.
    PARAMETER : P_PERNR LIKE PA0001-PERNR.
    START-OF-SELECTION.
    REFRESH  : IT_PLANS,
               IT_SOBID,
               IT_SNAME.
    SELECT SINGLE PERNR
                   PLANS
                   SNAME
              FROM PA0001
              INTO IT_PLANS
             WHERE PERNR EQ P_PERNR
               AND ENDDA GE P_ENDDA.
    IF SY-SUBRC <> 0.
    WRITE:/ 'THERE IS NO PERSON FOR THIS INPUT'.
    ELSE.
    WRITE:/
                    IT_PLANS-PERNR,
                    IT_PLANS-SNAME.
    ENDIF.
    IF IT_PLANS IS NOT INITIAL.
    *loop at it_plans.
    SELECT SINGLE SOBID
              FROM HRP1001
              INTO IT_SOBID
             WHERE OBJID EQ IT_PLANS-PLANS
               AND OTYPE EQ 'S'
               AND PLVAR EQ '01'
               AND RSIGN EQ 'A'
               AND RELAT EQ '002'
               AND ENDDA GE P_ENDDA.
    *append it_sobid.
    *endloop.
    IF SY-SUBRC <> 0.
    WRITE:/ 'THE POSITION IS NOT MATCHING TO ANY OBJECT ID'.
    ELSE.
    ENDIF.
    IF IT_SOBID IS NOT INITIAL.
    SELECT  SINGLE PERNR
                   SNAME
              FROM PA0001
              INTO IT_SNAME
             WHERE PLANS EQ IT_SOBID-SOBID
               AND ENDDA GE P_ENDDA.
    IF SY-SUBRC <> 0.
    WRITE:/ 'THERE IS NO MANGER FOR THIS PERSON'.
    ELSE.
    *loop at it_sNAME.
    WRITE: IT_SNAME-PERNR,
           IT_SNAME-SNAME.
    *endloop.
    ENDIF.
    ENDIF.
    ENDIF.
    Rewards if helpful,
    Surender.

  • How to total Hierarchy of EMP in Scott / Tiger?

    I need to show total of each employee in front of his manager or rollup, using EMP Table, how can I ?
    Best Regards,
    Luqman

    SQL> select lpad(' ', 2*level)||ename employee
      2  ,(select count(*) from emp
      3    connect by prior empno=mgr
      4    start with mgr=e.empno) total_count
      5  from emp e
      6  connect by prior empno=mgr
      7  start with mgr is null
      8  /
    EMPLOYEE                         TOTAL_COUNT
      KING                                    13
        JONES                                  4
          SCOTT                                1
            ADAMS                              0
          FORD                                 1
            SMITH                              0
        BLAKE                                  5
          ALLEN                                0
          WARD                                 0
          MARTIN                               0
          TURNER                               0
          JAMES                                0
        CLARK                                  1
          MILLER                               0
    14 rows selected.

  • Finding hierarchy use in queries

    Hi BWExperts,
    We have Four Hiearchies on one Infoobject and the Infoobject is using several Queries.The requirement is, we would like to know which hiearchy is using in which query.Please advice is there any program or backend table exists for this.
    Thanks in advance.
    Regards,
    Preetham

    Hello,
    Have a look at this
    Identifying where a hierarchy is used
    Also
    https://wiki.sdn.sap.com/wiki/display/BI/ImportantTablesinSAPBI%28NW2004%29
    https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=35458&focusedCommentId=45993#comment-45993

  • Problem with "find" mode in adf/swing application

    Hi all,
    I'm working on ADF Swing application which uses MS SQL Server 2005 (JDeveloper 10g 10.1.3)
    I think that my issue might be well-known…sorry if it has been already discussed somewhere else…
    I have a problem with the “find” mode for a detail panel in a master-detail form…(To make it clear the “find” mode is switched on when clicking on the special button on a navigation panel).
    So this mode works well in a master panel, but it demonstrates strange behavior on a detail panel, i.e. it takes me two attempts to find the necessary child object and it doesn’t switch back in a simple way from this mode to the normal mode….say if we are in the department 10 (Dept is a master form) we can’t simply find KING employee (Emp is a detail form)…is there any workaround for this?
    Thanks in advance. Alex.

    Hi Frank, please look this issue

  • Cost Center Hierarchy in Parameter

    I am creating a program to get CO related data from the underlying database and display in ALV.  I want to have a parameter for Cost Center Hierarchy so if they want data pertaining to a certain set I can select all cost centers in a certain heirarchy.. I am unfamiliar with the tables used for this and not sure the type to use for my parameter and how to get the cost center heirarchies in the dropdown list for the parameter.  Any help would be appreciated. Thanks!

    You find hierarchy for each KOSTL in csks-KHINR. Hierarchy itself you can find in SETHEADERT-SETNAME. For building a dropdown I believe you are able to search for relevant post

  • What is the role of PRIOR in hierarchial queries

    hi all,
    what is the role of prior operator in CONNECT BY Clause of the hierarchial queries, what is the effect when it is used on the right side or left side of the condition ? almost all the queries contains this clause, if it is omitted the child values are not coming. what is the reason. plz explain.
    please check the following outputs:
    SQL> select ename,sys_connect_by_path(ename,'\') hierarchy from emp start with ename='KING' connect by empno = mgr;
    ENAME HIERARCHY
    KING \KING
    Elapsed: 00:00:00.04
    SQL> select ename,sys_connect_by_path(ename,'\') hierarchy from emp start with ename='KING' connect by prior empno = mgr;
    ENAME HIERARCHY
    KING \KING
    JONES \KING\JONES
    SCOTT \KING\JONES\SCOTT
    ADAMS \KING\JONES\SCOTT\ADAMS
    FORD \KING\JONES\FORD
    SMITH \KING\JONES\FORD\SMITH
    BLAKE \KING\BLAKE
    ALLEN \KING\BLAKE\ALLEN
    WARD \KING\BLAKE\WARD
    MARTIN \KING\BLAKE\MARTIN
    TURNER \KING\BLAKE\TURNER
    JAMES \KING\BLAKE\JAMES
    CLARK \KING\CLARK
    MILLER \KING\CLARK\MILLER
    14 rows selected.
    Elapsed: 00:00:00.09
    SQL> select ename,sys_connect_by_path(ename,'\') hierarchy from emp start with ename='KING' connect by empno = prior mgr;
    ENAME HIERARCHY
    KING \KING
    Elapsed: 00:00:00.06
    SQL>
    thanks and regards,
    sri ram.

    Hi, Sri Ram,
    Sri Ram wrote:
    hi all,
    what is the role of prior operator in CONNECT BY Clause of the hierarchial queries, "PRIOR x" means a value of x from one of the rows that were added to the result set at the previous level.
    what is the effect when it is used on the right side or left side of the condition ? There is no difference between
    CONNECT BY  PRIOR  x  = yand
    CONNECT BY  y  = PRIOR  xjust like there is no difference between
    WHERE  x  = yand
    WHERE  y  = x
    almost all the queries contains this clause, No, most queries do not contain a CONNECT BY clause.
    Most queries that have a CONNECT BY clause do use a PRIOR operator.
    if it is omitted the child values are not coming. what is the reason. plz explain.No, that's not true. A common example is a Counter Table :
    SELECT  SYSDATE + LEVEL - 1
    FROM    dual
    CONNECT BY  LEVEL  <= 7;
    please check the following outputs:
    SQL> select ename,sys_connect_by_path(ename,'\') hierarchy from emp start with ename='KING' connect by empno = mgr;
    ENAME HIERARCHY
    KING \KING
    Elapsed: 00:00:00.04
    SQL> select ename,sys_connect_by_path(ename,'\') hierarchy from emp start with ename='KING' connect by prior empno = mgr;
    ENAME HIERARCHY
    KING \KING
    JONES \KING\JONES
    SCOTT \KING\JONES\SCOTT
    ADAMS \KING\JONES\SCOTT\ADAMS
    FORD \KING\JONES\FORD
    SMITH \KING\JONES\FORD\SMITH
    BLAKE \KING\BLAKE
    ALLEN \KING\BLAKE\ALLEN
    WARD \KING\BLAKE\WARD
    MARTIN \KING\BLAKE\MARTIN
    TURNER \KING\BLAKE\TURNER
    JAMES \KING\BLAKE\JAMES
    CLARK \KING\CLARK
    MILLER \KING\CLARK\MILLER
    14 rows selected.
    Elapsed: 00:00:00.09
    SQL> select ename,sys_connect_by_path(ename,'\') hierarchy from emp start with ename='KING' connect by empno = prior mgr;
    ENAME HIERARCHY
    KING \KINGOkay, I checked them. I get the same results. Did you have a question about them?

  • Unique constraint violation - Finding inserted row before commit

    Hi,
      I have a scenario something like that, where I need to insert a row to a table - contact, for different employees under different department. So I happen to insert same employee contact multiple times & do commit at the last if there is no contact in the table. How to find out if the same employee record is already inserted ?.
    The unique constraints is on emp id + depatment id in the contact table. So I face the issue when i do the commit, it finds the same emp id + dept id contact has been inserted multiple times.
    Please let me know how to handle it?
    Regards,
    Dhamo.

    Hi
    What is exactly what you want to achieve? Do you want to display a message to the user? Do you want to prevent it to post the contact if it already exists?
    Regards

  • Mounted .iso file shows in Disk Utility, but inaccesible through finder

    Hello.
    I have an .iso file that used to mount flawlessly, but now when double clicked shows only in Disk Utility, while remaining inaccesible otherwise (finder hierarchy starting from computer should show all mounted drives, but this one is missing). Disk Utility doesn't find any errors. Is there any other way to find out what's wrong?
    thanks

    Do know the name of any file that is on the iso image? If so, do a Spotlight search on the file name and see if it show up. If it does, Command click on the result in the Spotlight list and see if the enclosing folder opens in Finder.
    Francine
    Francine
    Schwieder
    PS--Forgot to aske: when you said "shows in Disk Utility" I'm assuming it is shown not just as existing, but as being mounted.
    Message was edited by: Francine Schwieder

  • Delete from an 1-N relationship

    Hello,
    I am still new to EJB3.0 however I try to get it running. My Problem right now is, that I have two entities. One is Company, the other one Employee. The Employee is stored in a List in the Company class. Furthermore I have Facade for the Company and I try to build a little client using JSPs. (The JSP is Quick'n'Dirty - refactorings are going to come).
    My problem is, that when I delete an Employee from the Company, the Client acts like it is deleted, however if I check the database, the change hasn't been stored there. What do I have to do, that the changes made in the list, which is part of the company, will be passed to the database.
                //button  delete has been pressed
                if(request.getParameter("delete") != null)
                    //since it is a list, the amount of elements in the list is passed to this JSP
                    int empSize = Integer.parseInt(request.getParameter("empSize"));       
                    //All list elements are checked if they are supposed to be deleted
                    for(int i = 0; i < empSize; i++)
                        //just the marked list element will be deleted
                        if(request.getParameter("check"+i) != null)
                            employees.remove(i);
                    //the new list with the employees will be stored in the company instance
                    company.setEmps(employees);
                    //the facade pattern merges thes new and the old company (or it doesn't)
                    compFacadeRemote.edit(company);
                }And there is the Facade - nothing fancy here
    @Stateless(mappedName="jms/CompanyFacade")
    public class companyFacade implements companyFacadeRemote {
        @PersistenceContext
        private EntityManager em;
        public void create(Company company) {
            em.persist(company);
        public void edit(Company company) {
            em.merge(company);
            em.flush();
        }

    Taggert_77 wrote:
    See - it is not that I don't know of Java Persistence - I just wanted to make sure that I got you right. The book Enterprise JavaBeans3.0 by O'Reilley I read already. The thing is I am just a rookie in writing EJBs, and there is a lot of stuff I did read however I did forget a lot too - JEE5 is just a huge topic.
    Like I said, I am very new to EJBs and I justed wanted to make sure that I got you right, thats all. The other thing is, that a want to become really good at EJBs, so even if something works, I might ask some "dumb" questions - please forgive me.
    But back to the coding part. I changed the methode in the Facade, so that the logic is now in the bean, and the Entity-Call is now atomic.
    public void deleteEmployee(Object employeeId)
    Employee emp  = em.find(Employee.class, employeeId);
    Company company =  em.find(Company.class, emp.getCompany.getId());
    em.remove(account);
    em.refresh(company);
    }Like you said, there is no merging anymore - through the find()-call the Entity is no longer detached. The only thing that looks awkward to me is the way I got the company-instance.
    The next thing is about the refresh - it seemed natural to me, to use it here, but if the company is managed, isn't the container doing it instead, and when is the container doing it?
    Just give me a little feedback.
    Thank you very much for your help, your thoughts and your patience - I know I am a hassleNow we're talking. You gave me the idea you had no clue what was happening.
    The fetching of the company is not needed as it seems: when it is fetched as part of the employee, it is already a managed instance, so you don't need to fetch it again (most likely the entity manager won't do it either, as the entity is still in its cache).
    You don't need to refresh. A refresh is only needed when the company would change outside of the current transaction. This might happen if you have nested new transactions, which is not happening in your case. If however you want to continue to use the company in the current transaction, you have to remove the employee entity from its internal list yourself; JPA does not automatically do that.

  • Errors executing SQL query in EJB 2.0 QL using RAD-6.0 on WAS-6.0

    I have 3 tables in my database which is running on DB2 UDB ESE V-8.2
    The tables are emp, dept & policy_master respectively
    Table emp has columns id, name, deptid, and policyid.Here dept id and policyid are foreign keys which are referenced by dept and policy_master tables
    In the dept table column deptid is primay key and non-key is dept name
    In my policy_master table i have column policyid as primay key and non-key column is policy name
    Now i want to find records in emp table by deptid column in emp table which should return a emp local interface
    Now for that i had written ejbql "select object(o) from emp o where o.deptid=?1" using finder method namely findByDeptid(String deptid) in emp entity bean.
    When i execute the entity bean using RAD Test Client,I am getting following 2 errors namely:
    1. "WQRY0036E: Emp o does not have a field deptid in ejb-jar.xml "
    2. "Class must implement the inherited abstract method CMPEmpLocalHome.findByDeptid(String) EJSLocalCMPEmpHome_0783c8c6.java TestEJB/ejbModule/sample"
    When i analysed the problem i found that the deptid in emp bean is not defined as a CMP field in the map file & deployment descriptor that is why i am not able to write such kind of ejb queries.The deptid field in emp table is having a foreign key relationship with dept table.
    Detailed Discription of tables structure
    Table EMP
    Column name Type name Length Scale Nulls
    EMPID VARCHAR 4 0 No (Primary Key)
    FIRSTNAME VARCHAR 10 0 Yes
    LATSNAME VARCHAR 10 0 Yes
    DEPTID VARCHAR 4 0 No (Foreign Key Refrenced By Dept Table)
    POLICY_ID VARCHAR 10 0 No (Foreign Key Refrenced By Policy Master Table)
    Table DEPT
    Column name Type name Length Scale Nulls
    DEPTID VARCHAR 4 0 No (Primary Key)
    DEPTNAME VARCHAR 10 0 Yes
    DEPTLOCATION VARCHAR 10 0 Yes
    Table POLICY_MASTER
    Column name Type name Length Scale Nulls
    POLICY_ID VARCHAR 10 0 No (Primary Key)
    POLICY_NAME VARCHAR 10 0 Yes
    Now I want to find all record using findByDeptid method in EMP table. So for that what ejb ql I have to write.
    I used "select object(o) from emp where deptid=?1" then I am getting error in "ejb-jar.xml" that field does not exist.
    So please tell me how can I find records in emp table so that the bean returns a local interface.
    Please provide some assisstance as soon as possible
    Thanks in Advance,
    Mahesh.B.S

    I have 3 tables in my database which is running on DB2 UDB ESE V-8.2
    The tables are emp, dept & policy_master respectively
    Table emp has columns id, name, deptid, and policyid.Here dept id and policyid are foreign keys which are referenced by dept and policy_master tables
    In the dept table column deptid is primay key and non-key is dept name
    In my policy_master table i have column policyid as primay key and non-key column is policy name
    Now i want to find records in emp table by deptid column in emp table which should return a emp local interface
    Now for that i had written ejbql "select object(o) from emp o where o.deptid=?1" using finder method namely findByDeptid(String deptid) in emp entity bean.
    When i execute the entity bean using RAD Test Client,I am getting following 2 errors namely:
    1. "WQRY0036E: Emp o does not have a field deptid in ejb-jar.xml "
    2. "Class must implement the inherited abstract method CMPEmpLocalHome.findByDeptid(String) EJSLocalCMPEmpHome_0783c8c6.java TestEJB/ejbModule/sample"
    When i analysed the problem i found that the deptid in emp bean is not defined as a CMP field in the map file & deployment descriptor that is why i am not able to write such kind of ejb queries.The deptid field in emp table is having a foreign key relationship with dept table.
    Detailed Discription of tables structure
    Table EMP
    Column name Type name Length Scale Nulls
    EMPID VARCHAR 4 0 No (Primary Key)
    FIRSTNAME VARCHAR 10 0 Yes
    LATSNAME VARCHAR 10 0 Yes
    DEPTID VARCHAR 4 0 No (Foreign Key Refrenced By Dept Table)
    POLICY_ID VARCHAR 10 0 No (Foreign Key Refrenced By Policy Master Table)
    Table DEPT
    Column name Type name Length Scale Nulls
    DEPTID VARCHAR 4 0 No (Primary Key)
    DEPTNAME VARCHAR 10 0 Yes
    DEPTLOCATION VARCHAR 10 0 Yes
    Table POLICY_MASTER
    Column name Type name Length Scale Nulls
    POLICY_ID VARCHAR 10 0 No (Primary Key)
    POLICY_NAME VARCHAR 10 0 Yes
    Now I want to find all record using findByDeptid method in EMP table. So for that what ejb ql I have to write.
    I used "select object(o) from emp where deptid=?1" then I am getting error in "ejb-jar.xml" that field does not exist.
    So please tell me how can I find records in emp table so that the bean returns a local interface.
    Please provide some assisstance as soon as possible
    Thanks in Advance,
    Mahesh.B.S

  • 0COSTCENTER_0101_HIER problem

    Hi,
    I have BW 3.5 system and there are two R/3 systems connected to it - System A and System B.
    Currently extraction for COSTCENTER - Attributes, Texts and Hierarchies works fine from System A.
    Now, I want to extract only COSTCENTER - Hierarchies from System B.
    When I'm trying to assign 0COSTCENTER_0101_HIER datasource from System B to 0COSTCENTER infosource, i'm able to save it but not able to activate it. While saving it asks me a transport request and under the transport request it comes under Object Directory Entry.
    After transporting this to Test BW system, i'm unable to find Hierarchy Datasource for (Test)System B.
    I also tried to collect this datasource under Transport connection > Datasource.
    But even this transport request didn't work.
    Am I missing any step? Is it compulsory to load Master data attributes and Texts from R/3 system if I want to load Hierarchies? Because we are planning to upload COSTCENTER Attributes and Texts through flat file and Hierarchies from R/3 system.
    Thanks in advance for your inputs...
    Regards,
    Sarkar
    Edited by: Sarkar on Apr 4, 2008 7:52 AM

    Hi Sarkar,
    Plz refer to the below SAP Note which is very similar to ur issue...
    SAP Note Number: 623170:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_bw_bct/~form/handler%7b5f4150503d3030323030363832353030303030303031393732265f4556454e543d444953504c4159265f4e4e554d3d363233313730%7d
    Also check the below forums for your reference...
    0COSTCENTER_0101_HIER  problem
    Unable to see the Hierarchies in BW of R/3!!!
    Assign points if these helps u...
    Regards,
    KK.

  • Query with two where conditions

    HI
    SELECT ENAME FROM EMP WHERE
    SAL > 1000 AND JOB='CLERK';
    How to implement in CMP(Entity bean)
    thank u

    at this point mapping to do this king of query would be on the container specific file. I will tellyou how this is done on a Orion App server. I bet that others are close to the same.
    first you make a finder method in your bean for the enploy name:
    Collection findBigClerk();
    Orion generates a file from the ejb-jar.xml file called orion-ejb-jar.xml. this is where the O/R mapping is changed for the beans.
    each method in a bean has short definition
    <finder-method query="EMP.SAL>1000 and EMP.JOB='CLERK'">
    Assuming that the CMP is mapped to the EMP table when you call findbigClerk it will add the above query to as a WHERE clause.
    Then get the name from the interface.
    Again, this is how I would do this on an Orion App server. Others will be simular until O/R mapping is moved from server-specific to the ejb-jar.xml file
    hope this helps a little

  • Mystery disk images

    Last June I experimented with burning a CD from a disk image. Since then, two disk images have sat in the sidebar of Disk Utility. They can be opened to volumes on the desktop, and the volumes have songs that can be played.
    Those disk images have no unique identifiers. Their paths are /Volume/diskname1.dmg and /Volume/diskname2.dmg. Spotlight can't find them. I guess they aren't in the Finder hierarchy.
    How did they get stored that way? Can I delete them? Can I store them like my other disk images, where Spotlight could find them?

    Try this:
    1. In the Finder's Go menu bar item select the "Go to Folder..." option
    2. Type this in the box:
    /Volumes/
    and click the Go button
    3. The Finder window that opens should contain aliases to your mounted volumes, if it also has the errant .dmg files you can drag them to your Desktop, and then do whatever you want with them.
    Francine
    Francine
    Schwieder

  • Chart (Graph) Font Name - Formatting Formula

    Hi,
    I am displaying chart in report, and I have requirement to select (format) font name with some condition (e.g.. As per database language, if database is english - Font Name: "Times New Roman", if database version is Spanish - Font Name: "Arial" etc.)
    Currently I am trying to add "Font Name" formula for x-axis in Graph by "Formula Fields -> Formatting Formulas -> Report Footer -> Report Footer A -> Graph2" and Right click "New Font Formula -> Font Name -> Use Editor", but nothing happens. I tired and noticed It works for "Background Color" .
    Please let me know, how can I add Font Name formula for Graph.
    Note: I am working with Crystal XI
    Edited by: loveuhameshah on May 31, 2011 8:18 PM

    Vamsee,
    Thanks for your reply.
    You are right, I also want to format x-axis field values but how can I reach (access) to "x-axis" field formatting formula for Graph. In Formula Workshop I can find hierarchy upto Graph level only, I cannot find any node such as X-axis, Y-axis under it.
    [Image|http://i837.photobucket.com/albums/zz297/essenceofarts/Graph-format-font.jpg]
    Looking forward to any suggestion or help.
    Thanks,

Maybe you are looking for