Hi all i am first time working on HR report .....
my requirment are as follows
1.Last Name of Immediate Supervisor/Manager
Use PA0001-ORGEH as OBJID to read HRP1001with OTYPE 'O'. Find related object HRP1001-SOBID where SCLAS='S' and RSIGN='B' and RELAT='012'. Use SOBID as OBJID to read table HRP1001 with OTYPE='S'. Find related object HRP1001-SOBID where SCLAS='P' and RSIGN='A' and RELAT='008'. Use SOBID to output PA002-NACHN.
2.JOB_DESC
Use PA0001-PLANS as OBJID to read HRP1001with OTYPE 'S'. Find related object HRP1001-SOBID where SCLAS='C' and RSIGN='B' and RELAT='007'. Use SOBID as OBJID to read table HRP1000 with OTYPE='C'. HRP1000-STEXT is Job Desc.
i am unable to write the query...
Remember no 'SELECT' query..
plz help me
Thnx
Rohit
1.Last Name of Immediate Supervisor/Manager
First get ORGEH for the personnel number PERNR.
select ORGEH from PA0001 into gv_orgeh where PERNR = selection screen PERNR.
then fetch from HRP1001.
select SOBID
from HRP1001
into gv_sobid
where OBJID = gv_orgeh and
SCLAS = 'S' and
RSIGN = 'B' and
RELAT = '012'.
then,
select SOBID
from HRP1001
into gv_sobid1
where OBJID = gv_sobid and
SCLAS = 'P' and
RSIGN = 'A' and
RELAT = '008'.
then,
select NACHN
from PA0002
into gv_nachn
where pernr = gv_sobid1.
For job description, follow the same select syntax..
hope it is helpful
Cheers
Shakir
Hi Rohith
Here's the asnwer for your queries,
1.Last Name of Immediate Supervisor/Manager
call function 'RH_STRUC_GET'
exporting
act_otype = 'O'
act_objid = PA0001-ORGEH
act_wegid = 'BOSSONLY'
act_plvar = '01'
act_begda = sy-datum
act_endda = sy-datum
tables
result_tab = i_result.
delete i_result where otype <> 'P'.
Select nachn into table i_nachn from pa0002 for all entries in i_result where pernr = i_result-objid.
2.JOB_DESC
call function 'RH_STRUC_GET'
exporting
act_otype = 'S'
act_objid = PA0001-PLANS
act_wegid = 'B007'
act_plvar = '01'
act_begda = sy-datum
act_endda = sy-datum
tables
result_objec = i_result_objec.
You i_result_objec-STEXT will hold the job desc.
~ Ranganath
PS : Reward points for all useful answers !
to get Immediate Supervisor
select single sobid into v_sobid1
from hrp1001 where otype = 'O'
and objid = PA0001-ORGEH
and rsign = 'B'
and relat = '012'
and sclas = 'S'.
next ..
select single sobid into v_sobid2
from hrp1001 where otype = 'S'
and objid = v_sobid1
and rsign = 'A'
and relat = '008'
and sclas = 'P'.
Use this SOBID(v_sobid2) to write select single on PA0002 to get NACHN ..
select single sobid v_sobid1
from hrp1001 where otype = 'O'
and objid = PA0001-ORGEH
and rsign = 'B'
and relat = '012'
and sclas = 'S'.
To get JOB_DESC
select single sobid into v_sobid1
from hrp1001 where otype = 'S'
and objid = PA0001-PLANS
and rsign = 'B'
and relat = '007'
and sclas = 'C'.
select single stext into v_stext
from hrp1000 where otype = 'C'
and objid = v_sobid1.
Add a comment