<?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: using Dynamic Function module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-dynamic-function-module/m-p/7331835#M1538359</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Few tips:&lt;/P&gt;&lt;P&gt;1. FM FUNCTION_EXISTS can be use to check availability of function module&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. dynamic type declaration can be done by using parenthesis '( &amp;lt;&amp;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>Thu, 21 Oct 2010 19:56:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-10-21T19:56:49Z</dc:date>
    <item>
      <title>using Dynamic Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-dynamic-function-module/m-p/7331832#M1538356</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 have requirement where  have to call FM dynamically. I need to check if the IS OIL switch is on, than call the OIL FM otherwise normal FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem is when the IS OIL switch is off, the Oil FM will not be present and will give syntax error. Hence the requirement to use dynamic FM calling&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I went through some site &amp;amp; found how to use this FM. But in those FM you have declare data type of Input/export parameter.&lt;/P&gt;&lt;P&gt;Since in absence of Oil switch this data corresponding data element &amp;amp; domain would also be not there, I need to used this data declaration also dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way i can code for the above requirement to use Data declaration &amp;amp; FM dynamically, without giving syntax error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Harish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 18:44:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-dynamic-function-module/m-p/7331832#M1538356</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-21T18:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: using Dynamic Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-dynamic-function-module/m-p/7331833#M1538357</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 can check the if the function name exists in table TADIR with object=FUGR , obj_name=function_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Leandro Mengue&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 19:20:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-dynamic-function-module/m-p/7331833#M1538357</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-21T19:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: using Dynamic Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-dynamic-function-module/m-p/7331834#M1538358</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;Thanks for the reply. In this case let's say i will code like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If FM exists call FM else not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the calling FM dynamically i have to pass the parameter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let's say i write like something here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data : I_CHARG like OIB_DEF_INDEX_GM-CHARG. u201C First export paramter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:  	 ptab TYPE abap_func_parmbind_tab, &lt;/P&gt;&lt;P&gt;    	 ptab_line TYPE abap_func_parmbind, &lt;/P&gt;&lt;P&gt;                      func TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Func =  u2018OIB_QCI_READ_CONV_PARAMETERSu2019    " FM name&lt;/P&gt;&lt;P&gt;      	&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Exporting value 1&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;   	 I_CHARG  = 'XYZ'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Add into dynamic table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;ptab_line-name = 'I_CHARG '. &lt;/P&gt;&lt;P&gt;ptab_line-kind = abap_func_exporting. &lt;/P&gt;&lt;P&gt;GET REFERENCE OF  I_CHARG   INTO ptab_line-value. &lt;/P&gt;&lt;P&gt;INSERT ptab_line INTO TABLE ptab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here the issue is since the oil switch id off, data type  OIB_DEF_INDEX_GM-CHARG, will not be there &lt;/P&gt;&lt;P&gt;Once this program is loaded it will not compile&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to declare this data I_CHARG also dynamically. Thihs is due to the fact that  program with data declaration is loaded first &amp;amp; any program logic ( if else ) is done afterwards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once the program is loaded, sicne the data element is not there, it will not comiple &amp;amp; give error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope I am clear with the question&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Harish Wadhwani on Oct 21, 2010 9:35 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 19:35:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-dynamic-function-module/m-p/7331834#M1538358</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-21T19:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: using Dynamic Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-dynamic-function-module/m-p/7331835#M1538359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Few tips:&lt;/P&gt;&lt;P&gt;1. FM FUNCTION_EXISTS can be use to check availability of function module&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. dynamic type declaration can be done by using parenthesis '( &amp;lt;&amp;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>Thu, 21 Oct 2010 19:56:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-dynamic-function-module/m-p/7331835#M1538359</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-21T19:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: using Dynamic Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-dynamic-function-module/m-p/7331836#M1538360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please elaborate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My data declaration is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data : I_CHARG type OIB_DEF_INDEX_GM-CHARG. " First export parameter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i declare this so that if even the data type OIB_DEF_INDEX_GM-CHARG is not existing, it should not give syntax  error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data : I_CHARG type (OIB_DEF_INDEX_GM-CHARG) .but this does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Harish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 20:27:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-dynamic-function-module/m-p/7331836#M1538360</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-21T20:27:18Z</dc:date>
    </item>
  </channel>
</rss>

