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 Reporitng

RahulKeshav
Active Contributor
0 Kudos

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 ACCEPTED SOLUTION

abdulazeez12
Active Contributor
0 Kudos

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

12 REPLIES 12

Former Member
0 Kudos

Try using logical databases like PNP.

regards

abdulazeez12
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

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

0 Kudos

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.

0 Kudos

hi

i need department Number.....not the text.....

0 Kudos

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.

0 Kudos

hey srinivas

i dont have to you SELECT query........

plz suggest....

0 Kudos

i have to use either provide --endprovide ....

or macros...or FM.....

Former Member
0 Kudos

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 !

RahulKeshav
Active Contributor
0 Kudos

one more query...

RahulKeshav
Active Contributor
0 Kudos

thnx