<?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: ABAP &amp; DB interactions in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-db-interactions/m-p/961448#M67473</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gerson,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you want to update only one record into the database, it doesn't make any difference whether you use an internal table or a normal structure. That, I think is obvious.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when you need to update 20 entries to a table, all these entries will be sent to the database server in one go. which means that there is only one cycle between the Application Server and the Database Server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you put the UPDATE statement in a LOOP over the internal table, each time a connection will have to be opened (which is called a cursor) and the single record will be sent to the database server. So, there will have to be as many round trips (between the AS and the DS) as there are number of records in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anand Mandalika.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Jul 2005 07:46:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-07-11T07:46:36Z</dc:date>
    <item>
      <title>ABAP &amp; DB interactions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-db-interactions/m-p/961446#M67471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to figure out how the R/3 system works under the hood as far as databases go.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More so on reading the help files i located places where there is mention of multiple line updates being faster than single line updates (i.e. the statement UPDATE statement with or without the use of internal tables. )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is how is this faster and what is the R/3 system doing in either of the cases. &lt;/P&gt;&lt;P&gt;What is it doing to process the updates especially the ones with internal tables being used. &lt;/P&gt;&lt;P&gt;How many network trips would it make to the database in case this internal table has 20 lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If given that the underlying DB is Oracle 8/8i then does Abap use the Collections capablity.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2005 05:55:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-db-interactions/m-p/961446#M67471</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-11T05:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP &amp; DB interactions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-db-interactions/m-p/961447#M67472</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;To know the database retrival,just create two example programs and then compare those in ST05(give trace on-Then activate your program.Then trace off.Then List Trace) and SE30 transaction.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2005 06:28:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-db-interactions/m-p/961447#M67472</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2005-07-11T06:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP &amp; DB interactions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-db-interactions/m-p/961448#M67473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gerson,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you want to update only one record into the database, it doesn't make any difference whether you use an internal table or a normal structure. That, I think is obvious.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when you need to update 20 entries to a table, all these entries will be sent to the database server in one go. which means that there is only one cycle between the Application Server and the Database Server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you put the UPDATE statement in a LOOP over the internal table, each time a connection will have to be opened (which is called a cursor) and the single record will be sent to the database server. So, there will have to be as many round trips (between the AS and the DS) as there are number of records in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anand Mandalika.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2005 07:46:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-db-interactions/m-p/961448#M67473</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-11T07:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP &amp; DB interactions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-db-interactions/m-p/961449#M67474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My question now is how is this then managed at the Database. &lt;/P&gt;&lt;P&gt;How does the sending of 20 records in one go translate into them being updated at the database server?&lt;/P&gt;&lt;P&gt;More specifically i am looking for the low level mechanism in the light of the fact that the AS is DB vendor neutral and my mention of PL/SQL collections prior&lt;/P&gt;&lt;P&gt;was in this context.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The way i understand it &lt;/P&gt;&lt;P&gt;1) The AS would do the 20 record update present in the internal table by itself opening up a cursor with the DB&lt;/P&gt;&lt;P&gt;as against &lt;/P&gt;&lt;P&gt;2) the explicitly coded loop wherein a cursor would be .&lt;/P&gt;&lt;P&gt;opened &amp;amp; closed each time for the 20 records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I welcome corrections to my understanding of the concept.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2005 08:01:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-db-interactions/m-p/961449#M67474</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-11T08:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP &amp; DB interactions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-db-interactions/m-p/961450#M67475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gerson,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are right in stating that the Application Server is independent of the underlying database. But there's one point here that we need to see - The cursor would be opened not just when there's an UPDATE, but also when there's a SELECT. The curson, is actually a channel that exists for data to flow between the AS and the DS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case of an UPDATE from an internal table, the data will all go from as to DS in a single cursor. After the data reaches the database server, how the actual update has happens is something that we need not worry about (but I think it happens in serial). We are only talking about centralized databases here (no distributed databases). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once the data reaches the database server, then the application server need not bother about &amp;lt;i&amp;gt;how&amp;lt;/i&amp;gt; the update is actually going to be handled by the DS. What it only needs to know is whether the operation succeeded or not. For this reason, I'm not sure whether some  particular database(s) is(are) going to handle these updates in a non-serial fashion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in summary, the advantage is that there will be reduced number of network trips and the cursor (which is actually a very important resource on the AS) is utilized optimally.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get back if you have further questions. We can probably discuss more on this if need be.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anand Mandalika.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2005 08:32:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-db-interactions/m-p/961450#M67475</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-11T08:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP &amp; DB interactions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-db-interactions/m-p/961451#M67476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ignore This Reply&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Gerson D'lima&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Gerson D'lima&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2005 04:38:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-db-interactions/m-p/961451#M67476</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-12T04:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP &amp; DB interactions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-db-interactions/m-p/961452#M67477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Anand&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you say data would be transported in a single cursor i would actually like to understand how.&lt;/P&gt;&lt;P&gt;I am curious to know the underlying transport mechanism given that we are using Oracle as the DB.&lt;/P&gt;&lt;P&gt;From the statement you made i understand that this will be transported using pl/sql collections to the DB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other question that comes to my mind is how then can we achieve error reporting for each of the records udpated using the multiple update statements via internal tables.&lt;/P&gt;&lt;P&gt;1) Is this possible ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pardon my references to Oracle all the time becoz this is the DB i am most comfortable with.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2005 05:33:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-db-interactions/m-p/961452#M67477</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-12T05:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP &amp; DB interactions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-db-interactions/m-p/961453#M67478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gerson,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you have rightly pointed out that the App Server is database vendor independent, how the data is physically transferred between the app server and the db server may be implemented somewhat differently for each database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me try further to explain in a database independent way - &lt;/P&gt;&lt;P&gt;When you start up an R/3 System, each application server registers its work processes with the database layer, and receives a dedicated channel for each of them. While the system is running, each work process is a user (client) of the database system (server). You cannot change the work process registration while the system is running. Neither can you reassign a database channel from one work process to another. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The physical connection between the application server and the database server can be TCP/IP based.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And to understand how the system works, you do not need to know about any particular database. You only need to know the concepts of RDBMS. For this reason, I'm unable to confirm whether PL/SQL collections or some other mechanism is used internally.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you do the update via an internal table, it is not possible to know which records have failed and which records were successfully updated. You will only know whether or not all the records were successfully updated and the number of records that have failed, if any.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anand Mandalika.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2005 05:43:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-db-interactions/m-p/961453#M67478</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-12T05:43:34Z</dc:date>
    </item>
  </channel>
</rss>

