<?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: Dynamic method call in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-method-call/m-p/7007146#M1496101</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes there is. The simplest would be&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: lv_partner  type ...

IF X = 1.  lv_partner = l_var_partner1 ENDIF. 
IF X = 2.  lv_partner = l_var_partner2 ENDIF.

CALL METHOD zz_but050=&amp;gt;get_but050
    EXPORTING
     i_var_partner1 = lv_partner 
    IMPORTING
      e_tab_but050   = l_tab_but050
    EXCEPTIONS
      keine_daten    = 1.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Or you can use dynamic form of CALL METHOD where you pass your parameters by means of &lt;STRONG&gt;PARAMETER-TABLE&lt;/STRONG&gt; addition. Please refer [CALL METHOD|http://help.sap.com/abapdocu_70/en/ABAPCALL_METHOD_SHORTREF.htm] -&amp;gt; dynamic form.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Jun 2010 08:29:56 GMT</pubDate>
    <dc:creator>MarcinPciak</dc:creator>
    <dc:date>2010-06-09T08:29:56Z</dc:date>
    <item>
      <title>Dynamic method call</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-method-call/m-p/7007145#M1496100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there any possibility to write something like this in ABAP ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  CALL METHOD zz_but050=&amp;gt;get_but050
    EXPORTING
    IF X = 1.  i_var_partner1 = l_var_partner1 ENDIF. 
    IF X = 2.  i_var_partner2 = l_var_partner2 ENDIF.
    IMPORTING
      e_tab_but050   = l_tab_but050
    EXCEPTIONS
      keine_daten    = 1.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Ioan Constantin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jun 2010 07:51:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-method-call/m-p/7007145#M1496100</guid>
      <dc:creator>former_member205645</dc:creator>
      <dc:date>2010-06-09T07:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic method call</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-method-call/m-p/7007146#M1496101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes there is. The simplest would be&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: lv_partner  type ...

IF X = 1.  lv_partner = l_var_partner1 ENDIF. 
IF X = 2.  lv_partner = l_var_partner2 ENDIF.

CALL METHOD zz_but050=&amp;gt;get_but050
    EXPORTING
     i_var_partner1 = lv_partner 
    IMPORTING
      e_tab_but050   = l_tab_but050
    EXCEPTIONS
      keine_daten    = 1.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Or you can use dynamic form of CALL METHOD where you pass your parameters by means of &lt;STRONG&gt;PARAMETER-TABLE&lt;/STRONG&gt; addition. Please refer [CALL METHOD|http://help.sap.com/abapdocu_70/en/ABAPCALL_METHOD_SHORTREF.htm] -&amp;gt; dynamic form.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jun 2010 08:29:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-method-call/m-p/7007146#M1496101</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-06-09T08:29:56Z</dc:date>
    </item>
  </channel>
</rss>

