Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Finding the Chief of an org unit

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

4 REPLIES 4

Former Member
0 Kudos

what do you mean by chief?

Former Member
0 Kudos

Can you elaborate ??

Former Member
0 Kudos

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.

Former Member
0 Kudos

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