<?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: abt workarea in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854933#M361622</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi vinay&lt;/P&gt;&lt;P&gt;   can u please be more specific that why is it using a workarea  r internal table is a best practice...what ever modifications we r doing we r doing to the database only either it is thru workarea r direct.sorry for bothering u all..this question is bothering me soo much...not able to move any forward&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards&lt;/P&gt;&lt;P&gt;popi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Jan 2007 19:44:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-18T19:44:19Z</dc:date>
    <item>
      <title>abt workarea</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854925#M361614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;   Why do we need to declare a workarea to do any database related operations.can we not get records directly from database instead of creating a workarea or internaltable...what makes difference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jan 2007 19:12:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854925#M361614</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-18T19:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: abt workarea</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854926#M361615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can read from the database in a few ways, the first way is with a SELECT...ENDSELECT, this is not the best way as it is a round trip for each record,  here you must define a work area to read the data into, even if you use a TABLES statement for the table name, it is still a work area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;tables: mara.

select * from mara.

endselect.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you can use a work area defined by a DATA statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Data: xmara type mara.

select * from mara into xmara.

endselect.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or a single select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: xmara type mara.

Select Single * into xmara from mara
           where matnr = p_matnr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The most efficient way for multplie records is an arry fetch here, you can specify an internal table .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: imara type table of mara with header line.

select * into table imara from mara
                   up to 100 rows.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in the OO context,  header lines(which are like implicit work areas) are not allowed, so you need a work area to read the data from the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: imara type table of mara .
data: xmara like line of imara.

select * into table imara from mara
                   up to 100 rows.


loop at imara into xmara.
   write:/ xmara-matnr, xmara-mtart.
endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jan 2007 19:18:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854926#M361615</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-01-18T19:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: abt workarea</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854927#M361616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Popi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We can also do database related operations without creating work area too. But it is a good practise to have work areas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generally we will get data into internal tables from database. For LDBs(Logical databases ) you doesnt require internal tables or work areas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jan 2007 19:21:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854927#M361616</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-18T19:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: abt workarea</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854928#M361617</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;The reason you need to use work area or internal table if you want to manipulate/ modify the data otherwise you can read directly from database. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jan 2007 19:22:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854928#M361617</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-18T19:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: abt workarea</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854929#M361618</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;Using a Work Area or Internal Tables is a best practice. Using TABLES Statements &amp;amp; then not mentioning anythin in the INTO is an obsolete way. Also, TABLES reserves some space in the memory before the data is fetched.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if the answer is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mukul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jan 2007 19:33:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854929#M361618</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-18T19:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: abt workarea</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854930#M361619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;  Can we not modify directly in the database?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards&lt;/P&gt;&lt;P&gt;popi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jan 2007 19:33:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854930#M361619</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-18T19:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: abt workarea</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854931#M361620</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;We can directly modify database content using MODIFY statement but updating database tables directly is not a good practise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this link for MODIFY statement&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/modify_d.htm" target="test_blank"&gt;http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/modify_d.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Better to Update them through transactions or BDCs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jan 2007 19:36:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854931#M361620</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-18T19:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: abt workarea</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854932#M361621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you can modify the database directly, but again, using the TABLES statement is like declaring a workarea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;tables: ZTEST.

Select * from ztest.
    ztest-fld1 = 'X'.
    modif ztest.
endselect.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All other methods of update the DB, use a work area or internal table of some kind.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jan 2007 19:38:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854932#M361621</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-01-18T19:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: abt workarea</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854933#M361622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi vinay&lt;/P&gt;&lt;P&gt;   can u please be more specific that why is it using a workarea  r internal table is a best practice...what ever modifications we r doing we r doing to the database only either it is thru workarea r direct.sorry for bothering u all..this question is bothering me soo much...not able to move any forward&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards&lt;/P&gt;&lt;P&gt;popi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jan 2007 19:44:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854933#M361622</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-18T19:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: abt workarea</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854934#M361623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I dopn't think you need either a work area or a tables statement. For example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT ztest.

UPDATE ztest
  SET   f1 = space
  WHERE f2 = 'X'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not recommending doing it this way, just saying that syntactically, it's correct and will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Rob Burbank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jan 2007 19:56:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854934#M361623</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-18T19:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: abt workarea</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854935#M361624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rob,  yes you are right about the UPDATE statement,  I personally have never used this statement in a productive program.(Which is why I might have misspoke)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jan 2007 19:57:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854935#M361624</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-01-18T19:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: abt workarea</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854936#M361625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I recall seeing this in an SAP note some time ago. It was just a quick database ZAP, but I was a bit surprised that they would use it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(It was note 301795. We had to implement it after upgrading to 4.6C)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Rob Burbank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jan 2007 20:06:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abt-workarea/m-p/1854936#M361625</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-18T20:06:19Z</dc:date>
    </item>
  </channel>
</rss>

