<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: hi in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/hi/m-p/3257353#M777980</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot directly find the person attached to the organizational unit directly by writing a select. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this you have to use FM "RH_STRUC_GET" by passing the PLVAR = 01, OTYPE = 'O", OBJID = objectid and WEGID = 'O_S_P'. Then in the return internal table of RESULT_TAB count the number of records with OTYPE = 'P'. This will give you the number of persons in that organizational unit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~ Ranganath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Jan 2008 12:22:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-09T12:22:56Z</dc:date>
    <item>
      <title>hi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hi/m-p/3257352#M777979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for given objectid in a organization unit, using select statement how can i find the number of person associated with that object id.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2008 12:17:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hi/m-p/3257352#M777979</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-09T12:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: hi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hi/m-p/3257353#M777980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot directly find the person attached to the organizational unit directly by writing a select. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this you have to use FM "RH_STRUC_GET" by passing the PLVAR = 01, OTYPE = 'O", OBJID = objectid and WEGID = 'O_S_P'. Then in the return internal table of RESULT_TAB count the number of records with OTYPE = 'P'. This will give you the number of persons in that organizational unit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~ Ranganath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2008 12:22:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hi/m-p/3257353#M777980</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-09T12:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: hi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hi/m-p/3257354#M777981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use FM &lt;STRONG&gt;SWI_GET_USERS_OF_ORG_UNIT&lt;/STRONG&gt;. Pass the object ID and type and you will get the list of users.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pankaj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2008 12:24:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hi/m-p/3257354#M777981</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-09T12:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: hi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hi/m-p/3257355#M777982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can u plz elobarate on this function module&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2008 11:36:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hi/m-p/3257355#M777982</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-10T11:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: hi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hi/m-p/3257356#M777983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi please check this coding,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT yhr_tmp .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*DATA: pr_id LIKE zwfesc-pr_id VALUE '0008',&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     wf_loopc LIKE zwfesc-alevel VALUE 00,&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     TRIP TYPE SWC_OBJECT,&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     nacode LIKE zwfesc-acode VALUE '9004',&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     t_acode LIKE zwfesc-acode,&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     wf_initiator LIKE wfsyst-initiator,&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: int_org LIKE bapip0001b OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      pe_return LIKE bapireturn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:  l_appr_userid  LIKE pa0105-usrid,&lt;/P&gt;&lt;P&gt;       l_acode        LIKE zwfesc-acode,&lt;/P&gt;&lt;P&gt;       l_seq_no       LIKE zwfesc-sl_no,&lt;/P&gt;&lt;P&gt;       l_orgunit      LIKE bapip0001b-org_unit,&lt;/P&gt;&lt;P&gt;       l_nxt_orgunit  LIKE bapip0001b-org_unit,&lt;/P&gt;&lt;P&gt;       l_step         LIKE zwfesc-step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETER: p_userid LIKE pa0105-usrid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_EMPLOYEE_GETDATA'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;          userid         = p_userid&lt;/P&gt;&lt;P&gt;          date           = sy-datum&lt;/P&gt;&lt;P&gt;     TABLES&lt;/P&gt;&lt;P&gt;          org_assignment = int_org.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE int_org INDEX 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  MOVE int_org-org_unit TO l_orgunit.&lt;/P&gt;&lt;P&gt;  WHILE l_acode IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM f_get_approver USING l_orgunit CHANGING&lt;/P&gt;&lt;P&gt;                                             l_appr_userid&lt;/P&gt;&lt;P&gt;                                             l_acode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check if initiator is chief of org unit&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OR chief position is unoccupied&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    IF l_appr_userid EQ p_userid OR&lt;/P&gt;&lt;P&gt;       l_appr_userid IS INITIAL.&lt;/P&gt;&lt;P&gt;      CLEAR l_acode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Find the next higher org unit&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      SELECT SINGLE sobid INTO l_nxt_orgunit FROM hrp1001&lt;/P&gt;&lt;P&gt;        WHERE objid EQ l_orgunit&lt;/P&gt;&lt;P&gt;        AND   begda LE sy-datum&lt;/P&gt;&lt;P&gt;        AND   endda GE sy-datum&lt;/P&gt;&lt;P&gt;        AND   otype EQ 'O'&lt;/P&gt;&lt;P&gt;        AND   plvar EQ '01'&lt;/P&gt;&lt;P&gt;        AND   rsign EQ 'A'&lt;/P&gt;&lt;P&gt;        AND   relat EQ '002'.&lt;/P&gt;&lt;P&gt;      IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;        MOVE l_nxt_orgunit TO l_orgunit.&lt;/P&gt;&lt;P&gt;      ELSE.&lt;/P&gt;&lt;P&gt;        MOVE: 'E' TO pe_return-type,&lt;/P&gt;&lt;P&gt;              '001' TO pe_return-code,&lt;/P&gt;&lt;P&gt;              'No agent code found' TO pe_return-message.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    ADD 1 TO l_seq_no.&lt;/P&gt;&lt;P&gt;  ENDWHILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT SINGLE step INTO l_step FROM  zwfesc&lt;/P&gt;&lt;P&gt;         WHERE  pr_id   EQ '008'&lt;/P&gt;&lt;P&gt;         AND    sl_no   EQ l_seq_no&lt;/P&gt;&lt;P&gt;         AND    begda   LE sy-datum&lt;/P&gt;&lt;P&gt;         AND    endda   GE sy-datum&lt;/P&gt;&lt;P&gt;         AND    acode   EQ l_acode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  F_GET_APPROVER&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     --&amp;gt;P_INT_ORG_ORG_UNIT  text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     &amp;lt;--P_L_APPR_USERID  text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     &amp;lt;--P_L_ACODE  text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     &amp;lt;--P_L_SEQ_NO  text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM f_get_approver USING    p_org_unit&lt;/P&gt;&lt;P&gt;                    CHANGING p_appr_userid&lt;/P&gt;&lt;P&gt;                             p_acode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: l_pernr        LIKE pa0000-pernr.&lt;/P&gt;&lt;P&gt;  DATA: int_result LIKE swhactor   OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;  DATA: int_commun LIKE bapip0105b OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'RH_STRUC_GET'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            act_otype      = 'O'&lt;/P&gt;&lt;P&gt;            act_objid      = p_org_unit&lt;/P&gt;&lt;P&gt;            act_wegid      = 'ORGCHART'&lt;/P&gt;&lt;P&gt;            act_plvar      = ' '&lt;/P&gt;&lt;P&gt;            act_begda      = sy-datum&lt;/P&gt;&lt;P&gt;            act_endda      = sy-datum&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            result_tab     = int_result&lt;/P&gt;&lt;P&gt;       EXCEPTIONS&lt;/P&gt;&lt;P&gt;            no_plvar_found = 1&lt;/P&gt;&lt;P&gt;            no_entry_found = 2&lt;/P&gt;&lt;P&gt;            OTHERS         = 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;    LOOP AT int_result WHERE otype EQ 'C'.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;      SELECT SINGLE subty INTO p_acode FROM hrp1010&lt;/P&gt;&lt;P&gt;                WHERE objid EQ int_result-objid.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    LOOP AT int_result WHERE otype EQ 'P'.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;      MOVE int_result-objid TO l_pernr.&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'BAPI_EMPLOYEE_GETDATA'&lt;/P&gt;&lt;P&gt;           EXPORTING&lt;/P&gt;&lt;P&gt;                employee_id   = l_pernr&lt;/P&gt;&lt;P&gt;                date          = sy-datum&lt;/P&gt;&lt;P&gt;           TABLES&lt;/P&gt;&lt;P&gt;                communication = int_commun.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      LOOP AT int_commun WHERE subtype = '001'.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      MOVE int_commun-userid TO p_appr_userid.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2008 11:44:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hi/m-p/3257356#M777983</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-10T11:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: hi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hi/m-p/3257357#M777984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use like this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SWI_GET_USERS_OF_ORG_UNIT'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    otype                 = 'O'  " For organizational unit&lt;/P&gt;&lt;P&gt;    objid                  =       "Object ID (name) of org unit                   &lt;/P&gt;&lt;P&gt;  tables&lt;/P&gt;&lt;P&gt;    user_list             =  " internal table for output&lt;/P&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   NOT_FOUND             = 1&lt;/P&gt;&lt;P&gt;   NO_ACTIVE_PLVAR       = 2&lt;/P&gt;&lt;P&gt;   OTHERS                = 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will get al users in this internal table. Use describe to get number&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pankaj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2008 11:44:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hi/m-p/3257357#M777984</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-10T11:44:48Z</dc:date>
    </item>
  </channel>
</rss>

