In HR employees holding postion.
Relatioship Table : HRV1001,HRP1000
Allocation Table : HRP1001
CLEAR : it_pa0001[].
SELECT pernr endda plans FROM pa0001 INTO TABLE it_pa0001 WHERE pernr = gs_pa0000-pernr.
SORT it_pa0001 DESCENDING BY endda.
READ TABLE it_pa0001 INTO wa_pa0001 INDEX 1.
IF sy-subrc = 0.
IF wa_pa0001-plans = '99999999'.
READ TABLE it_pa0001 INTO wa_pa0001 INDEX 2.
IF sy-subrc = 0.
IF wa_pa0001-plans = '99999999'.
CLEAR : lv_p0001-plans.
ELSE.
lv_p0001-plans = wa_pa0001-plans.
ENDIF.
ELSE.
lv_p0001-plans = ''.
ENDIF.
ELSE.
lv_p0001-plans = wa_pa0001-plans.
ENDIF.
ENDIF.
To find CATS APPROVER ID
CLEAR : lv_varyf.
SELECT SINGLE varyf FROM hrv1001 INTO lv_varyf WHERE otype = 'S' AND objid = lv_p0001-plans AND rsign = 'A' AND relat = '150'
AND begda <= so_date-low AND endda >= so_date-high.
CLEAR : lv_objid.
SELECT SINGLE objid FROM hrp1000 INTO lv_objid WHERE otjid = lv_varyf.
SELECT SINGLE pernr ename FROM pa0001 INTO (gs_final1-g33,gs_final1-g34) WHERE plans = lv_objid
AND begda <= so_date-low AND endda >= so_date-high.
CLEAR : lv_pernr.
CONDENSE gs_final1-g33.
lv_pernr = gs_final1-g33.
To find MANAGER ID
CLEAR : lv_varyf.
SELECT SINGLE varyf FROM hrv1001 INTO lv_varyf WHERE otype = 'S' AND objid = lv_p0001-plans AND rsign = 'A' AND relat = '002'
AND begda <= so_date-low AND endda >= so_date-high.
CLEAR : lv_objid.
SELECT SINGLE objid FROM hrp1000 INTO lv_objid WHERE otjid = lv_varyf.
SELECT SINGLE pernr ename FROM pa0001 INTO (gs_final1-g31,gs_final1-g32) WHERE plans = lv_objid
AND begda <= so_date-low AND endda >= so_date-high.
CLEAR lv_pernr.
CONDENSE gs_final1-g31.
lv_pernr = gs_final1-g31.
To find LEAVE APPROVER ID
CLEAR : lv_varyf.
SELECT SINGLE varyf FROM hrv1001 INTO lv_varyf WHERE otype = 'S' AND objid = lv_p0001-plans AND rsign = 'A' AND relat = '151'
AND begda <= so_date-low AND endda >= so_date-high.
CLEAR : lv_objid.
SELECT SINGLE objid FROM hrp1000 INTO lv_objid WHERE otjid = lv_varyf.
SELECT SINGLE pernr ename FROM pa0001 INTO (gs_final1-g40,gs_final1-g41) WHERE plans = lv_objid " modify by chellam - 13.06.2016
AND begda <= so_date-low AND endda >= so_date-high.
CLEAR : lv_pernr.
CONDENSE gs_final1-g40.
lv_pernr = gs_final1-g40.
No comments:
Post a Comment