<?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: Update statement not working in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement-not-working/m-p/3659366#M881459</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ended up doing a delete then an insert.  I assume I couldn't modify because the field zprodorder-aufnr was in the initial state.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Apr 2008 20:34:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-04T20:34:25Z</dc:date>
    <item>
      <title>Update statement not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement-not-working/m-p/3659360#M881453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the following in some code and the update statement isn't working:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    SELECT SINGLE * FROM zprodorder.
    zprodorder-aufnr = wa_afko-aufnr.
    UPDATE zprodorder.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Davis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 18:07:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement-not-working/m-p/3659360#M881453</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T18:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement-not-working/m-p/3659361#M881454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Whether COMMIT WORK is available after UPDATE zprodorder.?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT SINGLE * FROM zprodorder.
    zprodorder-aufnr = wa_afko-aufnr.
    UPDATE zprodorder.
    Commit work.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 18:10:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement-not-working/m-p/3659361#M881454</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2008-04-04T18:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement-not-working/m-p/3659362#M881455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ,&lt;/P&gt;&lt;P&gt;check this simple example..to under stand the update command&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: p_carrid TYPE sflight-carrid, &lt;/P&gt;&lt;P&gt;            percent  TYPE p LENGTH 1 DECIMALS 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA sflight_tab TYPE TABLE OF sflight. &lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS &amp;lt;sflight&amp;gt; TYPE sflight. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * &lt;/P&gt;&lt;P&gt;       FROM sflight &lt;/P&gt;&lt;P&gt;       INTO TABLE sflight_tab &lt;/P&gt;&lt;P&gt;       WHERE carrid = p_carrid AND &lt;/P&gt;&lt;P&gt;             fldate = sy-datum. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0. &lt;/P&gt;&lt;P&gt;  LOOP AT sflight_tab ASSIGNING &amp;lt;sflight&amp;gt;. &lt;/P&gt;&lt;P&gt;    &amp;lt;sflight&amp;gt;-price = &lt;/P&gt;&lt;P&gt;      &amp;lt;sflight&amp;gt;-price * ( 1 - percent / 100 ). &lt;/P&gt;&lt;P&gt;  ENDLOOP. &lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE sflight FROM TABLE sflight_tab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;venkat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 18:17:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement-not-working/m-p/3659362#M881455</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T18:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement-not-working/m-p/3659363#M881456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I didn't think it was needed because I have an update statement directly above it (on a z-field on AFKO) and it works every time.  Could the issue be that my table is starting off as initial?  The table holds one field, aufnr and it is currently initial.  We are using this table to hold one single record.  It is being used to have a starting point for an idoc routine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just tried a commit work and it doesn't seem to help.  I guess I'll try a using a work area next.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Davis on Apr 4, 2008 2:22 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 18:17:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement-not-working/m-p/3659363#M881456</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T18:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement-not-working/m-p/3659364#M881457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be a chance of table be startoff with initial.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;make the code as this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT SINGLE * FROM zprodorder.
if sy-subrc eq 0.
    zprodorder-aufnr = wa_afko-aufnr.
    UPDATE zprodorder.
else.
    zprodorder-aufnr = wa_afko-aufnr.
    INSERT zprodorder.
endif
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 18:24:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement-not-working/m-p/3659364#M881457</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2008-04-04T18:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement-not-working/m-p/3659365#M881458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks but that code doesn't work.  The reason is because it comes back with sy-subrc = 0 because there is a record in the table but zprodorder-aufnr is initial.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Davis&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I may just end up doing a delete then an insert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Davis on Apr 4, 2008 2:33 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 18:32:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement-not-working/m-p/3659365#M881458</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T18:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement-not-working/m-p/3659366#M881459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ended up doing a delete then an insert.  I assume I couldn't modify because the field zprodorder-aufnr was in the initial state.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 20:34:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement-not-working/m-p/3659366#M881459</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T20:34:25Z</dc:date>
    </item>
  </channel>
</rss>

