<?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 with Update Statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-update-statement/m-p/3479382#M836390</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u can also use MODIFY statement instead of  update .&lt;/P&gt;&lt;P&gt;check return code.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0&lt;/P&gt;&lt;P&gt;commit work.&lt;/P&gt;&lt;P&gt;else write :'sy-subrc'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sona on Mar 8, 2008 4:01 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 08 Mar 2008 03:00:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-08T03:00:18Z</dc:date>
    <item>
      <title>Problem with Update Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-update-statement/m-p/3479379#M836387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am updating a  custome table by using following statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;Update Ztable&lt;/P&gt;&lt;P&gt;      gt_trgt-werks  = it_werks-werks.&lt;/P&gt;&lt;P&gt;      gt_trgt-mmyy   = sy-datum(6).&lt;/P&gt;&lt;P&gt;      gt_trgt-trgt   = target.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM check_exits1 USING s_flag .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF s_flag EQ 'X'.&lt;/P&gt;&lt;P&gt;        UPDATE zpv_target FROM gt_trgt.&lt;/P&gt;&lt;P&gt;      ELSE.&lt;/P&gt;&lt;P&gt;        INSERT zpv_target FROM gt_trgt.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;*--End of UPDATE ZTABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here PERFORM check_exists check values exist or not. I am facing a problem in Update statement as it is not updating the custome table. While debugging in foun that i have new values in gt_targt but zpv_target is having the same values as it was. Means values are not updated in custome table.&lt;/P&gt;&lt;P&gt;It seems to me tht the problem is with custome table, as it is inserting values properly but not updating it.&lt;/P&gt;&lt;P&gt;Settings for the table is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Fields&lt;/P&gt;&lt;P&gt;&lt;U&gt;FIELD&lt;/U&gt;          &lt;U&gt;DATAELEMENT&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Aufnr                 Aufnr&lt;/P&gt;&lt;P&gt;Cut                   char1&lt;/P&gt;&lt;P&gt;Probl                 char40&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Data Class    APPL1&lt;/P&gt;&lt;P&gt;-size              5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Delievery Class          C&lt;/P&gt;&lt;P&gt;-Display/Maintainance Allowed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Buffering not allowed&lt;/P&gt;&lt;P&gt;-Log data changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Maintainance generator is also created with authorization to all.&lt;/P&gt;&lt;P&gt;&amp;amp; one screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please tell me Do i need to change anything in table or there in the Update statement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Mar 2008 01:28:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-update-statement/m-p/3479379#M836387</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-08T01:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Update Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-update-statement/m-p/3479380#M836388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;add COMMIT WORK. statement after update..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u can also use COMMIT WORK AND WAIT.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Mar 2008 02:43:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-update-statement/m-p/3479380#M836388</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-08T02:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Update Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-update-statement/m-p/3479381#M836389</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;One thing am not understanding&lt;/P&gt;&lt;P&gt;U mentined the fields in ZPV_TARGET custom table are &lt;/P&gt;&lt;P&gt;Aufnr &lt;/P&gt;&lt;P&gt;Cut&lt;/P&gt;&lt;P&gt;Probl &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But u inserting or updating with the following fields values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gt_trgt-werks &lt;/P&gt;&lt;P&gt;gt_trgt-mmyy&lt;/P&gt;&lt;P&gt; gt_trgt-trgt &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how order number and plant data will match.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cut is 1 length character field but u r inserting sy-datum value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how they will match.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Mar 2008 02:51:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-update-statement/m-p/3479381#M836389</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-08T02:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Update Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-update-statement/m-p/3479382#M836390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u can also use MODIFY statement instead of  update .&lt;/P&gt;&lt;P&gt;check return code.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0&lt;/P&gt;&lt;P&gt;commit work.&lt;/P&gt;&lt;P&gt;else write :'sy-subrc'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sona on Mar 8, 2008 4:01 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Mar 2008 03:00:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-update-statement/m-p/3479382#M836390</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-08T03:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Update Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-update-statement/m-p/3479383#M836391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, ZPV_TARGET has same fields which i am updating,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Werks,&lt;/P&gt;&lt;P&gt;mmyy,&lt;/P&gt;&lt;P&gt;trgt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Mar 2008 03:10:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-update-statement/m-p/3479383#M836391</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-08T03:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Update Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-update-statement/m-p/3479384#M836392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried commit work too.&lt;/P&gt;&lt;P&gt;The problem is on Update statement as while debugging on update line i found the values are not changed. First it should be change then only we can say for commit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Mar 2008 03:13:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-update-statement/m-p/3479384#M836392</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-08T03:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Update Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-update-statement/m-p/3479385#M836393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Sona,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried Modify too, even that not worked&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need i can send u the whole code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Nik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Mar 2008 03:15:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-update-statement/m-p/3479385#M836393</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-08T03:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Update Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-update-statement/m-p/3479386#M836394</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;after update statment use commit statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;don't try to update the same data which already there.&lt;/P&gt;&lt;P&gt;just change any field content and then try.&lt;/P&gt;&lt;P&gt;becoz even we try to update the same data we don't know whether data is updated or not.&lt;/P&gt;&lt;P&gt;in debugging check the sy-subrc value if it is equal to 0 means the data will definitly update in the database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i will helpful for u.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Mar 2008 03:16:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-update-statement/m-p/3479386#M836394</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-08T03:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Update Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-update-statement/m-p/3479387#M836395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey,&lt;/P&gt;&lt;P&gt;may be the value in IF condition is not = X thats why its not updated&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thats why  insert works..( u hv mentioned)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also check if the unique key value u have in internal has same value in ztable also.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Mar 2008 03:29:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-update-statement/m-p/3479387#M836395</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-08T03:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Update Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-update-statement/m-p/3479388#M836396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;solved&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Apr 2009 12:26:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-update-statement/m-p/3479388#M836396</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-26T12:26:07Z</dc:date>
    </item>
  </channel>
</rss>

