11-28-2007 11:22 AM
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
11-28-2007 11:36 AM
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
11-28-2007 11:36 AM
11-28-2007 11:36 AM
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
11-28-2007 11:40 AM
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.
11-29-2007 8:47 AM
Hi Sri
i hav one more query;;
i want to get Department Number.....
and in mapping document this logic has given...
Use PA0001-ORGEH as OBJID to read HRP1001with OTYPE 'O'. Find related object HRP1001-SOBID where SCLAS='ZR' and RSIGN='A' and RELAT='Z05'. Use SOBID as OBJID to read table HRP1000 with OTYPE='ZR'.
Plz help me to find that...
Thnxs
Rohit
11-29-2007 11:43 AM
For this
select single sobid into v_sobid1
from hrp1001 where
otype = 'O' and
objid = PA0001-ORGEH and
rsign = 'A' and
relat = 'Z05' and
sclas = 'ZR'.
now write select on HRP1000 to get the text for this
select single stext into v_stext
from HRP1000
where otype = 'ZR' and
objid = v_sobid1.
11-29-2007 1:41 PM
11-29-2007 2:10 PM
then write the second select as below .. U need to write select on HRP1001.
also need to mention RELAT , RSIGN and SCLAS ...
select single sobid into v_sobid2
from HRP1001
where
otype = 'ZR' and
objid = v_sobid1.
11-30-2007 9:33 AM
hey srinivas
i dont have to you SELECT query........
plz suggest....
11-30-2007 9:34 AM
i have to use either provide --endprovide ....
or macros...or FM.....
11-28-2007 11:44 AM
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 !
11-29-2007 8:48 AM
12-04-2007 8:16 AM