on 02-06-2008 11:24 AM
Hello,
we want use HR_MAINTAIN_MASTERDATA for create a new employee.
after lunch this FM we insert new PERNR code and some different data but after execution we cannot see any new entry in PA30 or PA40.
Any suggestion?
thanks
Alex
yes, shrinivas is right, we hire successfully using HR_MAINTAIN_MASTERDATA.You must ensure that the parameter NO_EXISTENCE_CHECK is set to 'X'. Pass the multiple infotypes data in the Tables paramter proposed_values by adding new lines
and when u get that far of hiring, u may even face same problem as [this |;one..so follow the resolution provided in the same thread.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
in my case the turning point was put the istructions:
SET PARAMETER ID 'PBR' FIELD werks.
SET PARAMETER ID 'PRG' FIELD PERSG.
SET PARAMETER ID 'PKR' FIELD PERSK.
SET PARAMETER ID 'SUB' FIELD MASSN.
before the function:
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING infty = '0000'
NUMBER = p0000-pernr
now the program is able to create a employee e modify infotype.
REPORT z_r_bda_upload.
PARAMETERS: pernr TYPE p0000-pernr.
PARAMETERS: begda TYPE p0000-begda DEFAULT sy-datum.
PARAMETERS: endda TYPE p0000-endda DEFAULT '99991231'.
PARAMETERS: massn TYPE p0000-massn.
PARAMETERS: persg TYPE p0001-persg.
PARAMETERS: bukrs TYPE p0001-bukrs.
PARAMETERS: werks TYPE p0001-werks.
PARAMETERS: persk TYPE p0001-persk.
PARAMETERS: btrtl TYPE p0001-btrtl.
PARAMETERS: nachn TYPE p0002-nachn.
PARAMETERS: vorna TYPE p0002-vorna.
PARAMETERS: gesch TYPE p0002-gesch.
TABLES : p0000, p0001, p0002.
DATA: g_return TYPE bapireturn1,
infty_key TYPE bapipakey.
DATA : BEGIN OF i_p0000 OCCURS 0,
pernr LIKE p0000-pernr,
begda LIKE p0000-begda,
endda LIKE p0000-endda,
massn LIKE p0000-massn,
END OF i_p0000.
DATA : BEGIN OF i_p0001 OCCURS 0,
pernr LIKE p0001-pernr,
begda LIKE p0001-begda,
endda LIKE p0001-endda,
persg LIKE p0001-persg,
werks LIKE p0001-werks,
bukrs LIKE p0001-bukrs,
persk LIKE p0001-persk,
btrtl LIKE p0001-btrtl,
END OF i_p0001.
DATA : BEGIN OF i_p0002 OCCURS 0,
pernr LIKE p0002-pernr,
begda LIKE p0002-begda,
endda LIKE p0002-endda,
nachn LIKE p0002-nachn,
vorna LIKE p0002-vorna,
gesch LIKE p0002-gesch,
END OF i_p0002.
********** infotype 0000 ******************************
i_p0000-pernr = pernr.
i_p0000-begda = begda.
i_p0000-endda = endda.
i_p0000-massn = massn.
APPEND i_p0000.
MOVE-CORRESPONDING i_p0000 TO p0000.
CLEAR g_return.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = p0000-pernr
IMPORTING
RETURN = g_return.
CLEAR g_return.
CLEAR infty_key.
SET PARAMETER ID 'PBR' FIELD werks.
SET PARAMETER ID 'PRG' FIELD PERSG.
SET PARAMETER ID 'PKR' FIELD PERSK.
SET PARAMETER ID 'SUB' FIELD MASSN.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0000'
NUMBER = p0000-pernr
validityend = p0000-endda
validitybegin = p0000-begda
record = p0000
operation = 'INS'
IMPORTING
RETURN = g_return
KEY = infty_key.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
NUMBER = p0000-pernr.
********** infotype 0001 ******************************
IF infty_key-employeeno IS NOT INITIAL.
i_p0001-pernr = infty_key-employeeno.
i_p0001-begda = begda.
i_p0001-endda = endda.
i_p0001-persg = persg.
i_p0001-werks = werks.
i_p0001-bukrs = bukrs.
i_p0001-persk = persk.
i_p0001-btrtl = btrtl.
APPEND i_p0001.
MOVE-CORRESPONDING i_p0001 TO p0001.
CLEAR g_return.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = p0001-pernr
IMPORTING
RETURN = g_return.
CLEAR g_return.
CLEAR infty_key.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0001'
NUMBER = p0001-pernr
validityend = p0001-endda
validitybegin = p0001-begda
record = p0001
operation = 'INS'
IMPORTING
RETURN = g_return
KEY = infty_key.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
NUMBER = p0001-pernr.
********** infotype 0002 ******************************
IF infty_key-employeeno IS NOT INITIAL.
i_p0002-pernr = i_p0001-pernr.
i_p0002-begda = begda.
i_p0002-endda = endda.
i_p0002-nachn = nachn.
i_p0002-vorna = vorna.
i_p0002-gesch = gesch.
APPEND i_p0002.
MOVE-CORRESPONDING i_p0002 TO p0002.
CLEAR g_return.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = p0002-pernr
IMPORTING
RETURN = g_return.
CLEAR g_return.
CLEAR infty_key.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0002'
NUMBER = p0002-pernr
validityend = p0002-endda
validitybegin = p0002-begda
record = p0002
operation = 'INS'
IMPORTING
RETURN = g_return
KEY = infty_key.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
NUMBER = p0002-pernr.
ENDIF.
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, use PA48 and send data before with FM HR_PREPARE_NEW_EE.
Bye
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
U can create the new employees record by making a Hiring action. in this action make a infogroup which contains different infotypes.
Path:
SPRO> Personal Management> Per. Admi.> Customizing Procedures> Actions
Do the customization and make a action then execute the action in PA40 then only u can hire the employee.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can use 'HR_MAINTAIN_MASTERDATA' to create/hire a new employee since its simulates the BDC PA30/40.
But you need to pass NO_EXISTENCE_CHECK as 'X' to hire a new employee, also you need to pass all the mandatory fields of infotypes which are used to hire a employee (IT0000, IT0001, IT0002 etc) at one go.
Still it's not able to update then check the error message (or Check the screen flow in Dialog Mode = 2).
PS: If you use this FM, Dynamic action wont be triggered, so you need to explicitly code if any dynamic actions need to be triggred.
Good luck,
Shrinivas
Hi,
There is no functional module in HR for creating a new employee. New employee can be created only thru an action i.e thru PA40. The function module which you mentioned is only to maintain master data of an already existing employee.
Rgds
Suman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.