12-05-2006 3:32 PM
Hi,
I have a requirement to find the 'Chief' of an organisation. I am looking to find a function module or something that I can use. Does anybody have any idea if there is one.
12-05-2006 4:15 PM
Pls check this code:
* Get chief no
SELECT SOBID
INTO DL_SOBID
FROM HRP1001
UP TO 1 ROWS
WHERE OTYPE = C_O
AND PLVAR = C_01
AND ISTAT = 1
AND BEGDA <= P_DATE
AND ENDDA >= P_DATE
AND RSIGN = 'B'
AND RELAT = '012'
AND SCLAS = C_S
AND OBJID = ORGEH.
ENDSELECT.
if sy-subrc = 0.
SELECT SOBID
FROM HRP1001
UP TO 1 ROWS
INTO DG_CHIEFNO
WHERE OTYPE = 'S'
AND OBJID = DL_SOBID
AND PLVAR = '01'
AND ISTAT = '1'
AND RSIGN = 'A'
AND RELAT = '003'
AND BEGDA <= P_DATE
AND ENDDA >= P_DATE.
ENDSELECT.
Thanks & Regards,
Siri.
12-05-2006 4:10 PM
12-05-2006 4:11 PM
12-05-2006 4:15 PM
Pls check this code:
* Get chief no
SELECT SOBID
INTO DL_SOBID
FROM HRP1001
UP TO 1 ROWS
WHERE OTYPE = C_O
AND PLVAR = C_01
AND ISTAT = 1
AND BEGDA <= P_DATE
AND ENDDA >= P_DATE
AND RSIGN = 'B'
AND RELAT = '012'
AND SCLAS = C_S
AND OBJID = ORGEH.
ENDSELECT.
if sy-subrc = 0.
SELECT SOBID
FROM HRP1001
UP TO 1 ROWS
INTO DG_CHIEFNO
WHERE OTYPE = 'S'
AND OBJID = DL_SOBID
AND PLVAR = '01'
AND ISTAT = '1'
AND RSIGN = 'A'
AND RELAT = '003'
AND BEGDA <= P_DATE
AND ENDDA >= P_DATE.
ENDSELECT.
Thanks & Regards,
Siri.
12-05-2006 6:45 PM
When using transaction PPOME, and looking at a position, then there is a check box in the basic data tab labeled 'Head of own organizational unit'. If this is ticked then the icon on the position changes and is labeled 'Chief'.
I have since found the solution is to use the function module RH_STRUC_GET with a WEGID of A012, and if this relation exists then the position has a chief position.
Thanks for your help