About GET PERNR

Hi Gurus,
I am new to HR Coding.
I have a doubt regarding GET PERNR. I have used PNPCE as LDB in my program,i gave the input as Payroll Area IB.
But in the output it is displaying Payroll Area I2 also.
My doubt is how to validate the input data given by the user, wil it be automatically handled by the LDB? If yes how i am getting I2 Payroll Area also.
For that particular Employee records are there for IB & I2 also.Like the employee is hired in IB PA & next changed to I2 PA.
How to restrict to IB only?
Regards,
Phani

Hi,
This is happening because you are using PNPCE. PNPCE takes care of concurrent employment. If the employee which correspnds to the payroll area given on selection screen also belongs to any other payroll area, he will be shown with multiple records.
Use PNP if you want the employee records only for those payroll areas which you enter in the selection screen.
Also, HR LDBs take care of selection criteria, so you do not need to write any code for that.
Regards,
Jayesh

Similar Messages

  • HR REPORT about GET PAYROLL ISSUE!

    HI
    i using LDB pnp to report about PY data!
    i get PY data using GET PAYROLL!
    one case occurs as follow:
    search  one person(99005500) using personid number i will get result ok!
    all other condition not change! just in personid(pernr-pernr) condition,  i put mass person id!
    in these person, some id < 9900500, in this time, the person id 99005500 some period py data
    can't display out!
    i have to check period list using call method pay->read_result
                                                           IMPORTING
                                                                 list = mylist. in GET PERNR !
      i find mylist have different!
    in first scene:
        mylist data contain all data about this person: begin with 20060110
    but in last scene:
        mylist data contain data just begin with 20080804
    so i think miss py data cause by mylist change !
    i in SAP demo code:EXAMPLE_PNP_GET_PAYROLL i have saw:
    You can use the methods of class "pay" to read and modify
    the list of payroll result that is going to be processed at
    the <get payroll> event. However, these method calls might
    change with the next release.
      CREATE OBJECT pay.
    pay->LDB = 'SAPDB_MY_OWN_LDB'. "only if you copied the LDB PNP
      CALL METHOD pay->read_result IMPORTING list = mylist.
    "delete mylist index 2. "For example: Remove an unwanted payroll result
      CALL METHOD pay->write_result EXPORTING list = mylist.
    what happend in LDB PNP! how to get mylist i want?
    because using CALL METHOD pay->read_result IMPORTING list = mylist. will cause error!
    help!!!!!!!!!!!!!!
    thank you advance!

    Hi,
    Refer this link https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/3180. [original link is broken] [original link is broken] [original link is broken]
    Regards,
    Flavya

  • Surpress GET PERNR?

    How do I suppress the GET PERNR event? I have a report where I do a table dump of T710 or output PA0008 based upon TAB selection. However, I want to prevent performance problem when I just want to dump T710 table. The GET PERNR event seems to output regardless of what TAB is selected. Here is a sample code:
    START-OF-SELECTION.
      CASE P_TABSEL.
        WHEN 'T510'.
          P_IT08CHECK = ''.
          PERFORM 100.
        WHEN 'T710'.
          P_IT08CHECK = ''.
          PERFORM 110.
        WHEN 'IT08'.
          P_IT08CHECK = 'X'.
            GET PERNR.
        WHEN 'T510U'.
          P_IT08CHECK = ''.
          PERFORM 130.
      ENDCASE.
    This doesn't work because I can't encapsulate the "GET PERNR" in an IF statement of in the FORM statement. Any idea how to ONLY activate the GET PERNR event when I have a particular tab selected?

    Some clarification on the meaning of GET might help you out in the future.  It is a commonly misunderstood ABAP statement.  GET looks like a verb, sort of like MOVE, but it is really the name of an SAP event, just like other events like AT SELECTION-SCREEN and START-OF-SELECTION.
    Whenever I teach new ABAPers about GET, I tell them to think of this as a noun rather than a verb.  So instead of thinking GET, think of WHEN.
    So GET PERNR is really an event called WHEN PERNR and means that when the LDB has a PERNR row available, invoke the code you have attached to event GET PERNR.  Trying to bury the statement GET PERNR inside other executable ABAP statements like IF and FORM is not supported because your code does not decide when to do this, it is decided by the LDB.  In fact if you code the following:
    IF condition.
      GET PERNR.
    ENDIF.
    What the compiler sees is an event called GET PERNR.  The start of an event, ends the previous event.  If you never specified an event then the default event is START-OF-SELECTION.
    So the previous event is ended, but we have an IF without an ENDIF.  If the compiler could get past that error, the next error would be an ENDIF without an IF.
    As an aside, if you have ever wondered where the ABAP events START-OF-SELECTION and END-OF-SELECTION got their names, START-OF-SELECTION represents the start of selection by the LDB before any data is returned to your program.  Likewise, END-OF-SELECTION represents the fact that the LDB has finished returning data to your program.

  • 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

  • GET PERNR skips some employees in the report

    Hi all.
    This is my first post in this forum. I'm beginner in ABAP programming and I've got a issue in my report that I don't succeed in solving it.
    In the first line of the source code, within the start-of-selection event, I use the GET PERNR command to bring the employee personnel numbers. While I was debugging I've noted this command was skipping some employees. There isn't any line of code before the GET PERNR.
    Do you have any ideia about what's happening?
    Thanks in advance.
    Tiago.

    HI Tiago,
    here is another probably cause. The dates. It´s important that the employees,
    are active in the infotype(I think that is Infotype 0), in the dates that check your program. It´s useful to know
    the selection data period (pnpbegda/pnpendda), the employees selection data (pnpbegps/pnpendps), the radiobutton selection data (pn-begda/pn-endda), of the pnp logical d.b.selection screen. You can see the values of these fields debbuging Ah!, another point, start-of-selection & Get pernr, are differents events in the execution of an abap program.
    Hope this lines help you!
    Carles

  • Getting Pernr for WebDynpro ABAP application

    I am building a new WebDynpro ABAP application and I want to be able to get the PERNR for the user logged into the portal and this application.
    I have read some information on this forum about getting the URL or application parameters in order to get the userid or similiar parameters and to handle this within the Window in the HANDLEDEFAULT method of a WebDynpro ABAP application.
    I have looked into this and I don't think pulling information from the application parameters will work.  For example, I checked one of our current services for "Personal Data"  and when I go to the portal content administration,  application parameters, I don't see any reference to userid..etc.  I see Property ID, Property Category, Inheritance, End-User Personalization, and Property Description.  In addition, I do not see any information from the URL itself that I could use. 
    Here is the scenario.  The user logs into the portal using the 3 character Network id which in turn, I assume, gets their SAP userid and PERNR in order to retrieve all the HR infotype information for each service.  By the way, the service I mentioned above, "Personal Data", is written in JAVA, so I am not able to see how this particular service works or handles getting the userid and PERNR.
    Has anyone come across this scenario before and how was it handled in terms of getting the userid and PERNR?

    I was thinking that SY-UNAME would be available, but was not sure.  For some reason, I was thinking I was going to have to pass something from the applicaton parameters or some other method to my WebDynpro ABAP program..
    I am not the portal administrator so I have not yet added my WebDynpro ABAP program to the portal yet.  Once, it's added, I will check out the availablility of sy-uname.
    Thanks.

  • Question on GET PERNR.

    Hi all,
    when I using GET PERNR, this is a loop , right ?
    currently, I have no idea about where the value comes from to get into this 'PERNR' structure, pa0000 or pa0001 or any other place?
    Thanks!

    Hi,
    GET PERNR event fills the data structures of declared infotypes with all records that exists for a personnel number.
    Data selection does not delimit the records that retrieved from the database.
    Whenever GET PERNR statement is included in your program check the following two .
    1.Have you included PNP for the logical database screen field in the program attributes.
    2.Have you included PERNR structure in the tables declaration.
    Below is a sample code, may help you understand the logic behing GET PERNR
    tables: pernr.
    infotypes: 0000,
                0001,
                0002,
                0019,
                0041,
                0396,
                9009.
    start-of-selection.
    get pernr.
       provide * from p0396 between pn-begda and pn-endda.
         perform refresh_tables.
         call function 'HR_READ_INFOTYPE'
           exporting
             pernr     = p0396-pernr
             infty     = '0396'
             begda     = pn-begda
             endda     = pn-endda
           tables
             infty_tab = i_p0396.
         sort i_p0396 by begda descending.
         read table i_p0396 index 1.
    endprovide.
    end-of-selection.
    Check this as well:
    [http://sapabap.iespana.es/sap/info/hr_overview.htm|http://sapabap.iespana.es/sap/info/hr_overview.htm]
    Hope this help you.
    Edited by: Lokesh Tarey on Jul 15, 2010 6:06 AM

  • I have an iphone 4 and thinking about getting an ipad2.  Can i use the same apple id for both devices?

    I have an iphone 4 and I am thinking about getting an ipad2.  Can I use the same apple id and itunes account with both of them?  Will my contacts and apps transfer over to the iPad2?

    Yes. I use the same Apple ID on four different iDevices. You can sync the contacts with iCloud or with your computer and have them on both devices. You can sync all of the apps as well. If the apps are not in iTunes on your computer - you can download them to the iPad with the same Apple ID. You can also restore the iPad from a backup of the phone to transfer your settings, app data and your contacts.
    iPhone only apps will be half size on the iPad screen but will still work as long - you can enlarge the size of the apps - but they will be pixelated on the screen.

  • How do I go about getting the product serial number to register my product as well as install my product.  I bought it with a product box.  On the software disc sleeve, there is a series of numbers pasted at the bottom of the sleeves but this is not valid

    How do I go about getting the product serial number to register my product as well as install my product.  I bought it with a product box.  On the software disc sleeve, there is a series of numbers pasted at the bottom of the sleeves but this is not valid.  When I tried to type this in for registration, it does register as this numbers also contain letters in it.  Apparently the registration boxes accept numbers only.  What do I do with a useless product for which I have paid good money for it?????

    This is the simple solution which was offered to me when I tried to get the serial code on line.
    The box and disc sleeve do not contain a series with 24 numbers which I presume is the product code to install.
    I tried to redeem the registration code by following what they recommended, but inevitably it gets to the page that showed the registration boxes that need 24 serial numbers and I got stuck again.
    This product is so different what my previous experiences of other software products where I just enter the serial number straight from the disc sleeve and then I got registered and go on to use the software.
    I is really frustrating, spending the last two hours trying to get my product going....

  • TS1292 I have recently received an iTunes card and after scraping away the panel to get my code the first part of the code is unreadable how do I go about getting a code for the card

    Hi there I have recently been given an iTunes card as a present.i went to use it today to put credit on my account and after scraping away the panel found that I couldn't read part of the code that was on the card how do I go about getting the card activated?

    If the page that you postted from doesn't help then you will need to try contacting iTunes support (you will need to give them as much of the serial number and activation code from the card as you can read) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then iTunes Cards And Codes

  • 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.

  • 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

  • I rented a movie on iTunes and, really annoyingly, it has stopped 30 minutes before the end. Any suggestions? And how do I go about getting a refund?

    I rented a movie on iTunes and, really annoyingly, it has stopped 30 minutes before the end. Any suggestions? And how do I go about getting a refund? Thanks so much for any suggestions.

    Hi alefiya,
    Welcome to the Support Communities!  It sounds like the movie didn't completely download. This link will get you in contact with the iTunes Support Team.  They will be able to review your account with you:
    How to report an issue with your iTunes Store, App Store, Mac App Store, or iBookstore purchase
    http://support.apple.com/kb/HT1933?viewlocale=en_US
    Cheers,
    - Judy

  • 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

  • Since my G5 died I was thinking about getting a Mac Mini, but I have a ViewSonic Monitor (from 2004) and a USB keyboard and mouse - I also have the external drive tha downloaded my files on to. Do you think the monitor, keyboard and mouse will work on it?

    Since my G5 died I was thinking about getting a Mac Mini, but I have a ViewSonic Monitor (from 2004) and a USB keyboard and mouse - I also have the external drive that I downloaded my files on to. Do you think the monitor, keyboard and mouse will work on it? Would I have to get a hub so I could use the stuff I already have? Is that viewsonic too old to work on it?
    What else would I need? Please advise...

    Yes for keyboard and mouse.
    The monitor will work if it has an HDMI, VGA ir DVI input. If it only has a VGA input you will need this adopter
    http://store.apple.com/us/browse/home/shop_mac/mac_accessories/cables/cable_choo ser#selected-step1=MINI-DISPLAY-PORT&selected-step2=VGA&step=3

Maybe you are looking for