cancel
Showing results for 
Search instead for 
Did you mean: 

Examples of the use of HR_MAINTAIN_MASTERDATA

0 Kudos

Function implementation description:

Batch import of employee data into employee data through EXCEL,information 0000,0001,0002;

Problems encountered:

1、HR_MAINTAIN_MASTERDATA and HR_INFOTYPE_OPERATION, I don't know which FM is more appropriate to choose?

2、The personnel number is internal give the number, need how to realize?

3、HR_MAINTAIN_MASTERDATA Can provide a complete sample reference。

annotate:SAP HCM is self-taught, please help me with your help. Thank you

Accepted Solutions (1)

Accepted Solutions (1)

BGibbons
Active Contributor

Hi

We use both!

HR_INFOTYPE_OPERATION for inserting/copying etc individual infotypes

HR_MAINTAIN_MASTERDATA to process simple actions.

If we wanted to hire employees (internal number range) and populate 0000,0001,0002 etc etc we would use HR_MAINTAIN_MASTERDATA to process the hire and just populate 0000 and 0001.

the remainig required info types would then be processed thru HR_INFOTYPE_OPERATION

If you do a where used in these thru SE37 you will find examples in the system of calls to these function modules

bg

0 Kudos

Dear friend,

What value do you assign to the PERNR parameter of FM: HR _ MAINTAIN_MASTERDATA, EXPORTING, if you want the program to automatically generate a number。

It's for 000000 or a specific person number?

0 Kudos

The person number does not exist. Please select an employment event

Answers (2)

Answers (2)

0 Kudos

Dear friend,

Thank you for your support. I came to China。

The following is a summary of the problem, which can be helped by those who see it later。

The following code can be executed in full。

The MASSN parameter feels what information types this function needs to execute (configuration related)

GS_PPROP-INFTY = '0000'.
GS_PPROP-FNAME = 'P0000-MASSG'.
GS_PPROP-FVAL = 'A1'.
*GS_PPROP-SEQNR = 1 .

APPEND GS_PPROP TO GT_PPROP.

GS_PPROP-INFTY = '0001'.
GS_PPROP-FNAME = 'P0001-BTRTL'.
GS_PPROP-FVAL = '1010'.
*GS_PPROP-SEQNR = 1 .

APPEND GS_PPROP TO GT_PPROP.

GS_PPROP-INFTY = '0001'.
GS_PPROP-FNAME = 'P0001-ABKRS'.
GS_PPROP-FVAL = '01'.
*GS_PPROP-SEQNR = 1 .

APPEND GS_PPROP TO GT_PPROP.

GS_PPROP-INFTY = '0001'.
GS_PPROP-FNAME = 'P0001-BUKRS'.
GS_PPROP-FVAL = '9900'.
*GS_PPROP-SEQNR = 1 .

APPEND GS_PPROP TO GT_PPROP.

GS_PPROP-INFTY = '0001'.
GS_PPROP-FNAME = 'P0001-SBMOD'.
GS_PPROP-FVAL = '9900'.
*GS_PPROP-SEQNR = 1 .

APPEND GS_PPROP TO GT_PPROP.


"函数调用,用于创建人员的信息类型
"----------------begin of----------------------
CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
EXPORTING
PERNR = '00000000' "人员编号
MASSN = 'ZA' "操作类型
ACTIO = 'INS' "信息类型操作
TCLAS = 'A' "数据保留的事务类
BEGDA = SY-DATUM "开始日期
ENDDA = '99991231' "结束日期
* OBJPS = "对象标识
* SEQNR = "有相同代码的信息类型记录数
* SPRPS = "人力资源主数据记录的锁定标志
* SUBTY = "子信息类型
WERKS = '9900' "人事范围
PERSG = 'F' "员工组
PERSK = 'F1' "员工子组
PLANS = '50000475' "职位
DIALOG_MODE = '1'
LUW_MODE = '1'
NO_EXISTENCE_CHECK = 'X'
NO_ENQUEUE = 'X'
IMPORTING
RETURN = GS_RETURN
RETURN1 = GS_RETURN1
HR_RETURN = GS_HR_RETURN
TABLES
PROPOSED_VALUES = GT_PPROP
MODIFIED_KEYS = GT_PSKEY
.
"----------------end of----------------------



WRITE:/ GS_RETURN1-MESSAGE.

LOOP AT GT_PSKEY INTO GS_PPROP .

WRITE : / GS_PSKEY-PERNR , GS_PSKEY-INFTY .

ENDLOOP.

BGibbons
Active Contributor
0 Kudos

Hi,

pernr.jpg(28.7 kB)

Also I do not include PERNR in PROPOSED_VALUES

proposed.jpg(41.0 kB)

bg