<?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 SQL in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-sql/m-p/3627528#M873921</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to update work area (wa) &lt;/P&gt;&lt;P&gt;fields (p1, p2) &lt;/P&gt;&lt;P&gt;with f1,f2 from table t1&lt;/P&gt;&lt;P&gt;where wa.id = t1.id&lt;/P&gt;&lt;P&gt;looping through the wa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whats the syntax?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot loop through the work area. Work area is a structure.&lt;/P&gt;&lt;P&gt;well, in your case, you can either loop through the internal table t1 or you can read the internal table t1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syntax&lt;/P&gt;&lt;P&gt;1) &lt;/P&gt;&lt;P&gt;read table t1 into w1 with key id = wa-id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;   wa-p1 = w1-f1.&lt;/P&gt;&lt;P&gt;   wa-p2 = w1-f2.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or you can loop through the internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t1 where id = wa-id.&lt;/P&gt;&lt;P&gt;   wa-p1 = t1-f1.&lt;/P&gt;&lt;P&gt;   wa-p2 = t1-f2.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Apr 2008 19:09:16 GMT</pubDate>
    <dc:creator>former_member191735</dc:creator>
    <dc:date>2008-04-18T19:09:16Z</dc:date>
    <item>
      <title>update SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-sql/m-p/3627527#M873920</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 want to update work area (wa) &lt;/P&gt;&lt;P&gt;fields (p1, p2) &lt;/P&gt;&lt;P&gt;with f1,f2 from table t1&lt;/P&gt;&lt;P&gt;where wa.id = t1.id&lt;/P&gt;&lt;P&gt;looping through the wa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whats the syntax?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Apr 2008 18:17:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-sql/m-p/3627527#M873920</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-18T18:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: update SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-sql/m-p/3627528#M873921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to update work area (wa) &lt;/P&gt;&lt;P&gt;fields (p1, p2) &lt;/P&gt;&lt;P&gt;with f1,f2 from table t1&lt;/P&gt;&lt;P&gt;where wa.id = t1.id&lt;/P&gt;&lt;P&gt;looping through the wa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whats the syntax?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot loop through the work area. Work area is a structure.&lt;/P&gt;&lt;P&gt;well, in your case, you can either loop through the internal table t1 or you can read the internal table t1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syntax&lt;/P&gt;&lt;P&gt;1) &lt;/P&gt;&lt;P&gt;read table t1 into w1 with key id = wa-id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;   wa-p1 = w1-f1.&lt;/P&gt;&lt;P&gt;   wa-p2 = w1-f2.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or you can loop through the internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t1 where id = wa-id.&lt;/P&gt;&lt;P&gt;   wa-p1 = t1-f1.&lt;/P&gt;&lt;P&gt;   wa-p2 = t1-f2.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Apr 2008 19:09:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-sql/m-p/3627528#M873921</guid>
      <dc:creator>former_member191735</dc:creator>
      <dc:date>2008-04-18T19:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: update SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-sql/m-p/3627529#M873922</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;if u want to update &lt;STRONG&gt;work area&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u can simply pass the data like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa is work area with two fields p1 and p2&lt;/P&gt;&lt;P&gt;l1 is the table with header line with two field f1 and f2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;read table l1 with key id = wa-id.
wa-p1 = l1-f1.
wa-p2 = l1-f2.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here loop is not used because u r filling data into work area.&lt;/P&gt;&lt;P&gt;so work area can contain only one record at a given point of time &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if helpful&lt;/P&gt;&lt;P&gt;raam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Apr 2008 19:40:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-sql/m-p/3627529#M873922</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-18T19:40:56Z</dc:date>
    </item>
  </channel>
</rss>

