GET PERNR thows to end Of Selection

Hi
i am new to the HR-ABAP
I am writing one custoized Payslip Z program.  i have used Get Prnr macro.  However, it does not populate the PERNR structure and the related infotypes.
Can someone help me where i am missing.
I used appropriate LDB in Program attriutes.
regards,
venkat

- [GET|http://help.sap.com/abapdocu_70/en/ABAPGET-.htm] PERNR is not a macro but an Abap statement (actually an event) used in logical database (check nodes via SE36 on ldb like PNP), RP_READ_INFOTYPE is a macro as example.
- Did you define PERNR as [TABLES|http://help.sap.com/abapdocu_70/en/ABAPTABLES.htm] or [NODES|http://help.sap.com/abapdocu_70/en/ABAPNODES.htm] in your report
Sample
REPORT RPABAP05.
TABLES: PERNR.
INFOTYPES:  2001 MODE N.
GET PERNR.
  RP-READ-ALL-TIME-ITY PN/BEGDA PN/ENDDA.
  LOOP AT P2001.
    WRITE: / P2001-ABWTG.
  ENDLOOP.
other sample
REPORT RPABAP01.
TABLES: PERNR.
INFOTYPES: 0001.
  GET PERNR.
    PROVIDE * FROM P0001 BETWEEN PN-BEGDA AND PN-ENDDA.
    WRITE:  / P0001-PERNR,
              P0001-STELL,
              P0001-BEGDA,
              P0001-ENDDA.
    ENDPROVIDE.
(look at help.sap.com or sdn.sap.com with correct keywords, you will find many samples)
Regards,
Raymond

Similar Messages

  • Regading GET Pernr

    Hi All,
    I have a requriement to fetch last pernr.Once after using GET PERNR statement in my program i will get all the pernrs available.So after this i want to fetch only the last pernr exists.For example if i have 1000 pernrs after my get pernr statment i want to fetch only the 1000 pernr .so please suggest me on this.

    HI..
    this one is simple to try..
    REPORT  YH642_HR_TEST.
    TABLES: PERNR.
    INFOTYPES: 0001.
    <b>start-of-selection.</b>
      GET PERNR.
    <b>end-of-selection.</b>
    read table p0001 index 1.
    WRITE:  / P0001-PERNR,
                  P0001-plans,
                  P0001-BEGDA,
                  P0001-ENDDA.
    it always stores the last pernr details in the last loop. So go to end-of-selection and print the details.

  • Get pernr late

    hello friends.
    please anybody tell me in what conditions can we use get pernr late event. can we give get pernr late after end-of-selection. pls explain with an example.
    thanks

    hi
    good
    The GET PERNER is exclusively used in HR ABAP. The GET event gets the node.
    The text below will explain the GET event better.
    This statement defines an event block whose result is triggered by the ABAP runtime environment after submitting an executable program, if the logical database to which the program is linked, provides data in the work area node. The node work area must be declared with the NODES statement (or TABLES). The data can be processed in the event block.
    GET node also controls the behavior of the logical database.
    And GET node Late
    GET node LATE [FIELDS f1 f2 ...].
    Effect
    This statement defines an event block whose result is triggered by the ABAP runtime environment after submitting an executable program, when the logical database has read in all records of node node. For node and FIELDS, the same applies as for the previous variant. Use this event block for final processing actions concerning the hierarchy level of the node.
    We generally use the same when we write the PAYROLL as to get the entire payroll structure from the database.
    reward point if helpful.
    thanks
    mrutyun^

  • 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

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

  • 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

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

  • Get pernr in creen 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

    Hi Reena
    Check the status of employees for no result is displayed in 900 screen. Either they are active or payroll is run or not. That might be one of the reason. Another reason can be they are being open for the changes.
    Regards
    Waz

  • Don't use GET PERNR error

    Hello Experts,
    I'm trying to write a code using GET PERNR statement for every first time but keeps getting the error when try to execute my code. Here is the error (Do not use the GET PERNR event).
    Can somebody please help me rectify this error. For reference here is my code.
    report  zad_hr_test line-size 200.
    *Database Table
    tables: pernr,           " Pernr structure for Logical database
            pa0001,           " Actions
            pa0002.           " Personnel Info
    *Infotypes
    infotypes: 0001,         " Actions
                0002.         " personnel info
    *Variable Declaration
    data: form_nam like p0001-ename,
           v_age(5) type c,       "variable for calculating age in days
           v_ctr1 type i value 0, "counter
           v_ctr2 type i value 0, "counter
           var(5) type c ,        " variable to store btrtl
           var1(5) type c  .      " variable to store werks
    *Internal Table Decalartion
    data: begin of i_tab1 occurs 0,
            werks like pa0001-werks,  "personnel area
            btrtl like pa0001-btrtl,  "personnel sub area
            pernr like pa0001-pernr,  "employee number
            ename like pa0001-ename,  "employee name
            begda like pa0002-begda,  "employee join date
            persg like pa0001-persg,  "employee group
            persk like pa0001-persk,  "employee sub-group
            plans like pa0001-plans,  "position
            gbdat like p0002-gbdat,   "date of birth
          end of i_tab1.
    *START-OF-SELECTION
    start-of-selection .
    get pernr .
    i_tab1-pernr = pernr-pernr.
       rp_provide_from_last p0001 space pn-begda pn-endda .   " Macro for IFT-0001
       rp_provide_from_last p0002 space pn-begda pn-endda .   " Macro for IFT-0002
    **--> Populate internal table
       move p0001-werks to i_tab1-werks .
       move p0001-btrtl to i_tab1-btrtl .
       move p0001-pernr to i_tab1-pernr .
       move p0001-ename to i_tab1-ename .
       move p0002-begda to i_tab1-begda .
       move p0001-persg to i_tab1-persg .
       move p0001-persk to i_tab1-persk .
       move p0001-plans to i_tab1-plans .
       move p0002-gbdat to i_tab1-gbdat .
    **--> Append data to internal table
       append i_tab1 .
       clear i_tab1 .
       loop at i_tab1.
         write:/ i_tab1-werks,
                 i_tab1-btrtl,
                 i_tab1-pernr,
                 i_tab1-ename,
                 i_tab1-begda,
                 i_tab1-persg,
                 i_tab1-persk,
                 i_tab1-plans,
                 i_tab1-gbdat.
       endloop.
    Many thanks in advance.

    Hi,
    You're asking a different question now, so you should start a new thread...
    Anyway, in the 'Attributes' screen of your program you can specify which selection screens you want to display for a logical database.
    Alternatively you can hide all (or part) of a selection screen at the 'selection-screen output' event.
    For example:
    at selection-screen output.
      loop at screen.
       check screen-name = 'PNPABKRS-HIGH'
          or screen-name = 'PNPABKRS-LOW'.
       screen-input = '0'.
       screen-output = '0'.
       screen-invisible = '1'.
       screen-active = '0'.
       modify screen.
      endloop.
    cheers
    Paul

  • Problem with get pernr

    in my requirement i take the perner from one program  to ldb program and
    i want the ldb to run for my pernr value from other program...its working  in
    dubbing  mode .. now the prob is
    i m not able to come out of the loop between get pernr and end of selection its
    the excution is gng into ldb
    in SAPLHRAC
    IF HRAC_BADI IS INITIAL.
    EXIT.
    endif.
    not coming out...
    wen i run ldb(rptqta10) alone passing values directly its working fine..
    can any one help me
    points will be given....

    can any one give me solution

  • Regarding GET PERNR and GET OBJECT

    Hi,
       I want to know the purpose and working of these 2 events.  can any body give me  the explanation r any document on these 2 events.
      Thanks & Regards,
      Suresh

    Hi
    This 2 events are used in HR programming. On PA if you use logical database PNP or PNPCE ,the internal tables of infotypes specified will be populated with data for that particular employee number.
    Check the sample code below and see how it works.
    report z_test .
    tables:pernr .
    infotypes:0001,
              0002,
              0006.
    start-of-selection.
    get pernr.
    end-of-selection.

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

  • PERNR is not read in GET PERNR event for some period..

    We have one ABAP report where we read financial data of our employees. But there is some PERNRs that is not read in the GET PERNR event the program skips to END-OF-SELECTION. I have all authorization to access this kind of data through other txn like PC_PAYRESULT. And this data appears in another ABAP reports. We've noted that the PERNRs that not appears doesn't have the Hiring Actions. And the data is read for this year 2007 but not to 2006 when the Action occurred. Does anyone knows what may be causing this?
    Thanks,

    When you say custom, you mean, not standard report right?
    TABLES: pernr.
    INFOTYPES: 0001.
    GET pernr.
    Verifica seleções
      CHECK pernr-werks IN pnpwerks.
      CHECK pernr-btrtl IN pnpbtrtl.
      CHECK pernr-plans IN pnpplans.
      CHECK pernr-kostl IN pnpkostl.
      CHECK pernr-abkrs EQ pnpxabkr.
      CHECK pernr-persg IN pnppersg.
      CHECK pernr-persk IN pnppersk.
      CHECK pernr-stell IN pnpstell.
      CHECK pernr-orgeh IN pnporgeh.
      CHECK pernr-orgeh IN pnpobjid.
      CHECK pernr-ansvh IN pnpansvh.
      CHECK pernr-stat2 IN pnpstat2.
      PERFORM seleciona_dados.
    END-OF-SELECTION.
      perform xyz.
    We use a custom report category with the fields:
    PNPXABKR
    PNPPABRJ
    PNPPERNR
    The program checks if PNPPERNR is not initial.
    When we executes it with PNPXABKR = 02, PNPPABRJ = 2006. Some PERNR does not are read. The programa skips to 'perform xyz'.  We found out that these PERNRs don't have the Action Hiring. We don't know if its because of it.

Maybe you are looking for

  • Delete bottom widget In JPanel screwyness

    Hi Everybody, Any help on this problem or my forum conduct is appreciated (yay I'm a n00b!). I must be doing something wrong here, because I don't see how this could not have been seen before and I couldn't find anything related in searches. I create

  • Songs erased from ipod

    my ipod froze, and then after i reset it, all the songs were gone. this happened once before, and that time after resetting it a second time, the songs came back. no luck this time, and the songs aren't saved on i tunes. any help is greatly appreciat

  • N96 Keyboard lock problem

    Hi everybody. With my old n95 when i closed the slide the keyboard was locked. when i opened it it was unlocked again. With my new N96 when i close the slide it doesn't lock. it locks itself in a certain amount of time (i put it on 10s), but i can't

  • Determination of Purchasing area ?

    Hi Folks What is determination of Purchasing Area ? Why it is need to determine and at which level ?

  • Disk replacement procedure for cluster

    Hi, I have a clustered duplex server with 2 shared external disk shelves. The disks are striped and then mirrored. There was a hard disk failure with one of the mirrored disks. I've found two different disk replacement procedures from the Sunsolve si