<?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 function module in update task in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-in-update-task/m-p/873074#M50232</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have a fm and i have to use it in update task&lt;/P&gt;&lt;P&gt;in order to do it i changed the fm in the attributes&lt;/P&gt;&lt;P&gt;to update mode but i get error exporting parameters are not allowed in the update task.&lt;/P&gt;&lt;P&gt;what do i have to do in order to fix it?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Mar 2005 09:39:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-03-15T09:39:20Z</dc:date>
    <item>
      <title>function module in update task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-in-update-task/m-p/873074#M50232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have a fm and i have to use it in update task&lt;/P&gt;&lt;P&gt;in order to do it i changed the fm in the attributes&lt;/P&gt;&lt;P&gt;to update mode but i get error exporting parameters are not allowed in the update task.&lt;/P&gt;&lt;P&gt;what do i have to do in order to fix it?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2005 09:39:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-in-update-task/m-p/873074#M50232</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-15T09:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: function module in update task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-in-update-task/m-p/873075#M50233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should post your question in the ABAP forum you will get very good responses there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Post has been moved. &lt;/P&gt;&lt;P&gt;Message was edited by: Mark Finnern&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2005 10:15:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-in-update-task/m-p/873075#M50233</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-15T10:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: function module in update task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-in-update-task/m-p/873076#M50234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Craig, &lt;/P&gt;&lt;P&gt;how to go to ABAP Forum.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Sandeep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2005 05:34:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-in-update-task/m-p/873076#M50234</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-29T05:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: function module in update task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-in-update-task/m-p/873077#M50235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First question to ask is :&lt;/P&gt;&lt;P&gt;a) &amp;lt;b&amp;gt;Why do we use Function Module in Update Task ?&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We need to do updates in different tables and they are organised as parts of a large update code. We need the update to happen as a whole or update should not happen at all. Atomicity rule - (A)CID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you mark a function module in update task, SAP update work process ensures the above. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b) &amp;lt;b&amp;gt;When is the Function Module called ?&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This function module is called as soon as a COMMIT WORK is encountered. So all function modules called with UPDATE TASK and subroutines with PERFORM ...ON COMMIT are called as soon as a COMMIT WORK statement is encountered. So if you have any processing below your call to FM , those statements would already be processed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As from the above statements you can see that, having an EXPORT parameter makes no sense, as you can never use the value in that export parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is clear to you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Subramanian V.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2005 05:42:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-in-update-task/m-p/873077#M50235</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-29T05:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: function module in update task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-in-update-task/m-p/873078#M50236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Subramanian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to add two things to your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) In order for the function module to be executed in update task (after COMMIT WORK), it has to called as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION (name) IN UPDATE TASK&lt;/P&gt;&lt;P&gt;    EXPORTING &lt;/P&gt;&lt;P&gt;      ... = ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the addition "IN UPDATE TASK" is omitted, the fm will be called instantaneously instead of after COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) The main differences between PERFORM .. ON COMMIT and CALL FUNCTION ... IN UPDATE TASK are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- A form registered with PERFORM ... ON COMMIT will be executed exactly &lt;STRONG&gt;once&lt;/STRONG&gt; immediately after COMMIT WORK, no matter how often is has been called before the COMMIT. &lt;/P&gt;&lt;P&gt;A function module called IN UPDATE TASK is executed as many times as it was called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- A form registered with PERFORM ... ON COMMIT has full access to the global data of its surrounding program (i.e. function group) and other data available in the internal mode in which is was called (other function groups, instances and static data of global classes).&lt;/P&gt;&lt;P&gt;A function module called IN UPDATE TASK is executed in a different internal mode and is isolated from these things.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- No parameters can be passed to a form registered with PERFORM ... ON COMMIT. &lt;/P&gt;&lt;P&gt;A function module called IN UPDATE TASK can be called with parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in order to bundle many data changes into few mass updates to be executed after COMMIT WORK, the following strategy works best:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A function group is implemented that records all the pending database operations (updates, deletes, inserts) in internal tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of each individual update, delete, insert statement, the entries in the function group's memory are maintained via access function modules, and two form routines are called:&lt;/P&gt;&lt;P&gt;- perform ... on commit and&lt;/P&gt;&lt;P&gt;- perform ... on rollback.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The form routine to be called on commit is executed once after COMMIT WORK. It retrieves the list of pending database operations from the memory of its function group and calls a function module IN UPDATE TASK, passing the tables for insertions, deletions, and updates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function module performs mass database changes on the basis of its importing parameters (insert/update/delete .... from table ...).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The form routine to be called on rollback clears the tables of pending database operations so they won't be passed to the update function module during the next commit work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thorsten Franz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2005 13:56:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-in-update-task/m-p/873078#M50236</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-30T13:56:57Z</dc:date>
    </item>
  </channel>
</rss>

