<?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 to Fm dynamically in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-to-fm-dynamically/m-p/5758430#M1304408</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can go for use macro for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINE macro_call_fm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'DDIF_FIELDINFO_GET'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;tabname = &amp;amp;1   "(iv_table_name)&lt;/P&gt;&lt;P&gt;langu = &amp;amp;2     " (sy-langu)&lt;/P&gt;&lt;P&gt;lfieldname = &amp;amp;3 " (iv_domain_name)&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;fixed_values = lt_domain_values&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;not_found = 1&lt;/P&gt;&lt;P&gt;internal_error = 2&lt;/P&gt;&lt;P&gt;OTHERS = 3.&lt;/P&gt;&lt;P&gt;IF sy-subrc 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Implement suitable error handling here&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;macro_call_fm: iv_table_name sy-langu iv_domain_name.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Jun 2009 16:43:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-06-30T16:43:30Z</dc:date>
    <item>
      <title>Call to Fm dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-to-fm-dynamically/m-p/5758425#M1304403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need to call this Fm for 5 times,&lt;/P&gt;&lt;P&gt;my question is instead of calling to the Fm 5 times one by one there is way to do &lt;/P&gt;&lt;P&gt;that better (nicer) ,i don't want to use perform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_domain_name = 'DATFM'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'DDIF_FIELDINFO_GET'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      tabname        = iv_table_name&lt;/P&gt;&lt;P&gt;      langu          = sy-langu&lt;/P&gt;&lt;P&gt;      lfieldname     = iv_domain_name&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      fixed_values   = lt_domain_values&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      not_found      = 1&lt;/P&gt;&lt;P&gt;      internal_error = 2&lt;/P&gt;&lt;P&gt;      OTHERS         = 3.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Implement suitable error handling here&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; lv_domain_name = 'DCPFM'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'DDIF_FIELDINFO_GET'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      tabname        = iv_table_name&lt;/P&gt;&lt;P&gt;      langu          = sy-langu&lt;/P&gt;&lt;P&gt;      lfieldname     = iv_domain_name&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      fixed_values   = lt_domain_values&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      not_found      = 1&lt;/P&gt;&lt;P&gt;      internal_error = 2&lt;/P&gt;&lt;P&gt;      OTHERS         = 3.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Implement suitable error handling here&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and so on...for 5 times&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Nina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2009 16:28:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-to-fm-dynamically/m-p/5758425#M1304403</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-30T16:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Call to Fm dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-to-fm-dynamically/m-p/5758426#M1304404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nina,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a perform and call the FM in the perform&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;lv_domain_name = 'DATFM'.

Perform_get using lv_domain_name.
clear : lv_domain_name

lv_domain_name = 'DCPFM'.

Perform_get using lv_domain_name.
clear : lv_domain_name.

and so on 5 times......


FORM_get using lv_domain_name.

CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
tabname = iv_table_name
langu = sy-langu
lfieldname = iv_domain_name
TABLES
fixed_values = lt_domain_values
EXCEPTIONS
not_found = 1
internal_error = 2
OTHERS = 3.
IF sy-subrc 0.
* Implement suitable error handling here
ENDIF.


ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will resolves your query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Manish&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Manish  Bisht on Jun 30, 2009 6:34 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2009 16:34:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-to-fm-dynamically/m-p/5758426#M1304404</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-30T16:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: Call to Fm dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-to-fm-dynamically/m-p/5758427#M1304405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Put the values of iv_domain_name into an intrnal table and then loop through the table calling the FM each time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2009 16:35:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-to-fm-dynamically/m-p/5758427#M1304405</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-30T16:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: Call to Fm dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-to-fm-dynamically/m-p/5758428#M1304406</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;PRE&gt;&lt;CODE&gt;itab-domain_name = 'DATFM'. Append ITab.
 itab-domain_name = 'DCPFM'. Append ITab.

