Get PERNR from UNAME

Hello Experts,
I am currently writing a program to list all users of a role and their current position. I need to find a way to get PERNR given a username to eventually obtain the position number. Any help would be appreciated.
Thanks,
Nicole

Hi Nicole,
This depends on the how user ID are maintained in your system.
You may get the perner using Infotype 0105. There you have field USRID which is the user ID. Using this you can get the PERNR and once you got the PERNR you can get all the details Using different Infotypes.
Regards,
Atish

Similar Messages

  • How to get PERNR from employee search(teamviewer) iView in to a WD-4-ABAP.

    Hello All,
    I had developed a new Web Dynpro for ABAP (WD4A) component for updating a custom Infotype. This application is meant for the manager to maintain some specific data through portal for his employees in the team.
    WD4A application is built based on the employee number it receives from the portal.
         How could I get PERNR from employee search(teamviewer) iView in to my WD4A component?
    In portal I had developed a test page by copying the standard page from MSS com.sap.pct.erp.mss.general_information, and added my WD4A application through an iView into this page.
    Then I hided all the other iVews in the page except (1) employee search and (2)my WD4A iVew. On the preview everything appears fine.
    During the preview of this page it triggers the WDDOINIT of WD4A component main view and then the WDDOMODIFYVIEW. When I select an employee from the employee search, then it triggers only WDDOMODIFYVIEW in the WD4A application and not the WDDOINIT anymore.
    In my  WDDOMODIFYVIEW I had inserted the following code:
      DATA lo_api_component TYPE REF TO if_wd_component.
      DATA lo_portal_manager TYPE REF TO if_wd_portal_integration.
      lo_api_component = wd_comp_controller->wd_get_api( ).
      lo_portal_manager = lo_api_component->get_portal_manager( ).
      DATA lo_api_controller TYPE REF TO if_wd_view_controller.
      lo_api_controller ?= wd_this->wd_get_api( ).
      CALL METHOD lo_portal_manager->subscribe_event
        EXPORTING
          portal_event_namespace = 'urn:com.sap.mss.employeesearch'
          portal_event_name      = 'selection_changed'
          view                   = lo_api_controller
          action                 = 'GET_SELECTED_PERNR'.
    And in the action: 'GET_SELECTED_PERNR'
    METHOD onactionget_selected_pernr .
      DATA lv_str_pernr TYPE string.
      DATA lv_strlen TYPE i.
      DATA lv_pernr TYPE pernr_d.
      DATA lv_offset TYPE i.
      wdevent->get_string(
      EXPORTING
      name = 'PORTAL_EVENT_PARAMETER'
      RECEIVING
      value = lv_str_pernr ).
      lv_strlen = STRLEN( lv_str_pernr ).
      lv_offset = lv_strlen - 8.
      lv_pernr = lv_str_pernr+lv_offset(8).
    ENDMETHOD.
    This is not functioning form me. The action is not getting trigged with the code in WDDOMODIFYVIEW.
    I had gone through several threads in u2018SDN say:
         Pass pernr to WebDynro
         MSS - General Information - Related Activities Links persnr.
         SAP Note: 1112733.
    Most of the threads are answered but incomplete. In some threads people shared document personally which had been helpful.
    I am stuck with this scenario of handling the employee number from employee search iView. Helpful suggestions will be rewarded for sure.
    Thanks in advance.

    Do i understand you correctly that you are not getting the portal event ?
    This can be several reasons ?
    Both portal system and WDA server has to be in same domain and same proptocol to communicate with Portal event.
    Please check in that direction and search posts on this topic.

  • Request: Function Module - Get PERNR from UserID

    Hi,
    Is a simple Function Module available for getting the PERNR from a UserID?
    For example, I'll send the FM the UserID and will get back the relevant PERNR.
    Please Help.
    Thanks,
    John

    Hi John,
    FM is one way but
    Simple code to Find personnel number for UNAME
      SELECT SINGLE pernr INTO t_pernr
        FROM pa0105
        WHERE subty = '0001' AND
              endda >= sy-datum AND
              begda <= sy-datum AND
              usrid = p_uname.
    Best Regards,
    Aslam

  • How to get pernr from Recruitment module(PB000),

    Hi All,
    I want to read the pernr from the applicant data PBnnnn, There is one GET PERNR,
    for PAnnnn, which reads pernrs from Employee data. Is there any similar way for
    applicant data also?

    Do i understand you correctly that you are not getting the portal event ?
    This can be several reasons ?
    Both portal system and WDA server has to be in same domain and same proptocol to communicate with Portal event.
    Please check in that direction and search posts on this topic.

  • HR-stopping Get Pernr from triggering

    hi,
    My selection-screen is combination of PNP + other Fields
    i am using GET PERNR to retrive values..
    my Problem is that When no values is given in PNP fields , i want to Skip
    GET PERNR statement.but i am unable to do it..
    Kindly give some solution.

    hi,
    check the fields whether they are initial or not.
    if the PNP fields are initial then dont process the GET PERNR.
    Dummy code.
    If not PNP-fields initial.
    GET PERNR.
    Endif.
    <b>Reward points if useful</b>
    chandra

  • Get PERNR from PCPO transaction

    Hi Experts,
    I have,
    1. RunId
    2. G/L account number
    3. Order number
    4. Business area
    Is there any function module which will give me the PERNR output based on above mentioned input?
    Regards,
    Rajneesh

    Hi,
    Once you run the payroll posting you will get the posting number. Go to Document overview there If you double click on that you can see all employees by PERNR wise.

  • Get PERNR in Dynpro on ABAP

    Hi,
    I`am developing a custom service for ESS on ABAP Dynpro.
    How can I get current employee PERNR inside of my ABAP implementation?
    The only way I know getting PERNR from 0105 i.t. using current sy-uname, but I dont like this solution.
    Is where any other way of getting current employee PERNR?
    thanks to all,
    Evgeny

    Hi Evgeny,
    It's probably best to post these types of questions in the HR/ABAP forums in the future. In any case, the only link between the employee record and the user record is IT 0105 so I'm afraid you don't have much choice there. If you don't want to access the employee record using SQL, I believe there is a function module called something like BAPI_EMPLOYEE_GET_DETAILS (check in SE37).
    Cheers,
    Dion

  • GET PERNR EVENT

    Hi experts,
    please tell me about the get pernr event and from which all tables data is fetched during the event.
    thanks,
    ajay

    Hi,
    GET is the command used in Logical database concept for fetching the data
    GET PERNR will fetch all the Pernr's one by one in a Loop like thing
    and for each pernr the data records in other infotypes have been processed
    and it goes on till all the pernr's are completed.
    see the sample code
    start-of-selection.
    Get PERNR from LDB
    get pernr.
    Get data from Respective Infotypes
    rp_provide_from_last p0001 space pnpbegda pnpendda.
    if p0001-kostl in pnpkostl.
    rep_tab-kostl = p0001-kostl.
    rep_tab-pernr = p0001-pernr.
    rep_tab-ename = p0001-ename.
    Get the Position Text
    clear t528t-plstx.
    select single plstx into t528t-plstx from t528t
    where plans = p0001-plans and
    otype = c_type and
    sprsl = sy-langu.
    if sy-subrc = 0.
    rep_tab-ptext = t528t-plstx.
    endif.
    Get the Cost Center Text
    clear cskt-ltext.
    select single ltext into cskt-ltext from cskt
    where spras = sy-langu and
    kokrs = c_kokrs and
    kostl = p0001-kostl.
    if sy-subrc = 0.
    rep_tab-ctext = cskt-ltext.
    endif.
    append rep_tab.
    clear rep_tab.
    endif.
    Regards,
    Harish

  • Why the Orgunit from Orgstructure not beeing called in Get Pernr

    Dear Freinds
                 Iam using the logical database PNP for my payroll repot. So i have modified
    the selection screen and keppt only
    a) paroll area,
    b) otherperiod and current period
    c) organizational unit.
    My intention is to read all the orgunits throught function module RH_STRUC_GET
    So when i said f4 on orgunit field normall we will get the OrgStrucutre popup,
    from that popup i have select the topmost (i.e very first orgunit) .......when i executed
    for the other period 01 2007 (means april 2007 i.e 01.04.2007 to 30.04.2007)
    02 2007, 032007,04,2007,05,2007 & 062007 it is not even triggered GET PERNR.
    however from 072007 to 122007( october2007 to march2008)getpernr it is getting triggered,
    My question why is this happening iam not able to find in debugging , does the payroll area not in the periiod ?? or is this any thing like that please let me know iam not able to find ...........atleast give me some clue so that i can check in that aspect.
    Please help me freinds as this has been struc .......as this more imp for my FO
    Regards
    syamla

    Hi Syamala,
    I do not quite understand what you want to do.
    <i>My intention is to read all the orgunits throught function module RH_STRUC_GET
    </i>
    The normal flow is that PERNR are rtrieved based on selection criterias. THats what the selection part of a report is for.
    THe field ORGEH is the field stored in IT0001, no structural evaluation. If you want to process all PERNR under one Orgunit reachable with path O-S-P simply use the Pushbuton on top of the screen. If it is not shown, use a different report class showing it.
    Have a look at e.g. PAR2 transaction.
    Regards,
    Michael

  • Use GET PERNR without any screen default from Logical DB.

    Could anyone help me how to avoid using screen default from logical DB if using GET PERNR?

    Are u saying using this logic below  , im can avoid using GET PERNR?
    TABLES: RP50G,PERNR,PYORGSCREEN,PYTIMESCREEN.
    DATA: IN_RGDIR LIKE PC261 OCCURS 0 WITH HEADER LINE,
          WA_RT LIKE PC207 OCCURS 0 WITH HEADER LINE,
          SEQNR LIKE PC261-SEQNR,
          RESULT TYPE PAY99_RESULT.
    DATA: M_START LIKE SY-DATUM,
          M_END LIKE SY-DATUM.
    FORM GET_PAYROLL USING P_PERNR M_START M_END.
    *This FM help us to get the Sequence number used for the
    *employee on the payroll.
      CALL FUNCTION 'CU_READ_RGDIR'
           EXPORTING
                PERSNR          = P_PERNR
           TABLES
                IN_RGDIR        = IN_RGDIR
           EXCEPTIONS
                NO_RECORD_FOUND = 1
                OTHERS          = 2.
    *We read it using two dates, which corresponds to the month *we need
      READ TABLE IN_RGDIR WITH KEY FPBEG = M_START
                                   FPEND = M_END.
      SEQNR = IN_RGDIR-SEQNR.
    *This FM actually reads the payroll and get the information
    *we need.
      CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
           EXPORTING
                CLUSTERID                    = 'XX'
    *In CLUSTERID use the country of your choice
                EMPLOYEENUMBER               = P_PERNR
                SEQUENCENUMBER               = SEQNR
                READ_ONLY_INTERNATIONAL      = 'X'
           CHANGING
                PAYROLL_RESULT               = 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
                OTHERS                       = 8.
    *We just need to read the result table.
      LOOP AT RESULT-INTER-RT INTO WA_RT.
        CASE WA_RT-LGART.
          WHEN '9010'.
             MOVE WA_RT-BETRG TO T_ANYTABLE-SOMEPAY.
        ENDCASE.
      ENDLOOP.
    ENDFORM.

  • Get data from more than 1 subtype using RP_PROVIDE_FROM LAST

    Hi all,
    I need to get data from infotype 2013 subtype 90 and subtype 91.
    Currently the codes only allow me to use it one time for the same infotype. If I use it again for the same infotype, pnp-sw-found will equal to zero. Anyone have any idea on this?
    Example:
    Get pernr.
    Start of selection.
    rp_provide_from_last p2013 0090 pn-begda pn-endda.
      IF pnp-sw-found =  1.
    **--> Populate internal table
        MOVE p2013-ktart TO ls_quota-ktart.
        MOVE p2013-aedtm to ls_quota-aedtm.
        MOVE p2013-uname to ls_quota-uname.
        MOVE p2013-accnu to ls_quota-accnu.
        MOVE p2013-accop to ls_quota-accop.
      ELSE.
        REJECT.
      ENDIF.
    End of selection.

    Using RP_PROVIDE_FROM_LAST you can only use for one infotype and one subtype. For reading data for IT2013 with subtypes 90 and 91....you have to use following....
    Get pernr.
    Start of selection.
    rp_provide_from_last p2013 0090 pn-begda pn-endda.
    IF pnp-sw-found = 1.
    **--> Populate internal table
        MOVE:
               p2013-ktart TO ls_quota-ktart,
               p2013-aedtm to ls_quota-aedtm,
               p2013-uname to ls_quota-uname,
               p2013-accnu to ls_quota-accnu,
               p2013-accop to ls_quota-accop.
    ELSE.
      rp_provide_from_last p2013 0091 pn-begda pn-endda.
      IF pnp-sw-found = 1.
         **--> Populate internal table
         MOVE:
               p2013-ktart TO ls_quota-ktart,
               p2013-aedtm to ls_quota-aedtm,
               p2013-uname to ls_quota-uname,
               p2013-accnu to ls_quota-accnu,
               p2013-accop to ls_quota-accop.
       ELSE.
           REJECT.
       ENDIF.
    ENDIF.
    End of selection.
    Hope this answer is helpful

  • How to get PERNR based on user ID

    Hi All,
    How to get PERNR based on userid.
    please help me in resolving this.
    Thanks for the support.
    Regards,
    Dhananjaya R E

    hope this will help u
    DATA:   t_pernr LIKE pa0105-pernr,
              t_email LIKE pa0105-usrid_long.
    STEP 1 - Find personnel number for UNAME
       SELECT SINGLE pernr
                 INTO t_pernr
                 FROM pa0105
               WHERE subty = '0001'
              AND endda >= sy-datum
             AND begda <= sy-datum
             AND usrid = p_uname.
    Employee record found*
    IF sy-subrc = 0.
    STEP 2 - Find email address for personnel number*
    SELECT SINGLE usrid_long
             INTO t_email
             FROM pa0105
            WHERE pernr = t_pernr
              AND subty = '0022'
              AND endda >= sy-datum
              AND begda <= sy-datum.

  • Is there a way to use 'GET PERNR' without the selection screens?

    I would like to use the GET PERNR event in a batch program without using the default selection screens.  I would like to be able to use my own selection screen and parameters, but only get them along with the default selection options for payroll period.  I've tried removing the screen number from the attributes screen, but still get these options.  Is this possible?

    hi Kiran,
    report Category is a Pushbutton on the Attributes popup, it only appears if you use PNP logical DB.
    this is from SAPHelp: "Report Category
    Category used for HR reports that use the PNP logical database. It controls the type and number of fields that appear on the selection screen of an evaluation report."
    hope this helps
    ec

  • How to use the class CL_PT_EMPLOYEE with GET PERNR?

    Hi,
    I saw this sample code on the forum.
    Is it more performant than using the "RP-PROVIDE-..." macros?
    Does the employee instance needs to be killed after each pass? How does it affects memory?
    start-of-selection.
    GET pernr.
    <b>* Create employee instance</b>
      gif_employee = cl_pt_employee=>get_employee( pernr ).
      go_employee ?= gif_employee.
    <b>* Append all other required infotypes to itab</b>
      APPEND '0003' TO gt_infotypes.
      CALL METHOD go_employee->get_infotypes
        EXPORTING
          i_itlist      = gt_infotypes
          i_fromdate    = id_fromdate  " start date
          i_todate      = id_todate    " end date
    *      I_FILTER      =
          i_noauthcheck = 'X'
        IMPORTING
          e_result      = gt_infty_request
          e_retcd       = gd_retcd.

    I think it that way. You are trying to compare and analyse old (don't say bad) programming school with a new (OO one) approach. Although, I am OO enthusiast and in any case I will try to convice you that OO aproach is better than classical one, you should know what SE30 was designed for. If you want to stress on OO design, use the one you mentioned, otherwise stick what SAP recommmends (please note, that I am "middle" school pupil, so I tried to learn all courses with my own experience and feelings from OO).
    IMHO, OO aproach is a way of thinking, not something we can messure in sec. and compare to old school teaching. Some of your report should be desinged in classical way, some should be pure OO. Which one you choose, is up to you, your conclusions, your percives of ABAP language. For me OO was not injected in ABAP enough, to affect developers or to convince them using it in any case w/o doubts you have.
    Regards
    Marcin

  • Function Module to get pernr number based on first name and last name

    Hi All,
    What is the Function Module to get pernr number based on first name and last name.
    Could you please help me.
    T@R.
    Vidya

    hi Vidya,
    you can get perner from PA0002 based on firs name and last name.
    use select query and get perner.

Maybe you are looking for

  • All Apple products on my computer are not working properly

    Hello, i am having trouble with my itunes, Quicktime, and all other apple products on my computer. This all start when i tried to update my Itunes(which was working fine minus this problem) and it would not let me. It kept giving me the error "The fe

  • Billing request appearing multiple times in document flow

    Hi, After upgrading from 4.6c to ECC6, for contracts the billing request(same document number, same items)  is appearing multiple times in the document flow. Please help me in resolving this issue. Thanks, Ramesh

  • Camera Raw adjustments not applying to batch process

    Hey friends, On a 2008 iMac running 10.5.7, latest version of Camera Raw & Bridge/Photoshop, I opened 650 Canon 5D raw files in Camera Raw, made adjustments to most of those files, then clicked Done. In Bridge Im batch processing all the files to Jpe

  • OLAP DML

    Hi! Does anybody know where can I get information about OLAP DML Language besides Oracle OLAP DML Reference ?? This document is not very "easy going" . Thanks a lot

  • Changes or new features in 2012 from 2008R2

    hi All, I want to know what are the new features,datatypes and additional details added to sql server 2012 not in 2008 R2... Thanks in Advance..