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: 

User FM HR_READ_INFOTYPE with dynamic infty_tab

former_member310342
Participant
0 Kudos

Hey,
I implement a method to my class which should return the data of an infotype that I'm importing to the method.
So that I have one method which I can call to get Infotype data and dont have to call the FM over and over again.
The other parameters like INFTY are easy but I'm not sure how to get the right type for the result_table (infty_tab).

This table could be different depending on which infotype I want to read.

Is there an option how I can set this type dynamically depening on the specific infotype I want to read?

  CALL FUNCTION 'HR_READ_INFOTYPE'
    EXPORTING
      pernr                 = gv_pernr
      infty                 = iv_infotype
     BEGDA                 = iv_begda
     ENDDA                 = iv_endda
    TABLES
      infty_tab             = it_infty_tab
*   EXCEPTIONS
*     INFTY_NOT_FOUND       = 1
*     OTHERS                = 2
            .
  IF sy-subrc <> 0.
* Implement suitable error handling here
  ENDIF.

Thanks and kind regards

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor

You could get some 'inspiration' in samples such as IF_HRBAS_INFTY_CONTAINER, IF_EX_HRPAD00INFTY or even CL_HR_PNNNN_TYPE_CAST.

1 REPLY 1

raymond_giuseppi
Active Contributor

You could get some 'inspiration' in samples such as IF_HRBAS_INFTY_CONTAINER, IF_EX_HRPAD00INFTY or even CL_HR_PNNNN_TYPE_CAST.