Org unit head of an org unit of an employee

Hi all,
I want to create an abap program where i have the personal number of a person. Now i want to find the org unit of that person, which I will find from PA0001. Now i want to get the position of the manager or the head of that org unit and from that position I want to get the holder of that position ( pernr) and ultimately the name of that person.
Can anyone help me with the CODING of the above problem?
Can anyone provide me a sample code for it.
Thanks
Ribhu

Refer this Function Module, it wil give u the immediate manager name of a employee number, u can call this in a ABAPProgram after creating it or u can copy this code and paste it in a ABAP program.
FUNCTION ZGILL_APPROVER.
*"*"Local interface:
*"  IMPORTING
*"     REFERENCE(PERNR) TYPE  PERSNO
*"  EXPORTING
*"     REFERENCE(NAME) TYPE  PAD_CNAME
*"  EXCEPTIONS
*"      NO_DATA
DATA: ls_sobid1 TYPE sobid,
      ls_sobid2 TYPE sobid,
      ls_sobid3 TYPE sobid,
      vorna type PAD_VORNA,
      nachn type PAD_NACHN.
  SELECT SINGLE sobid FROM hrp1001 INTO ls_sobid1
   WHERE otype = 'P'
   and   plvar = '01'
   AND   objid = pernr
   AND   endda >= sy-datum
   AND   begda <= sy-datum
   AND   rsign = 'B'
   AND   relat = '008'.
IF sy-subrc EQ 0.
SELECT SINGLE sobid FROM hrp1001 INTO ls_sobid2
   WHERE otype = 'S'
   and   plvar = '01'
   AND   objid = ls_sobid1
   AND   endda >= sy-datum
   AND   begda <= sy-datum
   AND   rsign = 'A'
   AND   relat = '002'.
IF sy-subrc EQ 0.
SELECT SINGLE sobid FROM hrp1001 INTO ls_sobid3
   WHERE otype = 'S'
   and   plvar = '01'
   AND   objid = ls_sobid2
   AND   endda >= sy-datum
   AND   begda <= sy-datum
   AND   rsign = 'A'
   AND   relat = '008'.
IF sy-subrc EQ 0.
SELECT SINGLE vorna nachn from pa0002 INTO (vorna , nachn)
   WHERE pernr = ls_sobid3
   AND   endda >= sy-datum
   AND   begda <= sy-datum.
IF sy-subrc EQ 0.
Concatenate vorna nachn into name separated by SPACE.
condense name.
else.
Raise NO_DATA.
endif.
else.
Raise NO_DATA.
endif.
else.
Raise NO_DATA.
endif.
else.
RAISE no_data.
endif.
ENDFUNCTION.

