Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Fetching record from infotype using class

Former Member
0 Kudos

Hi All,

   How to fetch records for a few fields from info type 5125 using class??

and also help me out with  how to find classes using which we can fetch data from hrp tables.

Thanks in advance.

1 REPLY 1

raymond_giuseppi
Active Contributor
0 Kudos

You could have looked for the classes in the same package than FM HR_READ_INFOTYPE, and you would have easily found CL_HRPA_READ_INFOTYPE.

  data a_read_infotype type ref to if_hrpa_read_infotype.

  data pnnnn           type pnnnn.

  data data_exists     type boole_d.

  call method cl_hrpa_read_infotype=>get_instance

    importing

      infotype_reader = a_read_infotype.

  call method a_read_infotype->read_single

    exporting

      tclas         = 'A'

      pernr         = pnnnn-pernr

      infty         = 'nnnn'

      subty         = space

      objps         = space

      sprps         = ' '

      begda         = pnnnn-begda

      endda         = pnnnn-endda

      mode          = '3'

      no_auth_check = space

    importing

      pnnnn         = pnnnn

      data_exists   = data_exists.

Regards,

Raymond