LOOP AT ITAB.
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
tabname = iv_table_name
langu = sy-langu
lfieldname = itab-domain_name
TABLES
fixed_values = lt_domain_values
EXCEPTIONS
not_found = 1
internal_error = 2
OTHERS = 3.
IF sy-subrc 0.
* Implement suitable error handling here
ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2009 16:36:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-to-fm-dynamically/m-p/5758428#M1304406</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-30T16:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Call to Fm dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-to-fm-dynamically/m-p/5758429#M1304407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can check below sample,  Or you can prepare an internal table using changing parameters and call function in loop statement. &lt;/P&gt;&lt;P&gt;TYPE-POOLS abap. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: line     TYPE c LENGTH 80, &lt;/P&gt;&lt;P&gt;      text_tab LIKE STANDARD TABLE OF line, &lt;/P&gt;&lt;P&gt;      filename TYPE string, &lt;/P&gt;&lt;P&gt;      filetype TYPE c LENGTH 80, &lt;/P&gt;&lt;P&gt;      fleng    TYPE i. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: func TYPE string, &lt;/P&gt;&lt;P&gt;      ptab TYPE abap_func_parmbind_tab, &lt;/P&gt;&lt;P&gt;      ptab_line TYPE abap_func_parmbind, &lt;/P&gt;&lt;P&gt;      etab TYPE abap_func_excpbind_tab, &lt;/P&gt;&lt;P&gt;      etab_line TYPE abap_func_excpbind. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;func = 'GUI_DOWNLOAD'. &lt;/P&gt;&lt;P&gt;filename = 'c:\temp\text.txt'. &lt;/P&gt;&lt;P&gt;filetype = 'ASC'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ptab_line-name = 'FILENAME'. &lt;/P&gt;&lt;P&gt;ptab_line-kind = abap_func_exporting. &lt;/P&gt;&lt;P&gt;GET REFERENCE OF filename 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;ptab_line-name = 'FILETYPE'. &lt;/P&gt;&lt;P&gt;ptab_line-kind = abap_func_exporting. &lt;/P&gt;&lt;P&gt;GET REFERENCE OF filetype 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;ptab_line-name = 'DATA_TAB'. &lt;/P&gt;&lt;P&gt;ptab_line-kind = abap_func_tables. &lt;/P&gt;&lt;P&gt;GET REFERENCE OF text_tab 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;ptab_line-name = 'FILELENGTH'. &lt;/P&gt;&lt;P&gt;ptab_line-kind = abap_func_importing. &lt;/P&gt;&lt;P&gt;GET REFERENCE OF fleng 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;&lt;/P&gt;&lt;P&gt;etab_line-name = 'OTHERS'. &lt;/P&gt;&lt;P&gt;etab_line-value = 10. &lt;/P&gt;&lt;P&gt;INSERT etab_line INTO TABLE etab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION func &lt;/P&gt;&lt;P&gt;  PARAMETER-TABLE &lt;/P&gt;&lt;P&gt;    ptab &lt;/P&gt;&lt;P&gt;  EXCEPTION-TABLE &lt;/P&gt;&lt;P&gt;    etab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE sy-subrc. &lt;/P&gt;&lt;P&gt;  WHEN 1. &lt;/P&gt;&lt;P&gt;    ... &lt;/P&gt;&lt;P&gt;  ... &lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2009 16:37:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-to-fm-dynamically/m-p/5758429#M1304407</guid>
      <dc:creator>former_member194416</dc:creator>
      <dc:date>2009-06-30T16:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Call to Fm dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-to-fm-dynamically/m-p/5758430#M1304408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can go for use macro for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINE macro_call_fm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'DDIF_FIELDINFO_GET'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;tabname = &amp;amp;1   "(iv_table_name)&lt;/P&gt;&lt;P&gt;langu = &amp;amp;2     " (sy-langu)&lt;/P&gt;&lt;P&gt;lfieldname = &amp;amp;3 " (iv_domain_name)&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;fixed_values = lt_domain_values&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;not_found = 1&lt;/P&gt;&lt;P&gt;internal_error = 2&lt;/P&gt;&lt;P&gt;OTHERS = 3.&lt;/P&gt;&lt;P&gt;IF sy-subrc 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Implement suitable error handling here&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;macro_call_fm: iv_table_name sy-langu iv_domain_name.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2009 16:43:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-to-fm-dynamically/m-p/5758430#M1304408</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-30T16:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: Call to Fm dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-to-fm-dynamically/m-p/5758431#M1304409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Raj ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the solution u suggest is without doing loop on the FM or i had to do loop also?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Nina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2009 19:26:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-to-fm-dynamically/m-p/5758431#M1304409</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-30T19:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Call to Fm dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-to-fm-dynamically/m-p/5758432#M1304410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Gungorj ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the solution u suggest is without doing loop on the FM or i had to do loop also?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Nina&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Nina C on Jun 30, 2009 10:51 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Nina C on Jul 1, 2009 7:06 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2009 19:27:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-to-fm-dynamically/m-p/5758432#M1304410</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-30T19:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Call to Fm dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-to-fm-dynamically/m-p/5758433#M1304411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will suggest instead of calling this fm make a select from table DD01L and DD01T&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or make a select on table view DD03M&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2009 20:57:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-to-fm-dynamically/m-p/5758433#M1304411</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2009-06-30T20:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: Call to Fm dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-to-fm-dynamically/m-p/5758434#M1304412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can select the Domain from DD03L&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DD03L~DOMNAME&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2009 05:12:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-to-fm-dynamically/m-p/5758434#M1304412</guid>
      <dc:creator>former_member222860</dc:creator>
      <dc:date>2009-07-01T05:12:32Z</dc:date>
    </item>
  </channel>
</rss>

