<?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: sql query... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query/m-p/1834588#M355352</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;not sure abt ur exact requirement but update query shud be liek this - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;update zsodate set field 1 = '1' field2 = '2' where field3 = 'abc'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but better to use Modify statement as it will serve both the purpose create and update..&lt;/P&gt;&lt;P&gt;so press F1 on modify and use it..&lt;/P&gt;&lt;P&gt;amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Jan 2007 12:05:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-11T12:05:55Z</dc:date>
    <item>
      <title>sql query...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query/m-p/1834587#M355351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt; I have 2 database tables . one is vbep and the other one is zsodate. values will be changed in vbep . when we add a new records in vbep it will also adds the rows in zsodate. but our requirement is if one value is changed in vbep we have to updated the values in zsodate table by wrting the sql query by comparing the fields in vbeln and posnr .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;give me update query how to find the exact row in zsodate and replace the value...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my code is this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report z_test1 message-id xx .                                                                                &lt;/P&gt;&lt;P&gt;tables : zsodate, vbap , vbep .                                         &lt;/P&gt;&lt;P&gt;data : itab type standard table of zsodate with header line.            &lt;/P&gt;&lt;P&gt;data : jtab type standard table of vbep with header line.               &lt;/P&gt;&lt;P&gt;select-options : ordno for vbap-vbeln no intervals no-extension ,       &lt;/P&gt;&lt;P&gt;                 itemno for vbap-posnr no intervals.                                                                                &lt;/P&gt;&lt;P&gt;start-of-selection.                                                                                &lt;/P&gt;&lt;P&gt;select * from zsodate into table itab where vbeln in ordno.             &lt;/P&gt;&lt;P&gt;if sy-dbcnt = 0 .                                                       &lt;/P&gt;&lt;P&gt;  message s999 with 'You Entered Wrong Order No ' .                     &lt;/P&gt;&lt;P&gt;  exit.                                                                 &lt;/P&gt;&lt;P&gt;  endif.                                                                                &lt;/P&gt;&lt;P&gt;select * from vbep into corresponding fields of table jtab              &lt;/P&gt;&lt;P&gt;       where vbeln in ordno.                                            &lt;/P&gt;&lt;P&gt;loop at jtab.                                                           &lt;/P&gt;&lt;P&gt; write &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; jtab-vbeln,                                                   &lt;/P&gt;&lt;P&gt;          jtab-edatu,                                                   &lt;/P&gt;&lt;P&gt;          jtab-posnr.                                                   &lt;/P&gt;&lt;P&gt; select * from zsodate into corresponding fields of zsodate             &lt;/P&gt;&lt;P&gt;    where vbeln = jtab-vbeln and posnr = jtab-posnr.                    &lt;/P&gt;&lt;P&gt;    where vbeln = jtab-vbeln and posnr = jtab-posnr.                     &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   loop at itab where vbeln = jtab-vbeln and posnr = jtab-posnr.                                                                                &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if sy-subrc = 0.                                                       &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;write / 'vbep entries '.                                               &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*write :/4 jtab-etenr , 'vbep etenr',                                    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       15 jtab-edatu , 'vbep edatu'.                                   &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       uline.                                                          &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*write:/2 zsodate-vbeln,                                                 &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      13  zsodate-posnr,                                               &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      26  zsodate-etenr,                                               &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      45 'has been updated'.                                           &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; move jtab-etenr to zsodate-etenr.                                       &lt;/P&gt;&lt;P&gt; write jtab-edatu to zsodate-origdate mm/dd/yyyy.                        &lt;/P&gt;&lt;P&gt;zsodate-mandt = sy-mandt.                                                &lt;/P&gt;&lt;P&gt; zsodate-uname = sy-uname.                                               &lt;/P&gt;&lt;P&gt;modify zsodate.                                                                                &lt;/P&gt;&lt;P&gt;write:/2 zsodate-vbeln,                                                  &lt;/P&gt;&lt;P&gt;       13  zsodate-posnr,                                                &lt;/P&gt;&lt;P&gt;       26  zsodate-etenr,                                                &lt;/P&gt;&lt;P&gt;       45 'has been updated.'.                                                                                &lt;/P&gt;&lt;P&gt;endif.                                                                   &lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jan 2007 12:00:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query/m-p/1834587#M355351</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-11T12:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: sql query...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query/m-p/1834588#M355352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;not sure abt ur exact requirement but update query shud be liek this - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;update zsodate set field 1 = '1' field2 = '2' where field3 = 'abc'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but better to use Modify statement as it will serve both the purpose create and update..&lt;/P&gt;&lt;P&gt;so press F1 on modify and use it..&lt;/P&gt;&lt;P&gt;amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jan 2007 12:05:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query/m-p/1834588#M355352</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-11T12:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: sql query...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query/m-p/1834589#M355353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;but it is adding the new line ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;not it is modifying the alreday existing one...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i used modify only...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jan 2007 12:07:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query/m-p/1834589#M355353</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-11T12:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: sql query...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query/m-p/1834590#M355354</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;go through this link,hope might help you to solve your problem&lt;/P&gt;&lt;P&gt;&lt;A href="http://dev.mysql.com/doc/maxdb/en/34/ee7fba293911d3a97d00a0c9449261/content.htm" target="test_blank"&gt;http://dev.mysql.com/doc/maxdb/en/34/ee7fba293911d3a97d00a0c9449261/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://dev.mysql.com/doc/maxdb/en/08/db4940f0030272e10000000a155106/content.htm" target="test_blank"&gt;http://dev.mysql.com/doc/maxdb/en/08/db4940f0030272e10000000a155106/content.htm&lt;/A&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, 11 Jan 2007 12:32:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query/m-p/1834590#M355354</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-11T12:32:09Z</dc:date>
    </item>
  </channel>
</rss>

