05-17-2007 10:58 AM
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
05-17-2007 11:05 AM
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
05-17-2007 11:04 AM
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
05-17-2007 11:05 AM
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
05-17-2007 11:14 AM
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