Restrict GET PERNR

Hi,
I have a situation/special case when GET PERNR runs for all pernr.s (No input on selection screen of PNP LDB) where it causes unnecessary performance issue.
Is there any way to execute GET PERNR event conditionally or run it for specific pernrs that I want.

Hi,
Why don't you just restrict them in selection screen?
Anyhow if you don't what to do this and you know which EEs excatly you want to ommit do following.
RANGES: ra_pernr FOR pernr-pernr OCCURS 0.
"here hardcode all your EEs which you don't want to process. You either provide a range or add a row for each EE
ra_pernr-sign   = 'I'.
ra_pernr-option = 'EQ'.
ra_pernr-low    = "lowest EE number or exact EE number
ra_pernr-high  = "highest EE number or empty (if only one EE)
APPEND ra_pernr.
GET PERNR.
check pernr-pernr not in ra_pernr.   "if EE is within the range he/she will be processed, otherwise next pernr is taken
Alternativetly to last statement you can use
GET PERNR.
if pernr-pernr not in ra_pernr.
  REJECT.
endif.
...but it will have same result
Regards
Marcin

Similar Messages

  • ABAP HR : Restriction of data after GET PERNR

    Hi Folks,
    I am using LDP PNP and using get statement. I am using multiple Infotypes. So all the Pxxxx are getting field with each GET PERNR. I have to extract last record which I am getting using RP_PROVIDE_FROM_LAST.
    Can I avoid getting all the data of a PERNR after GET PERNR or is there any other way to get only the latest record.
    Thanks
    Rahul

    Hi ,
    In my opinion i can infer your questions as ..
    suppose p0000 has 3 records for pernr 5125.
    Get PERNR.
    rpprovidefrom last -> triggers last date ..
    Here usage of rp provide allows u to pick the latest entry . Now you are asking the loading of p0000 should happen only with 1 record( instead of 3 ) .
    Get PERNR.
    --> here  u need to see p0000 with 1 entry only ..
    **rpprovide*from last -> triggers last date ..
    May be a check from initialization to restrict based on date entry within the interval .. and if in that interval there are two records i suppose it cannot pick one.. thats my opinion .. lets see if someone has a better solution .
    BR,
    Vijay.

  • Authorizations with PNP and Get Pernr.

    We have just noticed an issue with how our custom reports are working in regards to authorizations.  Our users have authorization to see Basic Pay infotype information up to the point where an associate becomes an executive.  When running our reports the latest salary shows up instead of the last one they are allowed to see or just leaving that field blank.  We are using the PNP logical database and Get Pernr.  Isn't that supposed to pick up whatever authorization is assigned to the person?
    Thanks,
    Mary

    I do not know how you come to this statement. Of course LDB checks ALL HR Authorization defined. This incoporates the personnel administration part as well as the combination to structural authorizations.
    However PNP will skip a PERNR if the user has only partial authorization by default. To get also only the restricted data what the user can see you must use the switch PNP_SW_SKIP_PERNR = 'N' at INITIALIZATION point.
    Please see the documentation available here:
      http://service.sap.com/erp-hcm
    On the left side follow the links:
      Services for mySAP ERP HCM
        Special Documentation
    Regards,
    Michael

  • 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

  • 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

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

  • Error return immediately using GET pernr (PNP logical db)

    I have a requirement to use HR PNP logical database for a report. The report should display the values from employee's infotypes. Should the user does not have authorisation on one or more infotype, the column field for that infotype should be left blank.
    I tried using 'Get Pernr' but system will return error immediately that user does not have authorisation on any of the infotypes. Please advice how should I code my report in order to fit into my requirement.

    There is afunction module to disable the infotype authorization check ( do a wildcard search in se37 for 'HRINFAUTH* ).. call that before the Get Pernr event & implement explicit authzn checks in your program..
    ~Suresh

  • Get Pernr

    Hi,
    I've written an abap program using the logical database PNP to select the employees record using the statement 'Get pernr'. I would like to know if there are ways to get the total number of records that can be selected.
    Thanks,
    Francis

    Thats not passible. Imagine having a select statement, there is no way of getting the number of resulting rows ahead the statement. you have tp process the select statement twice, first to get the amount, and then to ge tthe rows. in the first step you can optimize the select with count(*), but nevertheless, it is executed twice. So you have to execute the logical database in advance, there are funcion modules to do that. For performance reasons, thats not a good choice.
    On the other hand, when the get event is triggered and your program is getting the first rowm most work by the database is done and you're only fetching row by row.

  • Get pernr based on company code in logical databse

    Hi,
        When using the get pernr event, all the pernrs that I get are in the ascending order  I want them first grouped based on the company code and then on pernr.
    Any suggestions would be appreciated abd suitably rewarded.
    for ex: get pernr.
               write:/ pernr, bukrs.
             end-of-selection.
    result:   00000099 1001
              00000002 1003
    Regards
    Vick
    Message was edited by:
            vick vennav

    for ex: get pernr.
    write:/ pernr, bukrs.
    end-of-selection.
    result: 00000099 1001
    00000002 1003
    We are sending the payroll information to the 3rd party for pay check purposes, at my client side they have inserted a custom include in the standard program and populating the information in a flat file which needs to be sorted first based on company code and then on pernr. If I try to do it later,the code is becoming a mess, so I want to know is there a way to get pernr using logical database whose order is based on company code.
    Regards

  • How to read personal no's on selection in LDB without using GET PERNR

    Hi to all
    I am using Logical data base PNP and selection screen 900.
    Now my requirement is to retrieve personal no's which are entered at selection seperately without using GET PERNR.
    Ineed all the pernrwhich are entered in selection.
    How to do that.
    Please guide.
    Regards
    Anubhav

    Hi,
    You can do as SUJIT said or use GET PERNR and assign PERN-PERNR to Workarea and then append that to internal table.
    DATA:
       ITAB_PERNR like standard table of PA0000-pernr,
       wa_pernr like line of ITAB_PERNR.
    GET PERNR.
    wa_pernr-pernr  = pernr-pernr.
    append wa_pernr to ITAB_PERNR
    Hope this would help you.
    Regards
    Narin Nandivada.

  • Regarding the get pernr function

    Hi guys,
              Got to know that when we use get pernr it automatically checks for the autherization on pernrs to view data.
        Would like to know who all have access to see which pernrs? Can i get any ideas on this....
    Thanks in advance
    Abhi

    Triggers the associated events when data is read in an executable (type 1) program using a logical database.
    node is a node in the logical database that is assigned to the report (type 1 program) in the program attributes. You must declare the node in the report using the NODES statement (or the TABLES statement, if the node is of the type "table").
    The node node corresponds to a data object of the same name.
    node is available for processing during the flow of the logical database. Moreover, you can also make reference to the fields from the node that lie on the access path for node in the logical database associated with the report - unless the node is of the dynamic dictionary type.
    Notes
    You can use the event "GET dbtab." only once in the report.
    The GET events are implemented internally as FORM routines. This makes all data objects declared with DATA local, that is, they are only recognized and addressable within the event. This also applies to AT SELECTION-SCREEN ....
    The logic is somewhat different for nodes of the dynamic dictionary type. You must declare these nodes in the report using the NODES node TYPE type statement. In this case, type a dictionary type from the logical database for the node node - that is, the type of the data object node assigned to the node node can differ in different reports. In this case, the data object node is local to the -GET event and has the structure type. Outside the -GET event, a (global) data object node also exists and has the static type assigned to the node. The actual data is, however, returned in the local field node and is available only within the -GET event.
    Example
    The program uses the logical database F1S which has a structure where the table BOOKING appears below the table FLIGHT.
    NODES: SFLIGHT, SBOOK.
    GET SFLIGHT.
      WRITE: SFLIGHT-CARRID,
             SFLIGHT-CONNID,
             SLFIGHT-FLDATE,
             SFLIGHT-PLANETYPE.
    GET SBOOK.
      WRITE: SBOOK-BOOKID,
             SBOOK-CUSTOMID,
             SBOOK-ORDER_DATE.

  • Strange Behavior of GET PERNR

    Hi All,
    I am facing a strange behavior with GET Event for PNP LDB.
    In my selection-screen, i have fields like Payroll Area, Current Period, Other Period, personnel number.
    Usually, i populate Payroll area, other period(say 06-2007) and input some personnel number.
    When i tried to debug for one personnel, its not at all going into GET PERNR event...it directly goes to END-OF-SELECTION event.
    Please help on this.
    Regards,
    Kiran Chennapai

    Hi Manoj,
    The below is some part for my coding:
    START-OF-SELECTION.
      IF pnptimr9 = 'X'.
        PERFORM f_get_next_period.    "Take next period when the selection
        " is current period
      ENDIF.
    Get deatils of actions and pay-scales
      PERFORM f_get_data.
      CLEAR: g_num_processed, g_num_skipped, g_num_success, g_num_error.
    GET pernr.
      rp_provide_from_last p0001 space pn-begda pn-endda.
      IF pnp-sw-found = 1.
    Verify whether the personnel is under the given Payroll area or not
        CHECK p0001-abkrs = pnpxabkr.
        IF p_eegrp IS NOT INITIAL.
    Verify personnel's employee group is under the given EEgroup
          CHECK p_eegrp = p0001-persg.
        ENDIF.
    start processing for the selected personnel
        PERFORM f_process_data.
      ENDIF.
    END-OF-SELECTION.
    Do increment process for all the selected personnel
      IF NOT git_process[] IS INITIAL.
        PERFORM f_increment_process.
      ENDIF.
    When i tried to put a break-point at the first statement in the GET event and executed, its not going into GET event at all.(personnel number is existing in the system)
    Regards,
    Kiran Chennapai

  • Get pernr in screen 900 for ldb PNP

    hi All,
    I have created a program in HR-ABAP using ldb pnp and I have used the screen 900 [for get payroll]  Now for few employees when I use GET pernr, its nt giving ne results. as in the the program goes to end of selection. Now wen i change the screen to normal [ blank or 000], the get pernr for same employees gives me results. Can someone please explain the reason for above?
    thanks,
    RS

    Check whether the payroll run has taken place for the input employee numbers you are giving.
    You can check in the Tcode PC_PAYRESULT.

Maybe you are looking for

  • Can i use the retention policy without using the Flash Recovery area?

    Yes ,lets see here RMAN>list backup summary C:\>dir *.bus Volume in drive C is khurram Volume Serial Number is F49D-FF2B Directory of C:\ File Not Found C:\>dir *.arc Volume in drive C is khurram Volume Serial Number is F49D-FF2B Directory of C:\ Fil

  • Infotype authorizations at Company Code level

    The project I am working on has two company codes 1000 & 1100.  The user requirement is that a person working in one company should be able to make changes only to employee data of employee's in his/her company and to have only read authorizations fo

  • Runtime Errors TSV_TNEW_PAGE_ALLOC_FAILED during extraction

    Hi, Anyone knows what the solution is to this problem: Runtime Errors         TSV_TNEW_PAGE_ALLOC_FAILED |Short text                                                                                | |    No more storage space available for extending a

  • A Leading 3D Architecture Designing Services Provider in India.

    Hi all!!! This is on behalf of Yantram – A Leading 3D Architecture Designing Services Provider in India. I am new to this forum and hope to get good support from all the forum members. Edited by: user10387861 on Oct 3, 2008 2:26 PM

  • Missing activity (and points)?

    Hi, Looks like some of my answers are not in my activity (and points). In particular, I can not find the answer to this question http://social.msdn.microsoft.com/Forums/en-US/660cc75d-b232-4b7e-9198-b485433ecc07/how-to-use-objectschemanameprocid-and-