Skip to Content
0
Former Member
Sep 19, 2007 at 10:14 AM

help to find org.unit manager

20 Views

hallow

here i try to find org unit manager but its not working well

plz some one can help

i think i have problem in dates but i not sure

thankes & regards

LOOP AT i_t_data INTO lw_t_data_0org.

SELECT begda endda sobid

FROM hrp1001

INTO TABLE lt_relat_org

WHERE objid EQ lw_t_data_0org-orgeh

AND rsign EQ 'B'

AND relat EQ '012'

AND endda GE lw_t_data_0org-datefrom

AND begda LE lw_t_data_0org-dateto.

SORT lt_relat_org BY begda DESCENDING endda DESCENDING sobid.

CLEAR lw_relat_org.

READ TABLE lt_relat_org INDEX 1 INTO lw_relat_org.

IF sy-subrc EQ '0'.

l_plans = lw_relat_org-sobid.

SELECT SINGLE pernr

FROM pa0001

INTO lw_t_data_0org-zzmanager

WHERE endda GE lw_relat_org-begda " lw_t_data_0org-datefrom

AND begda LE lw_relat_org-endda " lw_t_data_0org-dateto

AND plans EQ l_plans.

ENDIF.

APPEND lw_t_data_0org TO lc_t_data_0org.