cancel
Showing results for 
Search instead for 
Did you mean: 

how to find position of a pernr

Former Member
0 Kudos

hi all

i have to get position for a paticular pernr (using table pa0001 or hrp1001)

please help me and tell me how i can do this

reply me as soon as possible

piont will be definately awarded

thanks in advance

anuj.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Anuj,

Try this code.

*********************************************************

Tables : PA0001, HRP1001.

parameters: p_pernr like PA0001-pernr.

start-of-selection.

*Get position of a pernr from HRP 1001

data: lv_pernr like p0001-pernr,

lv_varyf like HRP1001-varyf,

lv_plans like P0001-PLANS. "position

select single varyf from hrp1001 into lv_varyf

where otype = 'P'

and objid = p_pernr

and plvar = '01'

and rsign = 'B'

and relat = '008'

and begda LE sy-datum

and endda GE sy-datum.

lv_plans = lv_varyf+2(8). " position

write:/ 'position =', lv_plans.

Former Member
0 Kudos

hi anurag,

thanks alot

anurag can you please help for one more thing

now with respect to this position i want to get managers position and then from tht position i want to get managers pernr

please help me with also

more point ll be awared to this help also

anuj

Former Member
0 Kudos

Try This code.

****************************************************************

Tables : PA0001, HRP1001.

parameters: p_pernr like PA0001-pernr.

start-of-selection.

*Get position of a pernr from HRP 1001

data: lv_pernr like p0001-pernr,

lv_varyf like HRP1001-varyf,

lv_plans like P0001-PLANS. "position

select single varyf from hrp1001 into lv_varyf

where otype = 'P'

and objid = p_pernr

and plvar = '01'

and rsign = 'B'

and relat = '008'

and begda LE sy-datum

and endda GE sy-datum.

lv_plans = lv_varyf+2(8). " position

write:/ 'Employee Position =', lv_plans.

*

*Get position of a superior from HRP 1001

clear: lv_varyf.

select single varyf from hrp1001 into lv_varyf

where otype = 'S'

and objid = lv_plans

and plvar = '01'

and rsign = 'A'

and relat = '002'

and begda LE sy-datum

and endda GE sy-datum.

clear: lv_plans.

lv_plans = lv_varyf+2(8). " manager position

write:/ 'Manager Position =', lv_plans.

*Get pernr of superior from HRP 1001

clear: lv_varyf.

select single varyf from hrp1001 into lv_varyf

where otype = 'S'

and objid = lv_plans

and plvar = '01'

and rsign = 'A'

and relat = '008'

and begda LE sy-datum

and endda GE sy-datum.

clear: lv_pernr.

lv_pernr = lv_varyf+2(8). " manager position

write:/ 'Manager pernr =', lv_pernr.

*****************************************************************

for checking this you should have some pernr for which superior is maintained.

don't forget to award points.

Former Member
0 Kudos

hi plz explzin me the field varyf

what is this field and why we have to use it

please help me with this also

anuj

Former Member
0 Kudos

check table HRP 1001, and give selection criteria as given in the program and select the record, then check out this field, you will get an idea how it is working.

fielld varyf contains two characters objectID and rest 8 characters ObjectID No.

like for position it will be : S 50008900,

for appraisal it will be : BA50008900.

Former Member
0 Kudos

thanks anurag.

anurag do me one more favour

plz give me your e-mail id and also can u give me few more sample code of this type that would be of gr8 help

thank alot

for all the help u have given me

anuj

Answers (2)

Answers (2)

Former Member
0 Kudos

thanks

Former Member
0 Kudos

hai u can do it through adhoc query/free search

give the input as pernr

out put field as position

regards

nalla

Former Member
0 Kudos

hi Nalla,

thanks for fast response,

but i am very new to hr-abap so its is hard for me to do the same

please explainn me the step by step procudure

also how to find the position field

as there no position in either of the table

thanks

anuj

Message was edited by:

anuj anuj

Former Member
0 Kudos

hai

u want to write a program?

or u want some stadard one.

what i have said id not a ABAP program?

regards

nalla

ps: from which transaction u want this out put?

Former Member
0 Kudos

hi

i need a abap code to get the position of the

corresponding pernr

help me with the same

thanks

anuj

Message was edited by:

anuj anuj

Former Member
0 Kudos

hai

i am sorry iam not an abaper.

pls do post it in aABAP development forum

regards

nalla