`
Jack Wu
  • 浏览: 886810 次
  • 来自: ...
社区版块
存档分类
最新评论

SAP的一些HR函数

阅读更多
HOLIDAY_CHECK_AND_GET_INFO Useful for determining whether or not a date is a holiday. Give the function a date, and a holiday calendar, and you can determine if the date is a holiday by checking the parameter HOLIDAY_FOUND.


Example:

data: ld_date like scal-datum default sy-datum,
lc_holiday_cal_id like scal-hcalid default 'CA',
ltab_holiday_attributes like thol occurs 0 with header line,
lc_holiday_found like scal-indicator.

CALL FUNCTION 'HOLIDAY_CHECK_AND_GET_INFO'
EXPORTING
date = ld_date
holiday_calendar_id = lc_holiday_cal_id
WITH_HOLIDAY_ATTRIBUTES = 'X'
IMPORTING
HOLIDAY_FOUND = lc_holiday_found
tables
holiday_attributes = ltab_holiday_attributes
EXCEPTIONS
CALENDAR_BUFFER_NOT_LOADABLE = 1
DATE_AFTER_RANGE = 2
DATE_BEFORE_RANGE = 3
DATE_INVALID = 4
HOLIDAY_CALENDAR_ID_MISSING = 5
HOLIDAY_CALENDAR_NOT_FOUND = 6
OTHERS = 7.

if sy-subrc = 0 and
lc_holiday_found = 'X'.
write: / ld_date, 'is a holiday'.
else.
write: / ld_date, 'is not a holiday, or there was an error calling the function'.
endif.


HOLIDAY_GET Provides a table of all the holidays based upon a Factory Calendar &/ Holiday Calendar.

HR_BEN_GET_FROM_FEATURE_BAREA Call the HR feature to determine the Benefit Area for an employee

HR_BEN_GET_FROM_FEATURE_BENGR Call the HR feature to determine the Benefit Group for an employee

HR_BEN_GET_FROM_FEATURE_BSTAT Call the HR feature to determine the Benefit Status for an employee

HR_BEN_GET_FROM_FEATURE_COVGR Call the HR feature to determine the Cover Group for an employee

HR_BEN_GET_FROM_FEATURE_CSTV1 Call the HR feature to determine the CSTV1 feature for an employee

HR_BEN_GET_FROM_FEATURE_EECGR Call the HR feature to determine the Employee Cost Group for an employee

HR_BEN_GET_FROM_FEATURE_ELIGR Call the HR feature to determine the Eligiblity Group for an employee

HR_BEN_GET_FROM_FEATURE_ERCGR Call the HR feature to determine the Employer Cost Group for an employee

HR_BEN_GET_FROM_FEATURE_EVTGR Evaluate the EVTGR feature for an employee

HR_BEN_GET_FROM_FEATURE_FLXGR Evaluate the FLXGR feature for an employee

HR_BEN_GET_FROM_FEATURE_LDAYW Evaluate the LDAYW feature for an employee

HR_BEN_GET_FROM_FEATURE_LRPGR Evaluate the LRPGR feature for an employee

HR_BEN_GET_FROM_FEATURE_TRMGR Evaluate the TRMGR feature for an employee

HR_BEN_GET_FROM_FEATURE_VARGU Evaluate the VARGU feature for an employee

HR_DISPLAY_BASIC_LIST is an HR function, but can be used for any data. You pass it data, and column headers, and it provides a table control with the ability to manipulate the data, and send it to Word or Excel. Also see the additional documentation here.

HR_GET_LEAVE_DATA Get all leave information (includes leave entitlement, used holidays/paid out holidays)

HR_IE_NUM_PRSI_WEEKS Return the number of weeks between two dates.

HR_INFOTYPE_OPERATION BAPI function module to create/change infotypes in HR


Example:

REPORT ZZKNB_BAPI_INFOTYPE_CALL .

* Use 'BAPI_EMPLOYEE_ENQUEUE' to lock the employee before updating
DATA: l_bapireturn LIKE bapireturn1.

DATA: bapipakey_tab LIKE bapipakey OCCURS 0 WITH HEADER LINE.

data: l_p0169 like p0169.

parameters: p_pernr like p0169-pernr default '07000003'.

start-of-selection.

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = p_pernr
IMPORTING
return = l_bapireturn.

IF l_bapireturn-id NE space.
WRITE: / l_p0169-pernr, 'Enqueue failed'.
exit.
ENDIF.

*-- Suported operations:
*-- change (operation = 'MOD')
*-- Create (operation = 'INS')
*-- DELETE (operation = 'DEL')
*-- CREATESUCCESSOR (operation = 'COP')
.
l_p0169-barea = '7A'.
l_p0169-pltyp = 'RRSP'.
l_p0169-bplan = 'RRSP'.
l_p0169-elidt = '20000101'.
l_p0169-enrty = 'M'.
l_p0169-perio = '4'.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0169'
subty = 'RRSP'
number = p_pernr
record = l_p0169
validitybegin = '20021001'
validityend = '99991231'
operation = 'INS'
* dialog_mode = '0' "Use default
* nocommit = '1' "Use default
IMPORTING
return = l_bapireturn
key = bapipakey_tab.

IF l_bapireturn-id NE space.
WRITE: / p_pernr,
20 'Create was unsuccessful',
l_bapireturn-id,
l_bapireturn-message+0(40).
ELSE.
WRITE: / p_pernr,
20 'Create was successful',
l_bapireturn-id,
l_bapireturn-message+0(40).
ENDIF.


* Use 'BAPI_EMPLOYEE_DEQUEUE' to un-lock the employee before updating
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = l_p0169-pernr
IMPORTING
return = l_bapireturn.


HR_PAYROLL_PERIODS_GET Get the payroll period for a particular date. (provided by Francois Henrotte)


Example:

DATA: IT_T549Q TYPE T549Q OCCURS 0 WITH HEADER LINE,
IT_ZL TYPE PC2BF OCCURS 0 WITH HEADER LINE.

W_BEGDA = '20010101'.
W_PERNR = '00000001'.

CALL FUNCTION 'HR_PAYROLL_PERIODS_GET'
EXPORTING
get_begda = w_begda
TABLES
get_periods = it_t549q
EXCEPTIONS
no_period_found = 1
no_valid_permo = 2.
CHECK sy-subrc = 0.

CALL FUNCTION 'HR_TIME_RESULTS_GET'
EXPORTING
get_pernr = w_pernr
get_pabrj = it_t549q-pabrj
get_pabrp = it_t549q-pabrp
TABLES
get_zl = it_zl
EXCEPTIONS
no_period_specified = 1
wrong_cluster_version = 2
no_read_authority = 3
cluster_archived = 4
technical_error = 5.

NOTE: it_zl-iftyp = 'A' absence
it_zl-iftyp = 'S' at work


HR_READ_INFOTYPE generic PA infotype read with authorization checks

HR_TIME_RESULTS_GET Get the time results for a payroll period. (provided by Francois Henrotte)


Example:

DATA: IT_T549Q TYPE T549Q OCCURS 0 WITH HEADER LINE,
IT_ZL TYPE PC2BF OCCURS 0 WITH HEADER LINE.

W_BEGDA = '20010101'.
W_PERNR = '00000001'.

CALL FUNCTION 'HR_PAYROLL_PERIODS_GET'
EXPORTING
get_begda = w_begda
TABLES
get_periods = it_t549q
EXCEPTIONS
no_period_found = 1
no_valid_permo = 2.
CHECK sy-subrc = 0.

CALL FUNCTION 'HR_TIME_RESULTS_GET'
EXPORTING
get_pernr = w_pernr
get_pabrj = it_t549q-pabrj
get_pabrp = it_t549q-pabrp
TABLES
get_zl = it_zl
EXCEPTIONS
no_period_specified = 1
wrong_cluster_version = 2
no_read_authority = 3
cluster_archived = 4
technical_error = 5.

NOTE: it_zl-iftyp = 'A' absence
it_zl-iftyp = 'S' at work


HRWPC_RFC_ABKRS_TEXT_GET Get text description for Payroll Area

HRWPC_RFC_ANRED_TEXT_GET Get text description for Title

HRWPC_RFC_ANSVH_TEXT_GET Get text description for Work Contract

HRWPC_RFC_BLAND_TEXT_GET Get text description for Tax Region

HRWPC_RFC_BTRTL_TEXT_GET Get text description for Personnel Subarea

HRWPC_RFC_BUKRS_TEXT_GET Get text description for Company Code

HRWPC_RFC_BVMRK_TEXT_GET Get text description for Processing indicator

HRWPC_RFC_COMTY_TEXT_GET Get text description for Type of control recipe destination

HRWPC_RFC_COUNC_TEXT_GET Get text description for County Code

HRWPC_RFC_CURCY_TEXT_GET Get text description for Currency Key

HRWPC_RFC_EVGRD_TEXT_GET Get text description for Evaluation Group

HRWPC_RFC_FAMEI_TEXT_GET Get text description for Family Characteristics
 HRWPC_RFC_FAMST_TEXT_GET Get text description for Marital Status Key

HRWPC_RFC_FISTL_TEXT_GET Get text description for Funds Center

HRWPC_RFC_FREQU_TEXT_GET Get text description for Period

HRWPC_RFC_GEBER_TEXT_GET Get text description for Funds

HRWPC_RFC_GESCH_TEXT_GET Get text description for Gender Key

HRWPC_RFC_GSBER_TEXT_GET Get text description for Business Area

HRWPC_RFC_IT0XXX_TEXT_GET Get text stored on the infotype

HRWPC_RFC_JCODE_TEXT_GET Get text description for Survery Job

HRWPC_RFC_KOKRS_TEXT_GET Get text description for Controlling Area

HRWPC_RFC_KONFE_TEXT_GET Get text description for Religious Denomination Key

HRWPC_RFC_KOSTL_TEXT_GET Get text description for Cost Center

HRWPC_RFC_LAND_TEXT_GET Get text description for Country of company

HRWPC_RFC_MASSG_TEXT_GET Get text description for Reason for Action

HRWPC_RFC_MASSN_TEXT_GET Get text description for Action Type

HRWPC_RFC_MOLGA_TEXT_GET Get text description for Country Grouping

HRWPC_RFC_NAMZ2_TEXT_GET Get text description for Name Affix for Name at Birth

HRWPC_RFC_NAMZU_TEXT_GET Get text description for Other Title

HRWPC_RFC_NATIO_TEXT_GET Get text description for Nationality

HRWPC_RFC_ORGEH_TEXT_GET Get text description for Organizational Unit

HRWPC_RFC_OTYPE_TEXT_GET Get text description for Object Type

HRWPC_RFC_PERSG_TEXT_GET Get text description for Employee Group

HRWPC_RFC_PERSK_TEXT_GET Get text description for Employee Subgroup

HRWPC_RFC_PLANS_TEXT_GET Get text description for Position

HRWPC_RFC_PLVAR_TEXT_GET Get text description for Plan Version

HRWPC_RFC_RAILW_TEXT_GET Get text description for Social Subscription Railway

HRWPC_RFC_SACHX_TEXT_GET Get text description for Administrator

HRWPC_RFC_SPRSL_TEXT_GET Get text description for Language Key

HRWPC_RFC_STATV_TEXT_GET Get text description for Statistics indicator for pensions

HRWPC_RFC_STELL_TEXT_GET Get text description for Job

HRWPC_RFC_STRDS_TEXT_GET Get text description for Street Abbreviation

HRWPC_RFC_SUBTY_0XXX_TEXT_GET Get text description for Subtype

HRWPC_RFC_SUBTY_1XXX_TEXT_GET Get text description for Subtype

HRWPC_RFC_TITEL_TEXT_GET Get text description for Title

HRWPC_RFC_TITL2_TEXT_GET Get text description for Second Title

HRWPC_RFC_TMART_TEXT_GET Get text description for Task Type

HRWPC_RFC_VDSK1_TEXT_GET Get text description for Organizational Key

HRWPC_RFC_VORS2_TEXT_GET Get text description for Second Name Prefix

HRWPC_RFC_VORSW_TEXT_GET Get text description for Name Prefix

HRWPC_RFC_WERKS_TEXT_GET Get text
分享到:
评论

相关推荐

    SAP HR几个常用函数及宏

    ### SAP HR 常用函数及宏解析 在SAP HR模块中,为了高效地处理人力资源相关的业务逻辑,开发人员经常需要使用到一系列内置的函数和宏。这些工具能够极大地简化编程过程,并确保数据处理的准确性与一致性。下面将...

    SAP的HR函数.pdf

    这些标签为“技术”的函数展示了SAP HR模块中用于处理特定任务的关键功能。以下是对这些函数的详细解释: 1. **HOLIDAY_CHECK_AND_GET_INFO**: 这个函数主要用于检查给定日期是否为假日。它需要输入参数`date`...

    重要知识SAP的HR函数.pdf

    以下是几个关键的SAP HR函数的详细说明: 1. **HOLIDAY_CHECK_AND_GET_INFO** 这个函数主要用于判断一个日期是否为法定假日。通过输入日期和假日日历ID,可以检查参数`HOLIDAY_FOUND`来确定日期是否为假日。例如,...

    SAP HR 薪酬核算

    SAP ERP HCM模块薪酬核算流程 维护员工薪酬数据 (pa30) 模拟运行工资核算 (PC00 M28 CALC SIMU 发布工资核算 (ZPC00 M99 PA03 RELEA

    单位和汇率处理函数

    汇率处理在SAP中是通过特定的函数模块和类来实现的,如`HR_EXCHANGE_RATE_GET`用于获取特定日期的汇率信息。这个函数通常与货币类型、日期和源货币/目标货币相关联,返回相应的汇率值。在处理多货币业务时,这个功能...

    SAP ABAP_HR_Training

    - 实战教程:通过实例教学,演示如何使用ABAP开发HR相关的事务代码和报表,包括屏幕设计、数据库表操作、函数模块的编写等。 - 案例分析:展示真实项目中的ABAP HR应用,帮助学习者理解在实际工作中的应用场景。 - ...

    SAP_HCM_Schema_CN28详解

    ### SAP_HCM_Schema_CN28 详析 #### 概述 SAP_HCM_Schema_CN28 是一种特定于中国的人力资源管理和薪酬计算的SAP Schema配置...通过对上述知识点的学习,我们可以更好地理解并利用这一Schema来优化企业的HR管理流程。

    SAP Schema CN28基本阐述.docx

    BLOCK 函数是 SAP Schema CN28 中的一个核心函数,它允许用户构建一个薪资计算过程日志。在开始和结束标记点中,把薪资函数按语义顺序聚集在一起,且他们出现在日志中的一个普通节点。 BLOCK 函数可以被嵌套,在一...

    SAP PNP 数据库宏的应用

    PNP宏则是在这种逻辑数据库的基础上,提供了一系列预定义的函数和参数,简化了HR数据的查询和处理过程,使得开发者能够更轻松地实现复杂的业务逻辑。 #### 三、PNP数据库宏在HR模块中的具体应用 1. **定义常量**:...

    各种SAP标准function的说明

    接下来,我们将详细解释一些常见的SAP标准功能及其应用场景。 ### 1. FI(Financial Accounting) #### 定义 FI是SAP系统中的一个模块,主要负责企业的财务会计处理工作,包括总账、应付账款、应收账款等。 #### ...

    sap学习资料

    - **HR(Human Resources)**:人力资源模块,管理招聘、薪资、绩效评估等人力资源活动。 5. **SAP开发工具** SAP提供了一系列开发工具,如SE80(ABAP Development Workbench)、SE24(ABAP Dictionary)、...

    SAP用语集-中文

    SAP系统基于模块化设计,包括财务会计(FI)、管理会计(CO)、物料管理(MM)、销售与分销(SD)、生产计划(PP)、人力资源(HR)等核心模块,每个模块都有其特定的术语和概念。例如,FI模块中的“总账”、“应付...

    ABAP日期函数(求月末日,第几周,search help 只显示年月) 使用方法实例

    ABAP 日期函数是 SAP 系统中用于处理日期和时间的函数集合。在实际应用中,日期函数的使用非常广泛,例如计算两个日期间的工作天数、获取当前月份的第一天和最后一天、计算日期所在的周数、弹出选择周的对话框等。 ...

    SAP中常用的事务码

    ### SAP HR 常用事务码详解 #### 一、人事主数据管理(Master Data Management) **1. PA10 - 人事档案** - **功能描述:** PA10用于查看员工的人事档案,包括基本的个人信息、职位信息等。 - **应用场景:** 在...

    C6与SAP集成解决方案

    - **RFC(Remote Function Call)**:作为SAP与外部系统通信的基础协议,RFC允许跨系统调用远程函数,实现功能的执行。通过定义客户端和服务端的接口,C6可以调用SAP中的特定功能模块,完成如查询、更新等操作。 - *...

    SAP T-code大全(包括所有模块)

    下面将详细介绍一些重要的SAP T-codes及其在不同模块中的应用。 1. **SE16** - 数据浏览器:这个T-code用于查询数据库表,提供了一个直观的方式来查看和搜索SAP系统内的结构化数据。对于系统管理员和开发者来说,这...

    钟欣讲解sap入门基础

    SAP的核心模块包括财务(FI)、物料管理(MM)、销售与分销(SD)、生产计划(PP)、人力资源(HR)等,它们共同构成了企业运营的全面支持体系。在入门阶段,我们首先需要了解这些模块的基本功能和相互关系。 ABAP(Advanced ...

    Schedule-of-the-contract.rar_The Contract_abap_abap hr

    在本例中,报表可能包含了SQL查询来检索必要的HR数据,并使用ABAP内建的函数和类来实现数据的逻辑处理。 导出到Excel的功能增强了报表的实用性,因为Excel提供了强大的数据分析和可视化工具。这可能通过ABAP的Open ...

    ABAP常用日期函数总结.doc

    17.HR_99S_INTERVAL_BETWEEN_DATES函数:获得两个日期的年数 该函数可以获得两个日期的年数,该函数可以用于计算员工的工作年数、计算员工的服务年限等。 ABAP日期函数可以满足各种日期计算需求,能满足开发者在...

    Sap abap 学习课程

    2. **数据传输机制**:深入探讨了数据在不同系统间传输的多种方式,如IDOC(中间文档)、RFC(远程函数调用)、ALE(应用链接启用)、BAPI(业务API)等,并分析了各自的优缺点和适用场景。 3. **接口设计与编程**:...

Global site tag (gtag.js) - Google Analytics