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: 

Retrieve name of an employee by employeeno

Former Member
0 Kudos

Hello abapers...

i'm quite new to abap development an actually use it to create bapis for portal use. I would like to retrieve the name of an employee out of the HR. As input-parameter i have the employee-number. What tables do i have to query to get the needed information?

Greets,

Jochen

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos

Hello Jochen

I would recommend to use the methods IF_PT_EMPLOYEE:

DATA: go_employee   TYPE REF TO if_pt_employee,
      gd_fullname      TYPE emnam.


go_employee = cl_pt_employee( i_pernr = <your pernr> ).
gd_fullname = go_employee->get_ename( ).

Regards

Uwe

4 REPLIES 4

uwe_schieferstein
Active Contributor
0 Kudos

Hello Jochen

I would recommend to use the methods IF_PT_EMPLOYEE:

DATA: go_employee   TYPE REF TO if_pt_employee,
      gd_fullname      TYPE emnam.


go_employee = cl_pt_employee( i_pernr = <your pernr> ).
gd_fullname = go_employee->get_ename( ).

Regards

Uwe

suresh_datti
Active Contributor
0 Kudos

If it is just the Employee Name , you can get it by reading infotype 0001either from the the db table PA0001 ro using the function call HR_READ_INFOTYPE.. For additional info like Last Name. First Name, title etc you can use infotype 0002.. db table is PA0002.

~Suresh

Former Member
0 Kudos

Hi Jochen

If you have pernr number ,then go to PA0002 table and you take NORNA,VOCHNA fields ..

These are first and last name.

Former Member
0 Kudos

thx!