HR疏导中常用的FM

源由:SAP HR资源网  作者:小彭  (审查繁难)

 1、RH_STRUC_GET 用于得到构造单元下的位子及人员音信

CALL FUNCTION ‘RH_STRUC_GET’ ” 得到人员音信
EXPORTING
ACT_OTYPE = ‘O’
ACT_OBJID = PNPOBJID-LOW
ACT_WEGID = ‘O-O-P’
* ACT_INT_FLAG =
ACT_PLVAR = ‘01′
ACT_BEGDA = PNPDISBD ” 这个年光往昔的有效的构造单元和人
ACT_ENDDA = PNPDISED
ACT_TDEPTH = 0
ACT_TFLAG = ‘X’
ACT_VFLAG = ‘X’
AUTHORITY_CHECK = ‘X’
TABLES
RESULT_TAB = RESULT_TAB
* RESULT_OBJEC = TAB_ORG
* RESULT_STRUC =
EXCEPTIONS
NO_PLVAR_FOUND = 1
NO_ENTRY_FOUND = 2
  OTHERS = 3.

2、CU_READ_RGDIR 得到岁月
CALL FUNCTION ‘CU_READ_RGDIR’
EXPORTING
PERSNR = ZPERNR
TABLES
IN_RGDIR = RGDIR
EXCEPTIONS
NO_RECORD_FOUND = 1
  OTHERS = 2.

3、PYXX_READ_PAYROLL_RESULT
* 凭据索引号得到工钱数
CALL FUNCTION ‘PYXX_READ_PAYROLL_RESULT’
EXPORTING
CLUSTERID = ‘CN’
EMPLOYEENUMBER = IT_WERKS-PERNR
SEQUENCENUMBER = I_SEQNR-SEQNR
CHANGING
PAYROLL_RESULT = I_RT.
IF SY-SUBRC 0.
ENDIF.

4、F4津贴 用于屏幕中的F4 津贴
CALL FUNCTION ‘F4IF_INT_TABLE_VALUE_REQUEST’
EXPORTING
RETFIELD = ‘ZVARNAME’
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = ‘ZVAR’
VALUE_ORG = ‘S’
TABLES
VALUE_TAB = IT_VARMC
RETURN_TAB = SELECTED_TABLE
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
  OTHERS = 3.

5、进行工钱模拟核算
* Simulation run payroll
SUBMIT HCNCALC0 ” 薪资核算
* VIA SELECTION-SCREEN
WITH PNPTIMRA EQ ‘X’
* with pnppermo eq pn/permo
WITH PNPPERNR EQ PERNR-PERNR
WITH PNPXABKR EQ PNPXABKR
WITH PNPPABRP EQ PNPDISBD+4(2) “Month
WITH PNPPABRJ EQ PNPDISBD+0(4) “Year
* WITH pnpabkrs EQ pnpxabkr
WITH SCHEMA EQ ‘ZM01′ ” 蒙东电力工钱核算模式
WITH TEST EQ ‘NOUPD/RT/OFF’
WITH TST_ON EQ ‘X’
WITH PRT_PROT EQ ‘ ‘
WITH ECALLED EQ ‘X’
WITH SW_SPOOL EQ ‘ ‘
  AND RETURN.

IMPORT RT FROM MEMORY ID ‘RT’.
FREE MEMORY ID ‘RT’.
6、动态内表
CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
EXPORTING
IT_FIELDCATALOG = IT_STRUCTURE
IMPORTING
EP_TABLE = DY_TABLE.
*设定指向 dy_table
ASSIGN DY_TABLE->* TO .

” 赋值
CREATE DATA DY_LINE LIKE LINE OF .
ASSIGN DY_LINE->* TO .
  DATA: INDEX LIKE SY-TABIX .

7、得到最一个月的后终日
CALL FUNCTION ‘RP_LAST_DAY_OF_MONTHS’
EXPORTING
DAY_IN = W_BEGDA
IMPORTING
LAST_DAY_OF_MONTH = W_ENDDA
EXCEPTIONS
DAY_IN_NO_DATE = 1
OTHERS = 2.
8、 弹出音信框 (这个FMABAP中用的比力多)
CALL FUNCTION ‘POPUP_TO_CONFIRM_WITH_MESSAGE’
EXPORTING
DEFAULTOPTION = ‘N’
DIAGNOSETEXT1 = TEXT-020 “warning against inconsistency
DIAGNOSETEXT2 = TEXT-021
DIAGNOSETEXT3 = TEXT-022 “red = already booked!
TEXTLINE1 = ‘ ‘
TEXTLINE2 = TEXT-023 “delete nevertheless?
TITEL = ‘Delete?’(026)
START_COLUMN = 25
START_ROW = 6
IMPORTING
ANSWER = ANSWER
EXCEPTIONS
OTHERS = 1.
IF SY-SUBRC NE 0.
MESSAGE E241(57) “error in function module &1 with return code &2
WITH ‘POPUP_TO_CONFIRM_WITH_MESSAGE’ SY-SUBRC.
ENDIF.
IF ANSWER = ‘J’.

ENDIF

9、 CALL FUNCTION ‘REBUILD_PAYROLL_DIRECTORY’ 很少用 (参照行径: PUDEL20)

10、HR_GET_TIME_BETWEEN_DATES 得到日期 年月差
CALL FUNCTION ‘HR_GET_TIME_BETWEEN_DATES’
EXPORTING
BEG_DATE = IT_WERKS-ZRZRQ
END_DATE = SY-DATUM
IMPORTING
* DAYS =
MONTHS = L_MONTH
YEARS = L_YEAR .

 11、RH_GET_PERNR_WITHOUT_POSITION

12、RH_OBJID_REQUEST 这个用的比力多,用于得到HR构造构架结构图的F4津贴

 13、HR_HCP_READ_OBJECT_TEXT 得到东西文本

 14、RP_GET_HIRE_DATE 清晰年光范例找对应的日期 常用语0041 中

测验训诫
最近创新内容
Google广告