<?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: problem when using Call FM IN UPDATE TASK. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-using-call-fm-in-update-task/m-p/3848028#M925144</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi abc,&lt;/P&gt;&lt;P&gt;no exception handling when using asynhronous update technique, please refer to PA BC414.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 May 2008 04:53:40 GMT</pubDate>
    <dc:creator>larry_lv</dc:creator>
    <dc:date>2008-05-13T04:53:40Z</dc:date>
    <item>
      <title>problem when using Call FM IN UPDATE TASK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-using-call-fm-in-update-task/m-p/3848021#M925137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;we plan to update ztable using Call FM in update task, and write the success/error message into log.&lt;/P&gt;&lt;P&gt; Does below is right??  I found the commit work can not be used here. Thanks..&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; _____________________________&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ENQUEUE_ETABLE'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt; CALL FUNCTION 'update_ztable'' IN UPDATE TASK.&lt;/P&gt;&lt;P&gt; Endif.&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;P&gt;COMMIT WORK and wait.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.    &lt;/P&gt;&lt;P&gt;     ROLLBACK WORK.&lt;/P&gt;&lt;P&gt;     write error log.&lt;/P&gt;&lt;P&gt;Else.&lt;/P&gt;&lt;P&gt;    Write successful log.&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'DNQUEUE_ALL'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2008 09:41:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-using-call-fm-in-update-task/m-p/3848021#M925137</guid>
      <dc:creator>larry_lv</dc:creator>
      <dc:date>2008-05-12T09:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: problem when using Call FM IN UPDATE TASK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-using-call-fm-in-update-task/m-p/3848022#M925138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;roleback statement doen't work after commit .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use committ work before rolleback.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2008 10:08:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-using-call-fm-in-update-task/m-p/3848022#M925138</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-12T10:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: problem when using Call FM IN UPDATE TASK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-using-call-fm-in-update-task/m-p/3848023#M925139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks jee, how about if uncomment the "rollback work" statement in program??  Does it works??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2008 10:16:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-using-call-fm-in-update-task/m-p/3848023#M925139</guid>
      <dc:creator>larry_lv</dc:creator>
      <dc:date>2008-05-12T10:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: problem when using Call FM IN UPDATE TASK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-using-call-fm-in-update-task/m-p/3848024#M925140</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;it works try it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2008 10:37:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-using-call-fm-in-update-task/m-p/3848024#M925140</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-12T10:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: problem when using Call FM IN UPDATE TASK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-using-call-fm-in-update-task/m-p/3848025#M925141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi , &lt;/P&gt;&lt;P&gt;Please see the refernce of UPDATE FUNCTION MODULES:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;UPDATE FUNCTION MODULE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-In the attributes tab, under processing type, choose Update Module,  &lt;/P&gt;&lt;P&gt; Start Immediately. Define your import parameters, enter the source &lt;/P&gt;&lt;P&gt; code, All validations should have been done prior to the call to this &lt;/P&gt;&lt;P&gt; function module, so all you need in the source, is the updating of the &lt;/P&gt;&lt;P&gt; database, INSERT, MODIFY, UPDATE, whatever.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-When you call you function module, use IN UPDATE TASK, after the call,  &lt;/P&gt;&lt;P&gt; COMMIT WORK. The commit work will trigger the db update.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Why do we use this " In Update Task " ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; The main update technique for bundling database changes in a single   &lt;/P&gt;&lt;P&gt;database LUW is to use CALL FUNCTION... IN UPDATE TASK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do we Use ??&lt;/P&gt;&lt;P&gt;A typical R/3 installation contains dialog work processes and at least one update work process. The update work processes are responsible for updating the database. When an ABAP program reaches a COMMIT WORK statement, any function modules from CALL FUNCTION... IN UPDATE TASK statements are released for processing in an update work process. The dialog process does not wait for the update to finish. This kind of update is called asynchronous update.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the Use... ??&lt;/P&gt;&lt;P&gt;Asynchronous update is useful when response time from the transaction is critical, and the database updates themselves are so complex that they justify the extra system load&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Real time scenario.&lt;/P&gt;&lt;P&gt;Suppose a user wants to change an entry in a database table, or add a new one. He or she enters the necessary data, and then starts the update process by choosing Save. This starts the following procedure in the ABAP program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Firstly, the program locks the database entry against other users, using the enqueue work process (or the message server in the case of a distributed system). This generates an entry in the lock table. The user is informed whether the update was successful, or whether the lock could not be set because of other users. &lt;/P&gt;&lt;P&gt;If the lock is set, the program reads the entry that is to be changed and modifies it. If the user has created a new entry, the program checks whether a record with the same key values already exists. &lt;/P&gt;&lt;P&gt;In the current dialog work process, the program calls a function module using CALL FUNCTION... IN UPDATE TASK, and this writes the change details as an entry in table VBLOG. &lt;/P&gt;&lt;P&gt;When the program is finished (maybe after further dialog steps), a COMMIT WORK statement starts the final part of the SAP LUW. The work process that is processing the current dialog step starts an update work process. &lt;/P&gt;&lt;P&gt;Based on the information passed to it from the dialog work process, the update work process reads the log entries belonging to the SAP LUW from table VBLOG. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The update work process passes this data to the database for updating, and analyzes the return message from the database. If the update was successful, the update work process triggers a database commit after the last database change and deletes the log entries from table VBLOG. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If an error occurred, the update work process triggers a database rollback, leaves the log entries in table VBLOG, flags them as containing errors, and sends a SAPoffice message to the user, who should then inform the system administrator. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The corresponding entries in the lock table are reset by the update work process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q:We are calling Sales Order Change in update task inside the user Exit MV50FZ1. We can see that the FM is called in update task after the commit work and the return of the FM shows the success message. But still the changes are not saved to the DB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A: check sm21 or sm13 to see if the update was successful  .. In SM21 I checked. It is giving me the error Transaction Failed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;Reward if useful &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Jagadeesh.G&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2008 10:48:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-using-call-fm-in-update-task/m-p/3848025#M925141</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-12T10:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: problem when using Call FM IN UPDATE TASK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-using-call-fm-in-update-task/m-p/3848026#M925142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks all, I will take a deep check and feedback soon.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 May 2008 01:45:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-using-call-fm-in-update-task/m-p/3848026#M925142</guid>
      <dc:creator>larry_lv</dc:creator>
      <dc:date>2008-05-13T01:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: problem when using Call FM IN UPDATE TASK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-using-call-fm-in-update-task/m-p/3848027#M925143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Larry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May i know why u said COMMIT WORK can not be used?&lt;/P&gt;&lt;P&gt;At the first place, do not explicitly code ROLLBACK WORK. Because it is being handled under your FM update_ztable. Basically u just need to launch a message type E in the FM if the DB operation fail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you mind to paste your FM code here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 May 2008 03:57:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-using-call-fm-in-update-task/m-p/3848027#M925143</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-13T03:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: problem when using Call FM IN UPDATE TASK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-using-call-fm-in-update-task/m-p/3848028#M925144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi abc,&lt;/P&gt;&lt;P&gt;no exception handling when using asynhronous update technique, please refer to PA BC414.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 May 2008 04:53:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-using-call-fm-in-update-task/m-p/3848028#M925144</guid>
      <dc:creator>larry_lv</dc:creator>
      <dc:date>2008-05-13T04:53:40Z</dc:date>
    </item>
  </channel>
</rss>

