11-19-2018 3:29 PM
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
11-19-2018 3:45 PM
You could get some 'inspiration' in samples such as IF_HRBAS_INFTY_CONTAINER, IF_EX_HRPAD00INFTY or even CL_HR_PNNNN_TYPE_CAST.
11-19-2018 3:45 PM
You could get some 'inspiration' in samples such as IF_HRBAS_INFTY_CONTAINER, IF_EX_HRPAD00INFTY or even CL_HR_PNNNN_TYPE_CAST.