FUNCTION ZIF_HR_GET_WORK_SHEDULE_4_ORG.
*"----------------------------------------------------------------------
*"*"局部接口:
*" IMPORTING
*" VALUE(ORGID) TYPE HROBJID 组织Id 从ppose里面选择指定的组织id
*" VALUE(BEGDA) TYPE SY-DATUM
*" VALUE(ENDDA) TYPE SY-DATUM
*" TABLES
*" OUTSHEDULE STRUCTURE PDPSP
*" OUTSHEDULESP STRUCTURE PDSPPSP
*"----------------------------------------------------------------------
DATA:LSTRUCT LIKE STRUC OCCURS 0 WITH HEADER LINE.
DATA:LOBJ LIKE OBJEC OCCURS 0 WITH HEADER LINE .
data:lPDPNR like PDPNR OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
ACT_OTYPE = 'O'
ACT_OBJID = ORGID
ACT_WEGID = 'O-O-P'
* ACT_INT_FLAG =
* ACT_PLVAR = ''
ACT_BEGDA = BEGDA
ACT_ENDDA = ENDDA
ACT_TFLAG = 'X'
ACT_VFLAG = 'X'
AUTHORITY_CHECK = 'X'
TABLES
* RESULT_TAB = LT_RESULT
RESULT_OBJEC = LOBJ
RESULT_STRUC = LSTRUCT
EXCEPTIONS
NO_PLVAR_FOUND = 1
NO_ENTRY_FOUND = 2
OTHERS = 3.
LOOP AT LSTRUCT WHERE OTYPE = 'P'.
LPDPNR-PERNR = LSTRUCT-OBJID.
APPEND LPDPNR.
ENDLOOP.
CALL FUNCTION 'HR_PERSON_READ_WORK_SCHEDULE'
EXPORTING
BEGIN_DATE = BEGDA
END_DATE = endda
TABLES
PERNR_TAB = LPDPNR
PSP = OUTSHEDULE
DAY_PSP = OUTSHEDULESP.
ENDFUNCTION.
SAP HR 获取某个时间段 某个组织下所有人员的排班信息
最新推荐文章于 2023-06-21 10:20:15 发布