<?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: Func. Module @ background in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/func-module-background/m-p/3778586#M909151</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; i think there is no way to run the fm directil in the background .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but using the sy-batch  you can no the status of the fm in a program in the back ground.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do like this..in the fm code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-batch = 0.&lt;/P&gt;&lt;P&gt;message s000 with 'the data selection started  from mara'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from mara into table itab where matnr =  matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-batch = 0.&lt;/P&gt;&lt;P&gt;message s000 with 'the data selected successfully'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;these message can be seen in the sm37..job log&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;venkat appikonda.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 May 2008 08:51:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-08T08:51:23Z</dc:date>
    <item>
      <title>Func. Module @ background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/func-module-background/m-p/3778581#M909146</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;any 1 help me out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;" how to run functional module @ background"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think its not posible in sm37.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any 1 help me out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pts vil be rewarded&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 08:34:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/func-module-background/m-p/3778581#M909146</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-08T08:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Func. Module @ background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/func-module-background/m-p/3778582#M909147</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;&lt;/P&gt;&lt;P&gt;You can place the function module inside a program and then submit it to background.&lt;/P&gt;&lt;P&gt;I think there is no direct way to submit it in background.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see the following also&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Transactional Integrity of tRFCs&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;You can execute function modules in background tasks in another SAP system or an external program. When you call function modules in this way, they are not executed at once, but wait until a COMMIT WORK is triggered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Transactional RFCs receive there name from the fact that the associated remote function call mechanism guarantees transactional integrity for all calls made with the IN BACKGROUND TASKsuffix. As with database updates, LUWs (logical units of work) are created for calls that are scheduled to run in background tasks. All tRFCs with a single destination that occur between one COMMIT WORK and the next belong to a single LUW. Within a given LUW, all calls:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        execute in the order they were called&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        run in the same program context in the target system&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        run as a single transaction: they are either committed or rolled back as a unit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LUWs are identified by transaction IDs that are unique world-wide. The transaction ID can be determined from an ABAP program by calling function module ID_OF_BACKGROUNDTASK. (You must call this function after the first asynchronous CALL, and before the related COMMIT WORK.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because the RFC is like a transaction, database operations are either all executed or, if a function module terminates, all rolled back. If an LUW runs successfully, you cannot execute it again. In some cases, it may be necessary to program the roll back of an LUW, (for example, because a table is locked). To do this, you call the function module RESTART_OF_BACKGROUNDTASK which performs a rollback and ensures that the LUW is executed again later. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Normally, the LUW is executed immediately after COMMIT WORK in the specified target system. However, you can also define a certain time at which you want the execution to be made. To do this, call the function module START_OF_BACKGROUNDTASK from within the affected LUW after the first CALL... IN BACKGROUND TASK and before COMMIT WORK. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Checking the Status of Transactional Calls&lt;/P&gt;&lt;P&gt;All transactional RFCs are stored in the tables ARFCSSTATE and ARFCSDATA. Here, each LUW is identified by a unique ID. When a COMMIT WORK is made, the calls belonging to this ID are executed in the target system. The system function module ARFC_DEST_SHIP transports the data to the target system and the function module ARFC_EXECUTE executes the stored function calls. If an error or an exception occurs during one of the calls, all the database operations started by the preceding calls are rolled back and an appropriate error message is written to the file ARFCSSTATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are two methods for checking on the status of a transaction ID:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        From an ABAP program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function module ID_OF_BACKGROUNDTASK returns the ID of the LUW. You call this module after the first CALL... IN BACKGROUND TASK and before COMMIT WORK. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION &amp;#145;ID_OF_BACKGROUNDTASK&amp;#146; IMPORTING  TASK-ID = TID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you have identified the ID of the LUW, you can use the function module STATUS_OF_BACKGROUNDTASK to determine the status of the transactional RFC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION &amp;#145;STATUS_OF_BACKGROUNDTASK&amp;#146;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPORTING TID&lt;/P&gt;&lt;P&gt; = TASK-ID&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;IMPORTING ERRORTAB&lt;/P&gt;&lt;P&gt; = ERTAB&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;EXCEPTIONS COMMUNICTATION&lt;/P&gt;&lt;P&gt; = 01 &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;(Connection not available: will try again later)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;RECORDED&lt;/P&gt;&lt;P&gt; = 02 &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;(ARFC is scheduled)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ROLLBACK&lt;/P&gt;&lt;P&gt; = 03 &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;(Rollback triggered in target system)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        Online&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call transaction SM58 (Tools ® Administration ® Monitoring ® Transactional RFC). This tool lists only those transactonal RFCs that could not be carried out successfully or that had to be planned as batch jobs. The list includes the LUW ID and an error message. Error messages displayed in SM58 are taken from the target system. To display the text of the message, double-click on the message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Transaction SM58 also lets you control your transactional RFC at various stages. If the call ends abnormally during the sending process, you may need to use the Rollback LUW function to manually rollback the LUW before attempting a resend. If the target system was unavailable, you can use the Backgr.job function to display the batch job created for your call. Execute funct. module lets you restart the call after the occurrence of a temporary error (such as a syntax error).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a LUW runs successfully in the target system, the function module ARFC_DEST_CONFIRM is triggered and confirms the successful execution in the target system. Finally, the entries in the Tables ARFCSSTATE and ARFCSDATA are deleted. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RFC API&lt;/P&gt;&lt;P&gt;You can also execute programs asynchronously in 'C'-implemented function modules (connection type TCP/IP in transaction SM59, see Destination Types). Implementation of the function modules occurs as usual in connection with the RFC API. This contains the function modules ARFC_DEST_SHIP and ARFC_DEST_CONFIRM which call the appropriate functions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The qRFC Communication Model&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 08:40:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/func-module-background/m-p/3778582#M909147</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-08T08:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Func. Module @ background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/func-module-background/m-p/3778583#M909148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Irfan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even though there is no direct way of running FM in background, what you can do is to create a Z program and call the FM inside the program with desired values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now run the program in Background.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 08:41:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/func-module-background/m-p/3778583#M909148</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-08T08:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Func. Module @ background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/func-module-background/m-p/3778584#M909149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;why dont you generate a program for tht function module and then define it as a background job.&lt;/P&gt;&lt;P&gt;anyway u need a variant to run it in background that u cant define for function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;siddharth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 08:45:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/func-module-background/m-p/3778584#M909149</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-08T08:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Func. Module @ background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/func-module-background/m-p/3778585#M909150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION &amp;lt;function&amp;gt; IN UPDATE TASK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 08:49:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/func-module-background/m-p/3778585#M909150</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-08T08:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Func. Module @ background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/func-module-background/m-p/3778586#M909151</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; i think there is no way to run the fm directil in the background .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but using the sy-batch  you can no the status of the fm in a program in the back ground.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do like this..in the fm code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-batch = 0.&lt;/P&gt;&lt;P&gt;message s000 with 'the data selection started  from mara'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from mara into table itab where matnr =  matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-batch = 0.&lt;/P&gt;&lt;P&gt;message s000 with 'the data selected successfully'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;these message can be seen in the sm37..job log&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;venkat appikonda.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 08:51:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/func-module-background/m-p/3778586#M909151</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-08T08:51:23Z</dc:date>
    </item>
  </channel>
</rss>

