HR read infotype

Hi friends
I have to read recent (last) record from the following HR tables/infotypes. Shall I use RP_PROVIDE_FROM_LAST macro? Is there any other other good way to read data? Please give me some sample code. I will appreciate ur great help.
PA0001
PA0002
PA0006
PA0008
PA0041
HRP1001
HRP1015
Thanks in advance
Hari

Hello Hari
The following coding shows you how to read any infotype (even simultaneously) for an employee.
METHOD get_infotype_0027 .
* define local data
  DATA:
    lif_employee      type if_pt_employee,
    lt_infotypes      TYPE tim_tmw_itlist_tab,
    lo_control        TYPE REF TO if_pt_td_control,
    lo_data           TYPE REF TO if_pt_td_base,
    lo_pnnnn          TYPE REF TO if_pt_td_itnnnn,
    ls_p0027          TYPE p0027.
* Create employee instance
  lif_employee = cl_pt_employee=>get_employee( p_pernr ).
* Append all required infotypes to itab
  APPEND '0027' TO lt_infotypes.
  CALL METHOD lif_employee->get_infotypes
    EXPORTING
      i_itlist      = lt_infotypes
      i_fromdate    = id_fromdate
      i_todate      = id_todate
*      I_FILTER      =
      i_noauthcheck = 'X'
    IMPORTING
      e_result      = me->mt_infty_request
      e_retcd       = me->md_retcd.
* Please see documentation of parameter e_retcd...
  LOOP AT me->mt_infty_request INTO lo_control.
    lo_data = lo_control->data.  " get data object
*   Casting
    TRY.
        lo_pnnnn ?= lo_data.
      CATCH cx_sy_move_cast_error.
        CONTINUE.
    ENDTRY.
*   Convert infotype (semi-transparent -> transparent)
    CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
      EXPORTING
        prelp = lo_pnnnn->prelp
      IMPORTING
        pnnnn = ls_p0027.
    APPEND ls_p0027 TO rt_p0027.
  ENDLOOP.
* Store infotype 0027 data
  me->mt_p0027 = rt_p0027.
ENDMETHOD.
Unfortunately, I do not have a similar solution for the HRP... tables.
Regards
   Uwe

