<?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: Problem using Function Module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-function-module/m-p/1038407#M85814</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I debugged it and there is no problem in the passed in values. Not really sure what is going on...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Oct 2005 18:17:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-10-10T18:17:21Z</dc:date>
    <item>
      <title>Problem using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-function-module/m-p/1038405#M85812</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;I am using RH_STRUC_GET with evalPath O-O-S-P and get the or g structure. I then loop through the table obtained from RH_STRUC_GET and re-use RH_STRUC_GET with a evaluation path 'bossonly' to find out who the managers are. But it does not work. I get No ROOTS FOUND error. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try the function module RH_STRUC_GET separately with the same input fields then it works!!! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if I am doing anything wrong. My code is shown below....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION Z_ORGBUILDER_CONN.&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Local interface:&lt;/P&gt;&lt;P&gt;*"  IMPORTING&lt;/P&gt;&lt;P&gt;*"     VALUE(OTYPE) LIKE  OBJEC-OTYPE&lt;/P&gt;&lt;P&gt;*"     VALUE(OBJID) LIKE  OBJEC-OBJID&lt;/P&gt;&lt;P&gt;*"     VALUE(PATHID) LIKE  GDSTR-WEGID&lt;/P&gt;&lt;P&gt;*"     VALUE(PLVAR) LIKE  OBJEC-PLVAR&lt;/P&gt;&lt;P&gt;*"  EXPORTING&lt;/P&gt;&lt;P&gt;*"     VALUE(RETURN) LIKE  BAPIRET2 STRUCTURE  BAPIRET2&lt;/P&gt;&lt;P&gt;*"  TABLES&lt;/P&gt;&lt;P&gt;*"      L_ZCONN_TAB TYPE  ZCONN_TAB&lt;/P&gt;&lt;P&gt;*"      RESULT_TAB STRUCTURE  SWHACTOR OPTIONAL&lt;/P&gt;&lt;P&gt;*"      RESULT_OBJEC STRUCTURE  OBJEC OPTIONAL&lt;/P&gt;&lt;P&gt;*"      RESULT_STRUC STRUCTURE  STRUC OPTIONAL&lt;/P&gt;&lt;P&gt;*"      L_ZCONN_ORG TYPE  ZCONN_TAB&lt;/P&gt;&lt;P&gt;*"      L_ZCONN_POS_HOLDER TYPE  ZCONN_POS_TAB&lt;/P&gt;&lt;P&gt;*"      L_MANAGERS STRUCTURE  OBJEC&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: z_struc type zconn_struc.&lt;/P&gt;&lt;P&gt;DATA: xresult_struc like result_struc.&lt;/P&gt;&lt;P&gt;DATA: yresult_struc like result_struc.&lt;/P&gt;&lt;P&gt;DATA: z_struc1 type zconn_struc.&lt;/P&gt;&lt;P&gt;DATA: z_struc_pos type zconn_position.&lt;/P&gt;&lt;P&gt;DATA: temp_tab LIKE SWHACTOR occurs 0 with HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA: temp like struc-objid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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 = otype&lt;/P&gt;&lt;P&gt;                      act_objid = objid&lt;/P&gt;&lt;P&gt;                      act_plvar = plvar&lt;/P&gt;&lt;P&gt;                      act_wegid = pathid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          TABLES&lt;/P&gt;&lt;P&gt;                      result_tab = result_tab&lt;/P&gt;&lt;P&gt;                      result_struc = result_struc&lt;/P&gt;&lt;P&gt;                      result_objec = result_objec&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 &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;                      RAISE no_roots_found.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT result_struc into xresult_struc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      read table result_struc into yresult_struc with key seqnr =&lt;/P&gt;&lt;P&gt;xresult_struc-pup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        z_struc-objectID = xresult_struc-OBJID.&lt;/P&gt;&lt;P&gt;        z_struc-objectType = xresult_struc-otype.&lt;/P&gt;&lt;P&gt;        z_struc-parentID = yresult_struc-objid.&lt;/P&gt;&lt;P&gt;        z_struc-parentType = yresult_struc-otype.&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;Append z_struc to l_zconn_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT l_zconn_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if l_zconn_tab-objectType = 'O' or l_zconn_tab-objectType = 'S'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        z_struc1-objectID = l_zconn_tab-objectID.&lt;/P&gt;&lt;P&gt;        z_struc1-objectType = l_zconn_tab-objectType.&lt;/P&gt;&lt;P&gt;        z_struc1-parentID = l_zconn_tab-parentID.&lt;/P&gt;&lt;P&gt;        z_struc1-parentType = l_zconn_tab-parentType.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Append z_struc1 to l_zconn_org.&lt;/P&gt;&lt;P&gt;&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;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT l_zconn_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if l_zconn_tab-objectType = 'P'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        z_struc_pos-position = l_zconn_tab-parentID.&lt;/P&gt;&lt;P&gt;        z_struc_pos-pos_holder = l_zconn_tab-objectID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Append z_struc_pos to l_zconn_pos_holder.&lt;/P&gt;&lt;P&gt;&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;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at result_struc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if result_struc-otype = 'O'.&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 = result_struc-objid&lt;/P&gt;&lt;P&gt;                      act_plvar = '01'&lt;/P&gt;&lt;P&gt;                      act_wegid = 'bossonly'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          TABLES&lt;/P&gt;&lt;P&gt;                      result_tab = temp_tab&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 &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;                      RAISE no_roots_found.&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;          APPEND LINES OF temp_tab to L_managers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFUNCTION.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2005 17:38:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-function-module/m-p/1038405#M85812</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-10T17:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-function-module/m-p/1038406#M85813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So when you "test" in SE37 the function module RH_STRUC_GET works correctly?   Please debug you "Z" function module and make sure that the values that are being passed to the RH_STRUC_GET are the absolute same as when passing in the "TEST" mode.  You might be having a field conversion issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2005 17:44:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-function-module/m-p/1038406#M85813</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-10-10T17:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-function-module/m-p/1038407#M85814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I debugged it and there is no problem in the passed in values. Not really sure what is going on...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2005 18:17:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-function-module/m-p/1038407#M85814</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-10T18:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-function-module/m-p/1038408#M85815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are the values that you are passing to the function module.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2005 18:20:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-function-module/m-p/1038408#M85815</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-10-10T18:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-function-module/m-p/1038409#M85816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;act_otype = 'O'&lt;/P&gt;&lt;P&gt;                      act_objid = result_struc-objid&lt;/P&gt;&lt;P&gt;                      act_plvar = '01'&lt;/P&gt;&lt;P&gt;                      act_wegid = 'bossonly'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;result_struc-objid values are 60000251&lt;/P&gt;&lt;P&gt;                              60000253&lt;/P&gt;&lt;P&gt;                              60000254&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2005 18:40:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-function-module/m-p/1038409#M85816</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-10T18:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-function-module/m-p/1038410#M85817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please make sure that BOSSONLY is uppercase.  Does it work now?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


