Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

FM for Hire Employee HR_PAD_HIRE_EMPLOYEE

Former Member
0 Kudos

HR experts,

My self passed the values in to this FM It is not success, Could you anybody tell me what are the inputs values required for this FM HR_PAD_HIRE_EMPLOYEE (OR) Please provide sample code it is very helpful take on.

Waiting for your reply.

Thanks

Chandran.M

Edited by: CHANDRAN_ABAP CHANDRAN on Mar 8, 2012 9:48 AM

8 REPLIES 8

Former Member
0 Kudos

Hi,

A simple where-used would have helped...

Have a look at method GENERATE_EMPLOYEE defined in class CL_HRPAD00_C_EMPLO.

The method is called in program HRPAD00_C_EMPLOYEES_FOR_USERS, no special trick here.

Kr,

Manu.

0 Kudos

Hi Manu,

Thank you very much for your reply.

I checked in that FM where used list it is saying not found anyway in this method itself I can see this FM (HR_PAD_HIRE_EMPLOYEE)

Regards,

Chandran.M

0 Kudos

HR-ABAP Expert,

I am using this FM for New employee hiring purpose-pa0000-pa0001-pa0002. I am facing the error in return parameter

(E PG 002 Person already hired) I checked the table the entry is not there , Why it is showing this error in return table.Please help on this issue.

Testing purpose created sample code. if anything missed out please help me out.

"*"Local Interface:

*" IMPORTING

*" VALUE(IP_PERNR) TYPE PERNR_D

*" VALUE(IP_HIREDATE) TYPE BEGDA

*" VALUE(IP_MASSN) TYPE MASSN

*" VALUE(IP_TESTMODE) TYPE CHAR1 OPTIONAL

*" EXPORTING

*" REFERENCE(IT_RETURN) TYPE HRPAD_RETURN_TAB

*" REFERENCE(IT_KEY) TYPE HRPAD_BAPIPAKEY_TAB

*" TABLES

*" IT_P0002 STRUCTURE P0002

*" IT_P0001 STRUCTURE P0001

*" IT_P0000 STRUCTURE P0000

*"----


FIELD-SYMBOLS <pnnnn> TYPE ANY.

DATA ls_prelp TYPE prelp.

DATA et_prelp TYPE prelp_tab.

CLEAR ls_prelp .

LOOP AT it_p0000.

  • Organizational assignment

it_p0000-infty = '0000'.

ASSIGN it_p0000 TO <pnnnn>.

CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp

EXPORTING

pnnnn = <pnnnn>

IMPORTING

prelp = ls_prelp.

APPEND ls_prelp TO et_prelp.

CLEAR ls_prelp.

ENDLOOP.

  • Personnel data

LOOP AT it_p0001.

it_p0001-infty = '0001'.

ASSIGN it_p0001 TO <pnnnn>.

CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp

EXPORTING

pnnnn = <pnnnn>

IMPORTING

prelp = ls_prelp.

APPEND ls_prelp TO et_prelp.

CLEAR ls_prelp.

ENDLOOP.

LOOP AT it_p0002.

it_p0001-infty = '0002'.

ASSIGN it_p0002 TO <pnnnn>.

CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp

EXPORTING

pnnnn = <pnnnn>

IMPORTING

prelp = ls_prelp.

APPEND ls_prelp TO et_prelp.

CLEAR ls_prelp.

ENDLOOP.

  • Create new employee for user

CALL FUNCTION 'HR_PAD_HIRE_EMPLOYEE'

EXPORTING

employeenumber = ip_pernr

hiringdate = ip_hiredate

actiontype = ip_massn

pnnnn_tab = et_prelp

nocommit = ip_testmode

IMPORTING

return_tab = it_return

bapipakey_tab = it_key.

Thanks

Chandran

0 Kudos

Hi Chandran

In my tests it works.  Before you execute the function module, you should test to see if the EE is already in the system. Not just active, but in the system. In the US, I use P0002-PERID ( Social Security Number ) to see if the EE is already hired.  

0 Kudos

Same issue here chandran. DId u get a solution for this problem "person already hired".

0 Kudos

Hi

When calling the function module 'HR_PAD_HIRE_EMPLOYEE', do not populate data for infotype '0000' in internal table 'et_prelp' that is being passed to the parameter 'pnnnn_tab'.

This should take care of the error "person already hired".

Thanks,

R

0 Kudos

Thanks!

Don't provide Data in 0000 solved my Issue "person already hired"..

Regards

0 Kudos

This message was moderated.