Quantcast
Channel: SCN: Message List - ABAP Connectivity
Viewing all articles
Browse latest Browse all 3125

Re: WHAT WILL HAPPEN IF RFC IS CALLED WITHOUT SPECIFYING DESTINATION

$
0
0

But then it's not an RFC... (The "R" here stands for "remote"... ).

 

So the "correct" answer would rather be: "an RFC cannot be called without specifying a destination".
(If you don't specify a destination, then it is not an RFC - by definition...)

 

 

To be more elaborate:

  • ABAP statement "CALL FUNCTION 'ABC' EXPORTING ... IMPORTING ..." means: ABAP code execution just jumps into the ABAP code of ABC and executes it in the current system in the current user session.
  • ABAP statement "CALL FUNCTION 'ABC' DESTINATION 'XYZ' EXPORTING ... IMPORTING ..." means: a network connection to XYZ is opened, a new user session is created in that system, the inputs are transported to XYZ, the code is executed in XYZ and the results are transported back to the current system/user session.

 

 

Three notes:

  1. XYZ can also point to the "current system", for example via destination "NONE". But the kernel still opens a network connection to "itself" (perhaps to localhost, perhaps to a different app server, depending on the settings of the destination) and creates a new user session!
  2. When specifying a DESTINATION in the CALL FUNCTION statement, you can (and should) catch two additional standard exceptions in the EXCEPTIONS clause of the statement, even if the function module does not have any exceptions of its own: SYSTEM_FAILURE and COMMUNICATION_FAILURE. The first one gives you more details in case the execution of the function module failed on kernel level in the target system (e.g. the function module "ABC" does not exist in the target system), while the second one gives you more details in case the target system cannot be reached (e.g. network problem, hostname unknown, etc.)
  3. When specifying a DESTINATION in the CALL FUNCTION statement, you are not limited to calling ABAP function modules: you could as well call function modules written in C/C++, Java, C#, Visual Basic, etc., if the destination points to an external program. The calling ABAP side will not notice any difference...

 

Best Regards, Ulrich


Viewing all articles
Browse latest Browse all 3125

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>