Similar Messages

  • RP-READ-INFOTYPE

    Hi ,
      i need to delete all the records  with subty X1 for infotype  p0019 . I should n't use the logical database instead i am using  macro RP-READ-INFOTYPE to retrieve the valid data  but  here in case of P0019 the begda and endda of a record will be same and i need to delete the records even if they are in past . But the macro RP-READ-INFOTYPE  is not going to work in this case as it checks against dates and the records are in past so it will not retrieve any data . So any thoughts on how to get the data for P0019  with subty X1 without using the logical database PNP. 
    Thanks,
    Latha.

    Use HR_READ_INFOTYPE FM to retreive the desired result.........
    Pass begda 01/01/1800 endda = '12/31/9999' and subtype you want.......
    Not your infotype table will fill with all the data now you manipulate as you desired
    Let me know if you need any further help!!!
    Sas

  • Read infotype using HR_READ_INFOTYPE

    Hi all,
    I Try to read infotype (pa0021) using HR_READ_INFOTYPE. Its getting fine.
    Im using Web Dynpro ABAP Interactive form.
    I want to insert some value in infotype pa0021, so i used HR_INFOTYPE_OPERATION.
    Data's are Inserting.
    The problem is if i press the Save button, Inserting values are not getting, when i use HR_READ_INFOTYPE in the same session. The new values are updated in the Backend but its not getting
    in the same session. because if i press the save button means, i want to save the data and again i want to show the saved data back .But if i close the session and open once again means its reflection the new values.
    I used BAPI_TRANSACTION_COMMIT also but i no success.
    Please Give some solution for this problem, its very urgent.
    Thanks & Regards,
    Hemachandran.R
    Edited by: hemachandran R on Oct 22, 2008 8:54 AM
    Edited by: hemachandran R on Oct 22, 2008 8:54 AM

    Hi hemachandran R ,
    When all your conditions are satisfied, You can get the updated values from the contexts which you are using to update in the contexts by which you are displaying it on the screen.
    You need not to fetch the data from the back end.
    Regards,
    Rohit

  • Reading Infotype using HR_READ_INFOTYPE

    Hi all,
    I Try to read infotype (pa0021) using HR_READ_INFOTYPE. Its getting fine.
    Im using Web Dynpro ABAP Interactive form.
    I want to insert some value in infotype pa0021, so i used HR_INFOTYPE_OPERATION.
    Data's are Inserting.
    The problem is if i press the Save button, Inserting values are not getting, when i use HR_READ_INFOTYPE in the same session. The new values are updated in the Backend but its not getting
    in the same session. because if i press the save button means, i want to save the data and again i want to show the saved data back .But if i close the session and open once again means its reflection the new values.
    I used BAPI_TRANSACTION_COMMIT also but i no success.
    Please Give some solution for this problem, its very urgent.
    Thanks & Regards,
    Hemachandran.R
    Edited by: hemachandran R on Oct 22, 2008 9:02 AM

    Hi Hema,
    Make a new context attribute 'ca_temp'
    and then
    set single attribute
            lo_el_context->set_attribute(
              EXPORTING
                name =  `CA_TEMP`
                value = <new_value> ).
    And use this CA_TEMP where ever you want. for more than one value make node in place of attribute.
    Hope it works.
    Regards,
    Rohit

  • Need an alternative to rp-read-infotype to display infotype txts frm a BSP?

    Hi All,
    I need to display infotypes maintained texts(F9) from a bsp.  I created a test program to read these texts using rp-read-infotype and got it working but didn't realise i couldn't use this method in a BSP until i copied it in.  total bummer!
    Does anyone know of an alternative that i can use in a BSP.
    Thanks in advance,
    Liz.

    Can you try using FM READ_TEXT  / RFC_READ_TEXT to get the infotype text
    and then find the equivalent function on BSP side .

  • Rfc to read infotypes

    hi...
    is there any RFC function modules for reading infotype details.........
    thank
    prabhakar

    BAPI_EMPLCOMM_GETDETAIL - Communication infotype - infotype 0105
    BAPI_INTCONTROL_GETDETAIL - Internal cont - infotype 32
    BAPI_PDOTYPES_GETDETAILEDLIST - PD infotypes
    BAPI_ABSENCE_GETDETAIL - infotype 2001
    BAPI_W4W5INFOUS_GETDETAIL - W4/W5 info of an emp - infotype 210
    BAPI_DATESPECS_GETDETAILEDLIST - Date specifications -infotype 41
    RFC_ABSENCETYPES_READ - RFC which Lists absence types
    HR_BEN_READ_CREDIT_PLANS - RFC for reading credit plans
    HR_BEN_READ_INSURE_PLANS - RFC for reading insurance plans.
    HR_BEN_READ_HEALTH_PLANS_RFC RFC for Reading Health plans

  • To read Infotype 0025

    Friends i'm writing a report. Which give employees qualification and desired and assessed profeciencies. I'm unable to read infotype 0025. Data is there, but pa0025 table is showing empty status.

    Hi u wont find any entries in PA0025.
    Try using this FM
    HRWPC_RFC_QUALIFICATION_STAFF
    In this FM U have to pass the Qualification ID
    U can also have a look at
    CALL FUNCTION 'RHPP_Q_PROFILE_READ'
       EXPORTING
         BEGDA                  = sy-datum
         ENDDA                  = sy-datum
         WITH_STEXT             = 'X'
         WITH_QK_INFO           = 'X'
      CHECK_NOTE             = ' '
        TABLES
          OBJECTS                = IT_P_OBJECTS
      ERR_OBJECTS            =
          PROFILE                = IT_QUALIFICATION_TAB
    EXCEPTIONS
       NO_AUTHORITY           = 1
       WRONG_OTYPE            = 2
       OBJECT_NOT_FOUND       = 3
       UNDEFINED              = 4
       OTHERS                 = 5
      IF SY-SUBRC <> 0.
        raise nothing_found.
      ENDIF.
    ~ BiSu
    Message was edited by:
            Biswajit Das
    Message was edited by:
            Biswajit Das

  • Adding read infotype records to payroll

    Dear ,
    i 've used the code mentioned in this link to read the infotype records .
    Use SAP defined methods instead of Logical Database(LDB)
    now i want to add this record to the tree in the payroll . could u plz tell me how to add it to a node in the additional payment tree node.
    Edited by: Kathy_Adam on May 22, 2010 3:40 PM

    Hi,
    1. Create new payroll function code in payroll driver exist. Starts with FU<custom name>.
    2. Create new function via PE04 with custome name.
    3. Add custom function to payroll schema.
    Custom name should start with special character, e.g. %, &, :, etc.
    User exit is special for every country driver, check payroll driver program and figure out its name.
    Cheers

  • Where condition for reading infotype while using ldb

    hi
    i want to read info from infotype p0000
    using where condition eg: for pernr = ' '.
    i am using LDB pnp.
    how can i put the where condition while using macro
    rp-provide-from-last.
    regards
    cs

    in fact you don't have to get the values, you only need to tell to the program to take them into account :
    GET PRPS.
      CHECK SELECT-OPTIONS.

  • Reading infotype 2050 ( No database table )

    Hi to all experts,
    I have a requirement to display the details exactly as in infotype 2050. When you check 2050 how it is displayed the annual calender i need to display exactly as it is .I tried using LDB, Macro, FM but the database table for 2050 doesnt exist.The p2050 is there but there is no pa2050. There is no underlying database table for that infotype 2050 (annual calender display). 
    I check some related fm
    like  module      HR_PERSONAL_WORK_SCHEDULE
    any information regarding this will be greatly appreciated.
    THanks

    Actually this information is retrieved based on the data of Planned Working Time, Infotype (0007) and Absences, Attendances and Substitutions (2001, 2002, 2003), there's no specific Infotype DB Table.
    You were using the Correct FM to read the Employee's work schedule (Relevant data is retrieved in PERWS parameter)
        CALL FUNCTION 'HR_PERSONAL_WORK_SCHEDULE'               "XOQK064687
             EXPORTING                                          "XOQK064687
                  PERNR             = PSPAR-PERNR               "XOQK064687
                  BEGDA             = FIA_BEGDA                 "XOQK064687
                  ENDDA             = FIA_ENDDA                 "XOQK064687
                  SWITCH_ACTIV      = 1                         "XOQK064687
                  READ_CLUSTER      = READ_CLUSTER            "YMMAHRK037395
             TABLES                                             "XOQK064687
                  I0000             = M0000                     "XOQK064687
                  I0001             = M0001                     "XOQK064687
                  I0002             = M0002                     "XOQK064687
                  I0007             = M0007                     "XOQK064687
                  I2001             = M2001                     "XOQK064687
                  I2002             = M2002                     "XOQK064687
                  I2003             = M2003                     "XOQK064687
                  PERWS             = PSP2050                   "XOQK064687
             EXCEPTIONS                                         "XOQK064687
                  ERROR_OCCURED     = 1                         "XOQK064687
                  ABORT_OCCURED     = 2                         "XOQK064687
                  OTHERS            = 3.                        "XOQK064687
    If you need to do something similar you'll have to check the IT2050 code

  • Reading infotype

    im trying to read data from infotype 0002 by using hr_raed_infotype
    CALL FUNCTION 'HR_READ_INFOTYPE'
      EXPORTING
       TCLAS                 = 'A'
        pernr                 = 10
        infty                 = '0002'
       BEGDA                 = 'sy-datum'
       ENDDA                 = '99991231'
      tables
        infty_tab             = i_0002
    EXCEPTIONS
       INFTY_NOT_FOUND       = 1
       OTHERS                = 2
    i declared internal table using
    DATA: i_0002 like P0002 occurs 0 with header line.
    but my internal table is not getting populated.
    also plz can anyone explain how to use select statements in hr reporting.
    thnx

    just copy & paste it will work 
    tables :  P0002 .
    parameter :  s_pernr  like P0002-pernr .
    DATA : infty_tab TYPE TABLE OF p0002,
             wa_infty TYPE p0002.
      CALL FUNCTION 'HR_READ_INFOTYPE'
        EXPORTING
    *   TCLAS                 = 'A'
          pernr                 = s_pernr
          infty                 = '0002'
    *   BEGDA                 = '18000101'
    *   ENDDA                 = '99991231'
       BYPASS_BUFFER         = 'X'
    *   LEGACY_MODE           = ' '
    * IMPORTING
    *   SUBRC                 =
        TABLES
          infty_tab             = infty_tab
    * EXCEPTIONS
    *   INFTY_NOT_FOUND       = 1
    *   OTHERS                = 2
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    reward points  if it is usefull .
    Girish

  • Reading infotypes

    im trying to read data from infotype 0002 by using hr_read_infotype
    CALL FUNCTION 'HR_READ_INFOTYPE'
      EXPORTING
       TCLAS                 = 'A'
        pernr                 = 10
        infty                 = '0002'
       BEGDA                 = 'sy-datum'
       ENDDA                 = '99991231'
      tables
        infty_tab             = i_0002
    EXCEPTIONS
       INFTY_NOT_FOUND       = 1
       OTHERS                = 2
    i declared internal table using
    DATA: i_0002 like P0002 occurs 0 with header line.
    but my internal table is not getting populated.
    also plz can anyone explain how to use select statements in hr reporting.
    thnx

    just copy & paste  ...  i modified you query  .. it works  now
    tables :  P0002 .
    parameter :  s_pernr  like P0002-pernr .
    DATA : infty_tab TYPE TABLE OF p0002,
             wa_infty TYPE p0002.
      CALL FUNCTION 'HR_READ_INFOTYPE'
        EXPORTING
    *   TCLAS                 = 'A'
          pernr                 = s_pernr
          infty                 = '0002'
    *   BEGDA                 = '18000101'
    *   ENDDA                 = '99991231'
       BYPASS_BUFFER         = 'X'
    *   LEGACY_MODE           = ' '
    * IMPORTING
    *   SUBRC                 =
        TABLES
          infty_tab             = infty_tab
    * EXCEPTIONS
    *   INFTY_NOT_FOUND       = 1
    *   OTHERS                = 2
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    reward points if it is suefull .
    Girish

  • Read infotype records using the classes

    Hi All,
    In my system i can see many classes with cl_hrpa*
    Here i want to read a infotype record using these classes. I want finally the data in PA0008 or a record in P0008 format.
    i tried using the various classes like
    cl_hrpa_masterdata_factory
    if_hrpa_infty_bl
    hrpad_infty_container_tab
    I tried using the sevaral calsses passing one class type to other. finally i get is the class cl_hrpa_infotype_0008_in.
    can any one suggest how i should be reading the data for any infotype.
    Pls do not suggest the function module HR_READ_INFOTYPE. I want to use these classes to read the data.
    Pls suggest
    Regards,
    Umesh Chaudhari.

    Hi,
    Did you get any replies to this or have you found an answer on your own?
    Regards,
    LC

  • Reading infotype 0041 in PCR

    I need to read the date of joining in PCRs. i am maintaining date specification infotype 41. how to get this date from IT 41 in PCR. What operation i need to use.. Or is there any operation which can directly give hiring date of person without maintaining 41 infotype.
    pls tell its urgent.
    Thanks in Advance.

    I sent you this information, words in bold I think would help you
    Evaluating Date Specifications in Payroll
       Object
         Operations NUM, AMT and RTE evaluate date specifications for the
         calculation of deadlines. Retrieval takes place using the function
         DATES.
         Two dates are determined. These are interpreted as the start and end
         dates of a period. The evaluation of deadlines can return incorrect
         results if the second date lies before the first date. Therefore, for
         deadline calculation purposes, the first date should always be smaller
         than the second date.
         Date types with the following short names can be used for the
         evaluation. All date types other than 'X' are only taken into account if
         they are before the end of the current payroll period.
         In the operations NUM, RTE und AMT, specification of the date type
         follows the operand F directly.
         A, B  First entry from infotype 0000
         C    Last entry, or reentry
         D  Last change of individual working time from infotype 0041
             In table T530, if the field KUNBZ (indicator for irregular payments)
             is 05, then the start date of the work center is taken for D.
         E    Last change of capacity utilization level from infotype 0008
         F    Last change of weekly working hours from infotype 0007
             A comparison is carried out with date type C for the date types D, E
             and F. If the value determined for C is greater than the values
             determined for D, E or F (that is, a later date), the value of C is
             used for D, E or F. Any changes in the capacity utilization level or
             the like before the last reentry are not evaluated. The date of the
             last reentry is taken instead of this date.
         G    Birth date from infotype 0002
         W    Reentry
             The last reentry date is entered in this date specification. If no
             reentry data exists, the initial entry date is used. This date has
             the short name 'A' in the evaluation.
         X     Employee leaves after the end of the period in accordance
         with infotype 0000
             The system checks whether there is a record for infotype 0000
             (Actions) has a record where the Stat2 field has the value 0 (=
             left). The start date (BEGDA) of this record is the leaving date.
             This date type always has an entry. If an employee leaves after the
             end of the period in question, this date will be used. If no leaving
             date exists, the date December 12, 9999 is used.
         Z     Leaving before the end of the period in accordance with infotype
         0000
             The system checks whether there is a record for 0000 (Actions) where
             the Stat2 field has the value 0 (= left). The start date (BEGDA) of
             this record is the leaving date.
             This date type always has an entry. If an employee leaves before the
             period in question, this date is used. If no date is given, the date
             December 31, 9999 is used.
         nn    Date type 'nn' from the Date Specifications infotype (0041)
             Date types are taken from table T548Y.
       Syntax
         The operands are constructed as follows:
             Operation NUM= is taken as an example: Processing is identical for
             RTE and AMT:
          NUM=Faaesb
              F          Fixed indicator for deadline calculation
               aa           Date type: Start date of period to be
                            calculated; if the date type is not 'nn,'
                            the second position is left blank.
                 e          Unit, in which the duration is calculated:
                            T = days
                            W = week
                            M = months
                            C = complete months
                            K = complete calendar months
                            N = complete calendar months (rounded up)
                            J = Years
                            Y = Complete years
                           The difference between the individual
                           units is explained in
         Calculation Examples
                           in more detail.
                  s         End date of period to be calculated:
                            (blank)  End of current payroll period
                            J        End of current calendar year
                            A        Start of current calendar year
                            B        Start of WPBP period
                           No other specifications are possible.
                   b        If the date type specified in parameter aa
                            does not exist for the person in question,
                            an alternative fixed identification is
                            selected. If 'SPACE' is entered, the
                            date 31.12.9999 is used. However, you can use
                           one of the date types listed above as
                           an alternative or enter 0
                           0 to set the alternative value to 0.
       Example
         NUM=FA_M_
               F         Identifier for deadline calculation
               A             Date type A, initial entry from infotype 0000
                _            Blank; placeholder for 2-character
                             date type from infotype 0041
                 M           Deadline calculation is in months
                  _          Blank; key date for deadline calculation
                             End of payroll period
                   _         Blank; If no specification exists for date
                             type A, the date 31.12.9999 is used as an
                             alternative.
         NUM=F01M_A
             F                Identifier for calculation deadline
              01              Date type for technical entry date from
                              infotype 0041
                M             Deadline calculation in months
                 _            blank, key date for calculating the
         deadline
                              End of payroll period
                  A           Alternative date: if no specification exists
                              for date type 01, the first entry from
                              infotype 0000 is used.
         Under Calculation Examples for Evaluating Date Specifications you can
         find more information and case studies regarding how to calculate the
         period between a start and end date for the operations NUM, RTE and AMT.
    Regards. Manuel Campos

  • Read infotype metadata

    Hello,
    We're building a custom (portal) view for editing PA infotypes. We configured IT metadata through transaction PM01 -> Edit Field Characteristics (Cust. Table).
    Now we would like to read this metadata for dynamically detmermine which fields are mandatory, read-only or unused. This metadata appears to be stored in the T588MFPROPC table.
    What is the standard method or FM to read this metadata?
    Thanks in advance

    Thanks!
    It works only for a given field, but that's fine.
    Edited by: Mathieu Scialom on Dec 7, 2010 3:35 PM

Maybe you are looking for

  • Transfering music from an iPod to a computer and more

    All of the music that I have on my computer, I have transfered to my iPod Video. I am going to reboot my computer, which includes deleting all of the music. I would love to have it on my computer though, so I wonder if it's possible for me to "extrac

  • ADVICE NEEDED-URGENT

    Hi Gurus, My requirment is such that i have to split a single sales data into many records based on material. ( A material 'AA' has some X components, i have to split the data for that material'AA' into X records. Each record corresponding to a parti

  • Partial Clearing using FP05

    Hi Experts, I am facing a very peculiar problem . We have configured a clearing variant which allows partial clearing of invoice. Someone has changed the configuration now and every time when I post a Posting lot the invoice is getting cleared fully.

  • How to display confirm message in APEX pl/sql process

    I have a pl/sql process that selects success messages from a database table. These messages need to be displayed to the user and confirmed (only one button, to acknowledge/dismiss the mssage) along the way. Is there a way to do this within the proces

  • How would I code to resize my UILoader in SWF

    Hi All I have loaded different SWFs using UI Loader component and I have used AS 3.0 for that. All those SWFs are playing video in form of Flvs in that. While executing those UI Loaders show video efficiently. Is there any way that I can code so that