{"id":7629,"date":"2025-08-24T16:43:39","date_gmt":"2025-08-24T11:13:39","guid":{"rendered":"https:\/\/www.sapewmhelp.com\/?question=types-of-rfc-function-modules"},"modified":"2025-08-24T16:43:39","modified_gmt":"2025-08-24T11:13:39","slug":"types-of-rfc-function-modules","status":"publish","type":"question","link":"https:\/\/www.sapewmhelp.com\/?question=types-of-rfc-function-modules","title":{"rendered":"Types of RFC Function Modules"},"content":{"rendered":"<p><strong>Synchronous RFC (sRFC)<\/strong><\/p>\n<ul>\n<li>\n<p><strong>Default type<\/strong> when you call a function module via RFC.<\/p>\n<\/li>\n<li>\n<p>The caller program waits until the remote system has completed the function execution and returned the result.<\/p>\n<\/li>\n<li>\n<p><strong>Example use:<\/strong> Real-time data retrieval (e.g., fetching stock from another SAP system).<\/p>\n<\/li>\n<li>\n<p><strong>FM execution:<\/strong> <code>CALL FUNCTION 'XYZ' DESTINATION 'SAP_R3'<\/code>.<\/p>\n<p><\/p>\n<\/li>\n<\/ul>\n<p><strong>2. Asynchronous RFC (aRFC)<\/strong><\/p>\n<ul>\n<li>\n<p>Execution is <strong>non-blocking<\/strong> \u2192 Caller does not wait for immediate results.<\/p>\n<\/li>\n<li>\n<p>You can trigger parallel processing by calling multiple aRFCs at the same time.<\/p>\n<\/li>\n<li>\n<p><strong>Example use:<\/strong> Mass data processing, parallelizing jobs.<\/p>\n<\/li>\n<li>\n<p><strong>FM execution:<\/strong><\/p>\n<\/li>\n<\/ul>\n<p>CALL FUNCTION &#8216;XYZ&#8217; STARTING NEW TASK &#8216;TASKNAME&#8217;<br \/>DESTINATION &#8216;SAP_R3&#8217;<br \/>PERFORMING callback_form ON END OF TASK.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>3. Transactional RFC (tRFC)<\/strong><\/p>\n<ul>\n<li>\n<p>Similar to aRFC, but with <strong>transactional reliability<\/strong>.<\/p>\n<\/li>\n<li>\n<p>Each call is executed <strong>exactly once<\/strong> in the target system (using LUWs \u2013 Logical Units of Work).<\/p>\n<\/li>\n<li>\n<p>Stored in <strong>SM58<\/strong> until delivered successfully.<\/p>\n<\/li>\n<li>\n<p><strong>Example use:<\/strong> Posting documents, ALE\/IDoc communication.<\/p>\n<\/li>\n<li>\n<p><strong>FM execution:<\/strong><\/p>\n<\/li>\n<\/ul>\n<p>CALL FUNCTION &#8216;XYZ&#8217; IN BACKGROUND TASK<br \/>DESTINATION &#8216;SAP_R3&#8217;.<br \/>COMMIT WORK.<\/p>\n<p><\/p>\n<p><strong>4. Queued RFC (qRFC)<\/strong><\/p>\n<ul>\n<li>\n<p>Extension of tRFC, but ensures <strong>sequence\/order of execution<\/strong> using queues.<\/p>\n<\/li>\n<li>\n<p>Uses <strong>inbound and outbound queues<\/strong> (transactions <strong>SMQ1\/SMQ2<\/strong>).<\/p>\n<\/li>\n<li>\n<p><strong>Example use:<\/strong> When sequence matters (e.g., stock transfer must happen before goods issue).<\/p>\n<\/li>\n<li>\n<p><strong>FM execution:<\/strong> Similar to tRFC, but with queue configuration.<\/p>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>Summary :<\/p>\n<table>\n<thead>\n<tr>\n<th>Type<\/th>\n<th>Waits for Response?<\/th>\n<th>Reliability<\/th>\n<th>Order Guaranteed?<\/th>\n<th>Use Case<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>sRFC<\/strong><\/td>\n<td>Yes<\/td>\n<td>Once<\/td>\n<td>No<\/td>\n<td>Real-time queries<\/td>\n<\/tr>\n<tr>\n<td><strong>aRFC<\/strong><\/td>\n<td>No<\/td>\n<td>Once<\/td>\n<td>No<\/td>\n<td>Parallel processing<\/td>\n<\/tr>\n<tr>\n<td><strong>tRFC<\/strong><\/td>\n<td>No<\/td>\n<td>Exactly Once<\/td>\n<td>No<\/td>\n<td>Data transfer, ALE\/IDoc<\/td>\n<\/tr>\n<tr>\n<td><strong>qRFC<\/strong><\/td>\n<td>No<\/td>\n<td>Exactly Once<\/td>\n<td>Yes<\/td>\n<td>Sequential processing<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>So, depending on your scenario:<\/p>\n<ul>\n<li>\n<p>Use <strong>sRFC<\/strong> for synchronous real-time calls.<\/p>\n<\/li>\n<li>\n<p>Use <strong>aRFC<\/strong> for parallel jobs.<\/p>\n<\/li>\n<li>\n<p>Use <strong>tRFC<\/strong> for reliable background communication.<\/p>\n<\/li>\n<li>\n<p>Use <strong>qRFC<\/strong> when sequence matters.<\/p>\n<\/li>\n<\/ul>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","question-category":[158],"question_tags":[178,188,370,177],"class_list":["post-7629","question","type-question","status-publish","hentry","question-category-abap","question_tags-abap","question_tags-fm","question_tags-rfc","question_tags-sap"],"_links":{"self":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/question\/7629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/question"}],"about":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7629"}],"wp:attachment":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7629"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fquestion-category&post=7629"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fquestion_tags&post=7629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}