For infotypes that must be read frequently – for example, the
Organizational Assignment
and
Payroll Status
infotypes (0001 and 0003, respectively) – the standard system provides corresponding read methods – for example, P0001 and P0003.
Example
Read method P0001 is called in the following manner.
p0001 = p0001( tclas = tclas pernr = pernr begda = begda ).
If you plan to create a new infotype, and if your infotype will require data from other infotypes, we recommend that you implement the following business logic.
CALL METHOD a_read_infotype->read_single EXPORTING tclas = tclas pernr = pernr infty = '0003' subty = space objps = space sprps = if_hrpa_read_infotype=>unlocked begda = low_date endda = high_date mode = if_hrpa_read_infotype=>last_intersecting_record no_auth_check = true IMPORTING pnnnn = p0003 data_exists = data_exists.
The above business logic enables your infotype to obtain multiple records from the corresponding infotype to be read. By means of the method
READ_SINGLE
, this business logic also allows your infotype to read cost assignment and other secondary data. If you would like to implement the method
READ_SINGLE
in your infotype, review interface
IF_HRPA_READ_INFOTYPE
.
Caution
Never substitute the method
READ_SINGLE
with function module
HR_READ_INFOTYPE
, nor with an external perform into subroutine pool SAPFP50P.