on 07-20-2007 6:21 AM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hai u can do it through adhoc query/free search
give the input as pernr
out put field as position
regards
nalla
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.