HR开发 获取信息类型数据

时间:2024-01-09 19:16:14

1、PNP逻辑数据库。

  LOOP获取信息类型数据。

TABLES: PERNR .
INFOTYPES: , . START-OF-SELECTION. GET PERNR .
LOOP AT P0000 WHERE ...
...
ENDLOOP.
LOOP AT P0001 WHERE ...
...
ENDLOOP.

  宏获取信息类型数据。

TABLES: PERNR, T001P.
INFOTYPES: , . GET PERNR .
RP_PROVIDE_FROM_FRST P0000 SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = . ENDIF. RP_PROVIDE_FROM_FRST P0001 SPACE PN-BEGDA PN-ENDDA.
RP-READ-T001P P0001-WERKS P0001-BTRTL SPACE.
WRITE T001P-BTEXT.

2、通过函数获取。

INFOTYPES: ,  .
DATA RETURN LIKE SY-SUBRC. CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
* TCLAS = 'A'
PERNR = PERNR
INFTY = ''
* BEGDA = '18000101'
* ENDDA = '99991231'
* BYPASS_BUFFER = ' '
* LEGACY_MODE = ' '
IMPORTING
SUBRC = RETURN
TABLES
INFTY_TAB = P0000
EXCEPTIONS
INFTY_NOT_FOUND =
OTHERS =
.
获取雇佣日期

INFOTYPES:  .
DATA GV_HDATE TYPE SY-DATUM. CALL FUNCTION 'RP_GET_HIRE_DATE'
EXPORTING
PERSNR = PERNR
CHECK_INFOTYPES = ''
* DATUMSART = '01'
* STATUS2 = '3'
* P0016_OPTIONEN = ' '
IMPORTING
HIREDATE = GV_HDATE
.