<?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: Dynamically calling RFC in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-calling-rfc/m-p/1319487#M164869</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;There is no such generic function as the parameters of each of the RFC's will be different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the source system of the RFC get the pattern in the SE38 and copy that pattern of that function to the system from where you want to initiate the call and add a extra clause of DESTINATION 'RFC_DEST' to it. You need to declare the parameters as variables in your system which will be of the same type as that in the function. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will make a call and get the results for you. Once done, you can use CL_GUI_FRONTEND_SERVICES-&amp;gt;GUI_DOWNLOAD method to download the values to a file on the desktop. If you want a file on the app server, use the OPEN DATASET, TRANSFER, CLOSE DATASET statements to create the file with the contents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;Note : Please mark all the helpful answers and close the thread if the question is answered. You just will have to mark the Problem solved star against the answer that helped you the most.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 27 May 2006 23:42:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-05-27T23:42:51Z</dc:date>
    <item>
      <title>Dynamically calling RFC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-calling-rfc/m-p/1319482#M164864</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;can anyone tell me the RFC name (forgot it!,returning to ABAP programming after couple of years gap)that can be used to execute RFC's by passing the RFC name as a parameter.&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>Fri, 26 May 2006 01:11:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-calling-rfc/m-p/1319482#M164864</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-26T01:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically calling RFC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-calling-rfc/m-p/1319483#M164865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what u need excatly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RFC 's are of three types&lt;/P&gt;&lt;P&gt;THE DESTINATION &amp;lt;DEST&amp;gt; should be set in sm59 and that name should be fiven the place of &amp;lt;DEST&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. synchronous:&lt;/P&gt;&lt;P&gt;syntax:&lt;/P&gt;&lt;P&gt;CALL FUNCTION &amp;lt;FN NAME&amp;gt; DESTINATION &amp;lt;DEST&amp;gt;.&lt;/P&gt;&lt;P&gt;when ever a fn module is called, current program is stopped and the control goes to the fn  module and after the fn module is executed, control returns back to the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. asynchronous :&lt;/P&gt;&lt;P&gt;CALL FUNCTION &amp;lt;FN NAME&amp;gt; DESTINATION &amp;lt;DEST&amp;gt; STARTING NEW TASK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the use of asynchronous is , the fn can be executed in a separate task with out disturbing the flow of current program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. transactional : TRFC is used because, even if the destination is not available, it waits for a certain period of time and once it is available it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION &amp;lt;FN NAME&amp;gt; DESTINATION &amp;lt;DEST&amp;gt; BACKGROUND TASK.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2006 02:54:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-calling-rfc/m-p/1319483#M164865</guid>
      <dc:creator>hymavathi_oruganti</dc:creator>
      <dc:date>2006-05-26T02:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically calling RFC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-calling-rfc/m-p/1319484#M164866</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;no special RFC Function needed, you can use a variable as name in the CALL FUNCTION statement!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matthias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2006 07:08:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-calling-rfc/m-p/1319484#M164866</guid>
      <dc:creator>matthias_fiebig</dc:creator>
      <dc:date>2006-05-26T07:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically calling RFC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-calling-rfc/m-p/1319485#M164867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Matthias.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But how do you then get the results back especially I'm interested in executing them and dumping their table results in a file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2006 18:25:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-calling-rfc/m-p/1319485#M164867</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-26T18:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically calling RFC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-calling-rfc/m-p/1319486#M164868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Even though you are using a variable for the function module name, you still have to provide the signature(interface), which really doesn't it make it dynamic, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001.

data: fc_external(30) type c value 'CONVERT_DATE_TO_EXTERNAL'.
data: fc_internal(30) type c value 'CONVERT_DATE_TO_INTERNAL'.

data: datum1(10) type c.
data: datum2 type sy-datum.

call function fc_external
     exporting
          date_internal = sy-datum
     importing
          date_external = datum1.


write:/ datum1.

call function fc_internal
     exporting
          date_external = datum1
     importing
          date_internal = datum2.


write:/ datum2.

&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>Fri, 26 May 2006 18:34:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-calling-rfc/m-p/1319486#M164868</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-05-26T18:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically calling RFC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-calling-rfc/m-p/1319487#M164869</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;There is no such generic function as the parameters of each of the RFC's will be different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the source system of the RFC get the pattern in the SE38 and copy that pattern of that function to the system from where you want to initiate the call and add a extra clause of DESTINATION 'RFC_DEST' to it. You need to declare the parameters as variables in your system which will be of the same type as that in the function. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will make a call and get the results for you. Once done, you can use CL_GUI_FRONTEND_SERVICES-&amp;gt;GUI_DOWNLOAD method to download the values to a file on the desktop. If you want a file on the app server, use the OPEN DATASET, TRANSFER, CLOSE DATASET statements to create the file with the contents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;Note : Please mark all the helpful answers and close the thread if the question is answered. You just will have to mark the Problem solved star against the answer that helped you the most.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 May 2006 23:42:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-calling-rfc/m-p/1319487#M164869</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-27T23:42:51Z</dc:date>
    </item>
  </channel>
</rss>

