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: 

HR ABAP - urgent

Former Member
0 Kudos

Hi,

I have a requirement where i have to dispaly the name & designation of the HR executive corresponding to the particular Employee.

P0001-SACHP (Name of HR Executive)

P0001-PLANS Designation of HR Executive

please advice how to get the data from infotype 0001.

rgds

preeti

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

1. Use the LDB PNP.

2. then use this code.

TABLES: pernr.

INFOTYPES: 0000,   "Actions
           0001.   "Organizational Assignment


START-OF-SELECTION.

GET pernr.

  rp_provide_from_last p0000 space pn-begda pn-endda.

  if pnp-sw-found EQ '1'.
      READ TABLE p0001 WITH KEY pernr = p0000-pernr.
     if sy-subrc = 0.
     write : p0001-SACHP. " name.
     write : p0001-plans. " designation.
    endif.
  endif.

end-of-selection.

Regards

Reshma

3 REPLIES 3

Former Member
0 Kudos

Hi

If you want to use infotype,then You need to use logical database

You have to use like tis

Provide * from <infotype> between begda and endda.

You also can fetch by using select

select from p0001 table.

Every infotype will be associated with one table.

Thanks

Former Member
0 Kudos

hi,

1. Use the LDB PNP.

2. then use this code.

TABLES: pernr.

INFOTYPES: 0000,   "Actions
           0001.   "Organizational Assignment


START-OF-SELECTION.

GET pernr.

  rp_provide_from_last p0000 space pn-begda pn-endda.

  if pnp-sw-found EQ '1'.
      READ TABLE p0001 WITH KEY pernr = p0000-pernr.
     if sy-subrc = 0.
     write : p0001-SACHP. " name.
     write : p0001-plans. " designation.
    endif.
  endif.

end-of-selection.

Regards

Reshma

0 Kudos

refer belwo code -



TABLES: pernr.
 
INFOTYPES: 0000,   "Actions
           0001.           "Organizational Assignment
 
 DATA: begin of t_output occurs 0,
             ename like pa0001-ename,
             plans like pa0001-plans,
            end of t_output.

START-OF-SELECTION.
 
GET pernr.
 
  rp_provide_from_last p0000 space pn-begda pn-endda.
 
  check pnp-sw-found EQ '1'.

  rp_provide_from_last p0001 space pn-begda pn-endda.

  check pnp-sw-found EQ '1'.
  clear t_output.
  Move: p0001-ename to t_output-ename,
           p0001-plans to t_output-plans.
  append t_output.
 
end-of-selection.

loop at t_output.

write:/ t_output-ename,
      / t_output-plans.
endloop.

also start rewarding points to helpfull answers.

amit