Similar Messages

  • HR Data Synchronization (Org Unit, Position and Employee) to SRM

    Hi All Expert,
    Currently, I had replicate the HR data (Org Unit, Position and Employee) to SRM thru transaction PFAL.
    Each time there is a new position or new employee, I have to run PFAL and run manually by include the new position number or new employee into the program to replicate to SRM.
    Does SAP have any specifiy program or step which I have follow to allow such automation? Is there any variant that I could set?
    How to trigger the new Org units which are created in HR to replicate to SRM without any manual input into selection field of Object ID during running the PFAL?
    We are trying to achieve automation of synchronization between changes/new  creation in HR to replicate to SRM.
    Thank for your help.
    Paul

    Hello Paul,
    Below notes will surely help you..
    1.The composite note for the process is 390380 - HR/ALE distribution in EBP/SRM.
    2.The initial description of the process can be found in note 312090 - Integration HR -
    EBP/SRM.
    Thanks & Regards
    Arshad

  • Org Assignment of global employees in Compensation Management

    I have a problem with Compensation Management but it also relates the Org Assignment of global employees
    In Comp when I try to submit an employee using transaction HRCMP001, I have an error saying no org assignment exist on 01. 01 .2008.
    The business scenario is as follows. EE is hired on 01012008 in UK for e.g. he gets terminated on 31.05.2008 and then gets re-hired in another country using the Global Employee Personnel actions on 01.06.2008. In this county, he becomes eligible to receive the increase but when I try to submit, the error comes up that no org assignment exist for 01.01.2008. I have changed the settings in T582A to u2018copy infotypeu2019, it tries to reference the previous org assign infotype from 01.01.2008(which is correct but the system rejects it and will only accept the new date of the new hire 01.06.2008) thereby not referencing the old org assignment in the new personnel number.? I tried the propose infotype option but it did not do anything. Does any one have any suggestions? Thanks ever so much for your anticipated help.

    You create the compensation packages using info type 0706. This info type has
    Two subtypes; one for home country and one for host country
    Check this link
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/32/79c73c0c52085be10000000a114084/content.htm

  • Critical abap hr req - How to find the previous org unit of the employee?

    Hi Experts ,
    I need small inputs from your end...
    I need to find the employee org unit based on the latest one.....
    i just want to know if an employe is Transfered from the org unit .....we can check it from the ORG unit.
    My requirement is to now capture only the org unit of IT folks not for the employees who are transfered to NON-IT department.....
    sop if an empployee 5000 org unit belongs to IT of employee 1000 and NOW he transfered out of IT with current 6000 org unit then how can we read that 5000 ?
    now i am using PCH logical data base...
    Based on evaluation path(Pers-0)  i will pick up the pernr 1000.
    now when i check the org unit it is 6000 with end da 12/31/9999.
    then i loop
    select * from pa0001 into itab where pernr = objec--objid and otype = 'P'.
    enselect.
    loop at itab where pernr = objec-objid.
    Here in the loop what is the logic we need to write to pick up the previous org unit please suggest
    endloop.
    Regards
    sas

    >
    Faisal Altaf wrote:
    > Hi,
    >
    > Please Test the following Sample Code hope it will solve out your problem,
    >
    >
    TABLES: pa0001.
    >
    > DATA: it_pa0001 LIKE STANDARD TABLE OF pa0001 WITH HEADER LINE,
    >       begda TYPE begda.
    >
    > SELECT SINGLE begda FROM pa0001 INTO begda
    >   WHERE pernr = '00000001'
    >     AND endda = '99991231'.
    >
    > begda = begda - 1.
    >
    > SELECT * FROM pa0001
    >   INTO CORRESPONDING FIELDS OF TABLE it_pa0001
    >   WHERE pernr = '00000001'
    >     AND endda = begda.
    >
    > Please Reply if any Issue,
    >
    > Best Regards,
    > Faisal
    Hy Faisal...what is the begda value there?
    Regards
    sas

  • CAT2 Org Unit Structural Authorizations - Employees moving to different Org

    Hello, everyone -
    We currently use structural authorizations to restrict time keepers to only maintain time entries for employees in their org units. If an employee moves to an org unit maintained by a different timekeeper, we want to continue to allow the previous time keeper to maintain entries for the time the employee was in their org.
    Example: pernr 1 starts out in org unit X. Org Unit X time entries are maintained by time keeper A. Effective 5/1/2014, pernr 1 moves to org unit Y, whose time entries are maintained by timekeeper B. The standard maintenance data entry profile allows the user to go back 6 weeks. On 5/2/2014, time keeper A tries to enter overtime worked by pernr 1 for his org unit on 4/30/2014. He receives the error "Not authorized to maintain data for personnel number &2 using profile &1".
    How do we allow a timekeeper to make entries for any employee who was in any of their org units, even if they're no longer there?
    Thanks in advance, and I'll definitely reward points for any helpful answers.
    - Steve

    Hi, Rohit -
    The actual scenario is that we are set up to move all withdrawn personnel numbers to a pooled "separated" position in a separate org unit. This frees their previous position to be filled by a new hire. It also means that a LOT of personnel numbers are in this org unit, which the time keeper should not have access to.
    D.  -
    We're using a custom function module entered in T77PR to retrieve the organization units that the time keepers should access.  Here are the entries in T77PR:
    (The "Maint."/Processing Type column is checked for all 3 rows.)
    Z_HRLY_TMKPR 1 01 O          O_S_P 12 3   ZBC_GET_TKEEPER_ORGS_BY_USER
    Z_HRLY_TMKPR 2 01 S          O_S_P 12 3   ZBC_GET_TKEEPER_ORGS_BY_USER
    Z_HRLY_TMKPR 3 01 P          O_S_P 12 3   ZBC_GET_TKEEPER_ORGS_BY_USER
    The function module uses a custom evaluation path ZHT that looks like this:
    15 * B 008 Holder * S
    20 S B ZHT Hourly Timekeeper * O
    30 US A 208 Is identical to * P
    I'm not sure what you'd like to see related to the profile... Is there a way to configure the CAT2 logic to allow a user to maintain a personnel number who is in the org for at least part of the time that the employee was in an organization that the user is authorized to maintain?
    Thanks again,
    - Steve

  • Org Model determination from Employee Responsible

    Hello friends,
    I have to derive the Org responsible base on the Agent for the Service scenario. I am using the Detremination Rule ORGMAN_22 for this purpose.
    I have created the Org Data Profile with this rule and have assigned it to the transaction.
    But still the organization is not determined.
    Can anyone please let me know if i am missing a step.
    Thanks,
    Vipul.

    Hi Vipul,
    In Organization Model ( TR: ppoma_crm), there is a check box "Object Permitted in Org. Determination" which determines whether the org. unit will be used in the org. determination or not. Check whether the check box is checked for your org. unit. Also check whether you have defined the required attribute in your rule ( Business Partner in this case) in your org unit
    Let me know if this works..!!!
    Best Regards,
    Vishant
    Edited by: Vishant Jain on Aug 12, 2008 8:33 AM
    Edited by: Vishant Jain on Aug 12, 2008 11:08 AM

  • Nakisa embedded org chart-Team view, employees under Reporting line is empty

    Hello,
    I am trying to enable Nakisa embedded org chart, but when i go to Team view, employees  under Reporting line is empty. And also i am not able to view the employees under Org.Unit.
    Can anyone please help me with this.
    Attached screen shots.
    Thanks in advance.
    Geo

    hi george ,
    activate the NAKISA in SICF and chk once in portal the settings and kindly configure OADP settings in MSS u can get the structure in the Team view of MANAGER heirarchy ,  and chk the HCM_PD_UI_1  is active in SFW5 
    SM30  ---  V_THV_APP_C
    CLICK  ON Activate Hierarchy visualization option for MSSBIZVIEW  AND FOLLOW BELOW THREADS
    1823692 - MSS Team View isn´t displayed on the portal
    MSS Team View is blank
    MSS Team - On Behalf of Applications

  • Sales Org determination based on Employee responsible for Opportunity

    Hi,
    How can i do the sales org determination based on the Employee reponsible for opportunity.   Currently it is happend on employee responsible but when i change the employee responsible the organization data is not getting changed.
    Please help me in this regard.
    Thanks
    Naveen

    Hi,
    The sysytem wont accept ur procedure,
    The system determines the process as
    When u enter a prospect, the syetem determines the organisation based on attributes ,which in turn pick up the employee responsible from that particular organisation.
    Hope ur solution is solved if so reward me.

  • Org unit Hierarchy structure between two  Key date s

    Hello Friends,
    We have an issue with displaying HR Org unit hierarchy structure between two calendar months.
    The BI Report has a selection parameter to select Org unit hierarchy , Calendar month From and Calendar month To
    The BI Report is to display the no.of sick absence days for employees in a chosen Org unit hier.
    Employee A had a sick absence of 5 days in the month 04.2011 in the Org unit X . The same employee had a sick absence of 4 days in 05.2011.The Org unit X then delimit in 05.2011 , the Org unit X is no longer in Org structure from 05.2011.
    When we run the report for 04.2011 to 04.2011 , the employee A is showing absence under Correct Org unit ie X with correct Org structure .
    When we run the Report for 05.2011 to 05.2011 , the employee A is showing absence under hierarchy Org unit Not assigned which is OK .
    But the issue is when we run the Report from 04.2011 to 05.2011 , The employee A absence days 9 (5 +4 ) showing under Not assigned Org unit hierarchy structure which is the latest Org unit .
    When I deactivate the Org unit hierarchy and choose tech name of Org unit , It is showing correct Org unit key
    But The user would like to see 5 days under org unit X and 4 days under Not assigned with Correct Org unit hier structure when we run the Report from 04.2011 to 05..2011 .
    We have a user Exit variable for the Key date in the Bex Report which seems to be taking only one date at any time .
    Is there any way to get the correct figures under Org unit hier structure where employee had absence in when we put range of calendar months on a selection screen ?
    Any advice appreciated.
    Thanks.

    Hi
    Yes, we can display the same by using time dependent hierachy's i.e. your org is converted to time dependent so that respective employee shows with respective of time.
    Regards
    Jagadeesh.M

  • Org unit Hierarchy structure  at Key date

    Hello Friends,
    We have an issue with  displaying HR Org unit hierarchy structure  between two calendar months.
    The BI Report has a selection parameter to select Org unit hierarchy , Calendar month From  and Calendar month To
    The BI Report is  to display the no.of sick absence days for employees in a chosen Org unit hier.
    Employee  A had a sick absence of 5 days  in  the month 04.2011  in the Org unit X .  The same employee had a sick absence of 4 days in 05.2011.The Org unit X then delimit in 05.2011 , the Org unit X is no longer in Org structure from 05.2011.
    When we run the report for 04.2011  to 04.2011 , the employee A is showing  absence   under Correct Org unit ie X with correct Org structure .
    When  we run the Report for 05.2011 to 05.2011 , the employee A is showing absence under  hierarchy Org unit Not assigned which is OK .
    But the issue is when we run the Report from 04.2011 to 05.2011 , The employee A absence days 9 (5 +4 ) showing under Not assigned Org unit hierarchy structure which is  the latest Org unit .
    When I deactivate the Org unit hierarchy  and choose tech name of Org unit , It is showing correct Org unit key
    But The user would like to see 5 days under org unit X  and 4 days under Not assigned with  Correct Org unit hier structure  when we run the Report from 04.2011 to 05..2011  .
    We have a user Exit variable  for  the Key date  in the Bex Report  which  seems to be taking only one date at any time .
    Is  there any way to get the correct figures under Org unit hier structure where  employee had absence in when we put range of calendar months on a selection screen ?
    Any advice appreciated.
    Thanks.

    Hi,
    You can try adding two more attributes to Org Unit as "Calender month from" and "Calender month to".
    In these attributes maintain the validity period for the corresponding master data.
    For example, in your case you can maintain the master data as:
    Employee | Org Unit | Calender month from |Calender month to | sick absence
    A | X | 4.2011| 4.2011 | 5 days
    A |    | 5.2011 | 05.2011 | 4 days
    And in report use variables for Calender month from" and "Calender month to".
    Hence, when user executes the report with selection as:
    Calender month from" = 04.2011
    "Calender month to"    =  05.2011
    The data will be read from master data based on these selections along with key date and report will show output as expected.
    Employee | Org Unit | Calender month from |Calender month to | sick absence
    A | X | 4.2011| 4.2011 | 5 days
    A |    | 5.2011 | 05.2011 | 4 days
    Hope this works for you.
    Regards,
    Geetanjali

  • ESS Who's Who - remove link from Org Unit

    In Who's Who (web dynpro version for ERP2004), I want to display Organizational Unit in an employee's detail.  I do NOT however want the link to the org chart from this field to be available.
    Is there a way to remove the link from the Organizational Unit field?
    If not, then my issue is that the link does not work. I get the error "Service EMPLOYEE_ORGCHART_SERVICE does not exist" when I click on a link to the org chart from who's who.  Can someone point towards some documentation on how to implement this?
    Bottom line is that I either want to remove the link on Org Unit or make it work. 
    Has anyone had success with this?
    Thank you!
    Jeff Karls

    SAP's response for getting the link to work:
    17.08.2006 - 12:30:27 CET    SAP    Reply 
    Hi,
    Please check the following in your customizing.
    1.table V_T7XSSSERRES
    Resource Key EMPLOYEE_ORGCHART_SERVICE
    Directory Path sap.com/ess~org
    Object Name Orgchart
    Window Name Orgchart
    2.table V_T7XSSSERSRV
    Service Key EMPLOYEE_ORGCHART_SERVICE
    Service Link Text Orgchart
    Service Type Webdynpro Application
    Link Resource EMPLOYEE_ORGCHART_SERVICE
    3.
    Please maintain the URL of PCD page as
    ROLES://portal_content/com.sap.pct/every_user/com.sap.pct.ess.employee
    /com.sap.pct.ess.roles/com.sap.pct.ess.employee_self_service/
    com.sap.pct.ess.employee_self_service/
    com.sap.pct.ess.area_employee_search/
    com.sap.pct.ess.serv_employee_search
    in the table V_T7XSSSERRES for the key EMPLOYEE_ORGCHART_SERVICE and trythe application again.
    As for removing the link, that will require a modification to the Who's Who web dynpro.

  • CRM employee (business partner) & org unit extraction question

    Hi all,
    I have a question regarding extracting business partner and org unit in CRM. Basically user wants to report on employee level and org unit level.
    When I looked at the org unit hierarchy datasource (0BBP_ORGUNIT_HR01_HIER), it does not include the employee. I also tried the DS 0BP_UNAME_ORGUNIT_ATTR, but that does not give me the org unit of an employee.
    Any hint is highly appreciated.
    Best regards,
    Ben

    HI
    Try this DS  0CRM_POSITION_ATTR,here u will get the org.unit,but u need to add the users (employees) in the data source.
    Sridath..

  • Change Org.unit Hierarchy

    Hi,
    I want to change hierarchy of organization unit X111 immediately after X1.
    Ex:
    Existing
    Root X
            |_X1
                |_X11
                |     |_X111
                |_X12
    Required
    Root X
            |_X1
                |_X11
                |_X111
                |_X12
    Under Org.Unit X111 some employees exist. Live Payroll run at least for 1 year completed.
    Is it preferable to change org. unit report to link from X11 to X1.
    What will be implications ?
    regard,
    Chintan

    Hi Chintan,
    Go to T Code: PPOME
    According to your EX: Select X111, click on it and drag and drop it in X1. So that automatically the link flow over there. Hope there will not be any prob in payroll.
    If found useful awrad points
    Regards,
    Madhu Sudhanan

  • Possibility of Focusing to a Specific Org Unit ?

    Hello Everyone,
    We are using Nakisa v4.1 and a live build. I wonder whether the below action is possible or not;
    When a manager logs into the system, the OrgChart Module will display all the organizational units BUT will focus to the organizational unit that he/she is the manager of ? I mean the screen will zoom to that organizational unit he/she is managing at the moment he/she logs in ? Is there any customization on Nakisa Admin Console or R3 side for this or it is not possible at all ?
    Thanks,
    Regards.

    Tunc.
    I think this is worth a little debugging at this point to confirm the data is mapping as you expect it to.  Once you are logged in to OrgChart and getting the infamous error message, open a new tab in your browser and navigate to the debug page.
    This is done by substituting "default" with"nak-debug".  So for example if your OrgChart URL is http://myorgchart/OrgChart/default.jsp, then your debug page URL is http://myorgchart/OrgChart/nak-debug.jsp.
    On the debug page, look in your "User" table at the "User Population" row.  The value should be a list of parameters.
    e.g.
    {null=TESTUSER, Costcenter=0000002110, LANGUAGE=, Nak_ExportStructureTable_Count=1, Position=00130049, Name=Ludik, CPID=, IM_EMPSTAT=3, BUSINESS_AREA=9500, PLVN_VERSION=, Perno=00900349, PERSONNEL_SUBAREA=, EMPLOYEE_GROUP=1, Userid=TESTUSER, Nak_EMPLOYEE_DATA_Count=1, CONTROLLINGAREA_ID=1001, KEY_DATE=, PERSONNEL_AREA=1400, Org_unit=50006110, EMPLOYEE_SUBGROUP=DU, Job=50063947}
    The parameters you are interested in are...
    Userid - this should be the user ID of the account you are logging in with.
    Perno - this should be the employee number for the account to which the login ID is associated.
    Position - this should be the position ID for the position the employee is assigned to.
    Org_unit - this should be the org unit ID for the org unit the position is assigned to.  This is what I would expect to be mapped as the root of your org chart.
    Note: All entries must of course be valid for the current date.
    See if these parameter values match up to what you expect them to be.  Also see if you can find these org unit, position and employee (personnel number) entires via OrgChart's listings.
    If something doesn't match up then that's what you need to investigate next.
    Regards,
    Stephen.

  • More than 200 users per org unit

    Hi Experts,
    We are implementing SRM 5.0 and replicating org structure from HR systems. We have some org units which have more than 200 users. Please advise if there is any issue with it.
    Regards,
    Kamal

    Hi,
    The  200  limit is for users generated through trasnc USERS_GEN.
    If an organizational structure with a large number of dependent nodes is displayed in the overview area, access to the transaction can take a very long time.
    Please refer to the following SAP OSS Notes ->
    Note 503915 - PPOMA_BBP: performance improvement overview area
    Note 389869 - Organizational unit with many employees
    Note 405806 - Transaction PPOMA_BBP for new material group attributes
    Note 864221 - EBP 4.0+: Performance location
    Note 920158 - EBP 4.0+: Shopping cart performance
    Note 1044096 - RSWUWFMLEC: Wrong Emails and/or Bad Performance
    Note 1095895 - Slow response times for several SRM transactions
    BR,
    Disha.
    Do reward  points for useful answers.

Maybe you are looking for

  • [SOLVED] _____ is invalid or corrupted.

    Hello, I installed Arch last night on my netbook and everything has been going great until now. I tried to install flashplugin but ran into a conflict between krb5 and heimdal. I tried to fix it with a system upgrade, but now nothing will install. It

  • Interest on Delay Payment of TDS

    Dear All, Is Interest which we used to pay in challan for delay payment of TDS can be configured in SAP (Extended Withholding Tax). Suggest Me.

  • Authorizations for object level

    Hi Normally BI query I can get object level authorizations, I have customer. I can restrict customer ( 1-10) for 1 user , this query is with me now. if i build universe, and web intelligence in BO this authorizations will get automatically? or i need

  • HT1338 i have i mac 7,1 with os x 10.5.8 how i can i update it?

    I have I mac 7,1 with OS x 10.5.8 how I can I update it?

  • Drop-Zones Resizing Images

    I'm new at this so bear with me if this is a stupid question. I'm producing a DVD for a recent graduation ceremony and would like to include still images of the printed program as a menu option. I've created the menus, scanned and finished the images