<?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: call subroutines dynamically in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-subroutines-dynamically/m-p/8639327#M1665575</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if the number of parameters is not always the same then you have to pass an internal table as parameter, and inside the table you have your parameters&lt;/P&gt;&lt;P&gt;for this purpose you could use a structure like DYNPREAD for your internal table&lt;/P&gt;&lt;P&gt;now if you want to be able to pass any type of parameter to your routine then you set a parameter with type TYPE REF TO DATA. Before you call the routine you do a GET REFERENCE OF on your parameter and you pass the reference. Then in the routine you are able to get the type of the parameter (do an ASSIGN then a DESCRIBE) and react accordingly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Mar 2012 09:34:00 GMT</pubDate>
    <dc:creator>franois_henrotte</dc:creator>
    <dc:date>2012-03-23T09:34:00Z</dc:date>
    <item>
      <title>call subroutines dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-subroutines-dynamically/m-p/8639324#M1665572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all experts,&lt;/P&gt;&lt;P&gt;I got a problem with dynamical calling subroutines. I have a huge list of subroutines to call. Each of them has own defined paramter interface.&lt;/P&gt;&lt;P&gt;Such like this.&lt;/P&gt;&lt;P&gt;FORM subroutine&lt;/P&gt;&lt;P&gt;USING var1 TYPE typ1&lt;/P&gt;&lt;P&gt;CHANGING var2 TYPE typ2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; varN TYPE typN&lt;/P&gt;&lt;P&gt;We dont know the data types of paramters and the number of CHANGING PARAMETER is variate too.&lt;/P&gt;&lt;P&gt;I have tried to use the "generate subroutine pool" to call them dynamically but the number of subroutine pools I want to create is heavily exceed the limit of 36 times.&lt;/P&gt;&lt;P&gt;Is there any other intelligent way to implement it. &lt;/P&gt;&lt;P&gt;Thanks and with best Regards,&lt;/P&gt;&lt;P&gt;Jun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2012 15:09:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-subroutines-dynamically/m-p/8639324#M1665572</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-22T15:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: call subroutines dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-subroutines-dynamically/m-p/8639325#M1665573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;is it possible to build a paramter table like dynamically calling the class method or function module?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2012 08:22:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-subroutines-dynamically/m-p/8639325#M1665573</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-23T08:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: call subroutines dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-subroutines-dynamically/m-p/8639326#M1665574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have look at the technique of calling a subroutine from a sap script. I think the same applies here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why not encapsulating each of the 36 calls in different LUW's . Will this work ?&lt;SPAN __jive_emoticon_name="confused" __jive_macro_name="emoticon" class="jive_macro jive_macro_emoticon jive_emote" src="https://community.sap.com/5.0.1/images/emoticons/confused.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2012 09:18:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-subroutines-dynamically/m-p/8639326#M1665574</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2012-03-23T09:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: call subroutines dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-subroutines-dynamically/m-p/8639327#M1665575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if the number of parameters is not always the same then you have to pass an internal table as parameter, and inside the table you have your parameters&lt;/P&gt;&lt;P&gt;for this purpose you could use a structure like DYNPREAD for your internal table&lt;/P&gt;&lt;P&gt;now if you want to be able to pass any type of parameter to your routine then you set a parameter with type TYPE REF TO DATA. Before you call the routine you do a GET REFERENCE OF on your parameter and you pass the reference. Then in the routine you are able to get the type of the parameter (do an ASSIGN then a DESCRIBE) and react accordingly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2012 09:34:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-subroutines-dynamically/m-p/8639327#M1665575</guid>
      <dc:creator>franois_henrotte</dc:creator>
      <dc:date>2012-03-23T09:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: call subroutines dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-subroutines-dynamically/m-p/8639328#M1665576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;is there anything preventing you from using class methods?&lt;/P&gt;&lt;P&gt;You could rebuild your subroutines as methods of a (local) class.&lt;/P&gt;&lt;P&gt;Or else although this might seem a bit bulky but still way better then generate subroutine pool&lt;/P&gt;&lt;P&gt;you could build a wrapper method for each of your subroutines, thus beeing able to use parameter tables on the caller site and then addressing each subroutine with the correct supply of parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jörg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2012 09:45:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-subroutines-dynamically/m-p/8639328#M1665576</guid>
      <dc:creator>jrg_wulf</dc:creator>
      <dc:date>2012-03-23T09:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: call subroutines dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-subroutines-dynamically/m-p/8639329#M1665577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Jun Long,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; You can define data type as generic type and take the paramater into a internal table and pass the value by creating method.Let me know if you want more clarification.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ankita&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2012 11:26:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-subroutines-dynamically/m-p/8639329#M1665577</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-23T11:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: call subroutines dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-subroutines-dynamically/m-p/8639330#M1665578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jun,&lt;/P&gt;&lt;P&gt;The best approach in such case is to use Class and method in place of subroutene, where you can make the parameters optional. &lt;/P&gt;&lt;P&gt;If it is required to use only subroutene, then you declare parameters with type &lt;STRONG&gt;ANY&lt;/STRONG&gt; and pass different structures at different call. &lt;/P&gt;&lt;P&gt;Hope this helps. &lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Samir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2012 11:27:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-subroutines-dynamically/m-p/8639330#M1665578</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-23T11:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: call subroutines dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-subroutines-dynamically/m-p/8639331#M1665579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi François Henrotte, &lt;/P&gt;&lt;P&gt;Thanks for your reply. The problem is&amp;nbsp; I cant do any modifications in the routines which I called.&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Jun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2012 13:28:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-subroutines-dynamically/m-p/8639331#M1665579</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-23T13:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: call subroutines dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-subroutines-dynamically/m-p/8639332#M1665580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ankita,&lt;/P&gt;&lt;P&gt;please give more clarification. &lt;/P&gt;&lt;P&gt;Do you mean I should create a class method as Interface to receicve the parameters in internal table of generic types. Then I call the subroutine within my class method?&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Jun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2012 13:34:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-subroutines-dynamically/m-p/8639332#M1665580</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-23T13:34:19Z</dc:date>
    </item>
  </channel>
</rss>