act_wegid = 'BOSSONLY'

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2005 18:54:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-function-module/m-p/1038410#M85817</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-10-10T18:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-function-module/m-p/1038411#M85818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rich. This is just stupid of me. It wokrs now with BOSSONLY. Didnt realize that it was case sensitive. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2005 18:57:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-function-module/m-p/1038411#M85818</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-10T18:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-function-module/m-p/1038412#M85819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cool,  because other than that,  I was not able to re-create your problem.    We learn something new everyday!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2005 19:07:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-function-module/m-p/1038412#M85819</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-10-10T19:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-function-module/m-p/1038413#M85820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one more question. As you know I am new at ABAP. The function RH_STRUC_GET, when ran with eval path BOSSONLY, returns a table with the org unit and the positions that are the managers. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to make a table from this table with two columns. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OrgUnit    Manager.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So If one department has more than one manager then I will have more rows with same ID for orgUNIT but different for positions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cant get the logic for it. Could you guide me in the right path. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Mark.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2005 19:32:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-function-module/m-p/1038413#M85820</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-10T19:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-function-module/m-p/1038414#M85821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;


data: begin of itab occurs 0,
      orgunit(10) type c,
      mananger(30) type c,
      end of itab.

* This will add a record to your itab
loop at result.

  itab-orgunit = result-orgunit.   " I don't know what fields they are
  itab-manager = result-manager.
  append itab.

endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please remember to award points for helpful answers and mark this post as solved if you question has been answered.  Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2005 19:51:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-function-module/m-p/1038414#M85821</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-10-10T19:51:38Z</dc:date>
    </item>
  </channel>
</rss>

