<?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 doubt in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-doubt/m-p/974945#M70615</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi RaviKumar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can u send that code ..if u have time plz .&lt;/P&gt;&lt;P&gt;i want detailed info.&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Oct 2005 07:14:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-10-04T07:14:06Z</dc:date>
    <item>
      <title>sql doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-doubt/m-p/974942#M70612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why we using * infront fo the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE mtart&lt;/P&gt;&lt;P&gt;                       matnr&lt;/P&gt;&lt;P&gt;                       matkl&lt;/P&gt;&lt;P&gt;           INTO  (*mara-mtart,&lt;/P&gt;&lt;P&gt;                  *mara-matnr,&lt;/P&gt;&lt;P&gt;                  *mara-matkl)&lt;/P&gt;&lt;P&gt;           FROM   *mara&lt;/P&gt;&lt;P&gt;           WHERE  matnr = stpo-idnrk.&lt;/P&gt;&lt;P&gt;cheers.&lt;/P&gt;&lt;P&gt;bharadwaj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2005 06:51:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-doubt/m-p/974942#M70612</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-04T06:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: sql doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-doubt/m-p/974943#M70613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If you use * it will select all the fields of the table.&lt;/P&gt;&lt;P&gt;Instead of * we will use Fields so that it will be more efficient in performance wise.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2005 07:06:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-doubt/m-p/974943#M70613</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-04T07:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: sql doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-doubt/m-p/974944#M70614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you don't have to use that. Declare a variable of type MARA and you can dump your values into that. Only SAP uses internally that notation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2005 07:08:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-doubt/m-p/974944#M70614</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-04T07:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: sql doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-doubt/m-p/974945#M70615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi RaviKumar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can u send that code ..if u have time plz .&lt;/P&gt;&lt;P&gt;i want detailed info.&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2005 07:14:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-doubt/m-p/974945#M70615</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-04T07:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: sql doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-doubt/m-p/974946#M70616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tables : MARA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data : wa_mara type MARA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE mtart&lt;/P&gt;&lt;P&gt;matnr&lt;/P&gt;&lt;P&gt;matkl&lt;/P&gt;&lt;P&gt;INTO (wa_mara-mtart,&lt;/P&gt;&lt;P&gt;wa_mara-matnr,&lt;/P&gt;&lt;P&gt;wa_mara-matkl)&lt;/P&gt;&lt;P&gt;FROM mara&lt;/P&gt;&lt;P&gt;WHERE matnr = stpo-idnrk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : Please reward points if this helps you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2005 07:19:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-doubt/m-p/974946#M70616</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-04T07:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: sql doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-doubt/m-p/974947#M70617</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;Please go thru this link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="518177"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sriram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2005 07:22:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-doubt/m-p/974947#M70617</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-04T07:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: sql doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-doubt/m-p/974948#M70618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thnx Ravi ........I sortedout the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I awarded points to u .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chrees&lt;/P&gt;&lt;P&gt;Bharadwaj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2005 07:23:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-doubt/m-p/974948#M70618</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-04T07:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: sql doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-doubt/m-p/974949#M70619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi bharadwaj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;below information may help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining Selections &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SELECT clause defines the structure of the result set (selection) that you want to read from the database. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The selection can be flat (one line) or tabular (several lines). You can specify whether to accept or exclude duplicate entries. The SELECT clause also specifies the names of the columns to be read. You can replace the names of the database fields with alternative names. Aggregate functions can be applied to individual columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SELECT clause can be divided into two parts for lines and columns:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT &amp;lt;lines&amp;gt; &amp;lt;cols&amp;gt; ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;lines&amp;gt; specifies whether you want to read one or more lines. &amp;lt;cols&amp;gt; defines the column selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reading a Single Line&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To read a single entry from the database, use the following: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE &amp;lt;cols&amp;gt; ... WHERE ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To ensure that the line can be uniquely identified, you must specify values for all of the fields of the primary key of the table in the WHERE clause. If the WHERE clause does not contain all of the key fields, the syntax check produces a warning, and the SELECT statement reads the first entry that it finds that matches the key fields that you have specified. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result of the selection is either an elementary field or a flat structure, depending on the number of columns you specified in &amp;lt;cols&amp;gt;. The target area in the INTO clause must be appropriately convertible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the system finds a line with the corresponding key, SY-SUBRC is set to 0, otherwise to 4. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reading Several Lines&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To read a several entries from the database, use the following: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT [DISTINCT] &amp;lt;cols&amp;gt; ... WHERE ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you do not use DISTINCT (&amp;lt;lines&amp;gt; is then empty), the system reads all of the lines that satisfy the WHERE condition. If you use DISTINCT, the system excludes duplicate entries. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result of the selection is a table. The target area of the INTO clause can be an internal table with a line type appropriate for &amp;lt;cols&amp;gt;. If the target area is not an internal table, but a flat structure, you must include an ENDSELECT statement after the SELECT statement: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT [DISTINCT] &amp;lt;cols&amp;gt; ... WHERE ...&lt;/P&gt;&lt;P&gt;  ...&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The lines are read in a loop one by one into the target area specified in the INTO clause You can work with the target area within the loop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If at least one line is read, SY-SUBRC is set to 0 after the statement (or loop) has been processed. If no lines are read, SY-SUBRC is set to 4. The number of lines read is placed in the system field SY-DBCNT. Within the loop, SY-DBCNT already contains the number of lines that have already been passed to the target area. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Technically, it is possible to nest SELECT loops. However, for performance reasons, you should avoid doing so. If you want to read interdependent data from more than one database table, you can use a join in the FROM clause or a subquery in the WHERE clause. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reading the Whole Line&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To read all of the columns in the database table, use the following: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT &amp;lt;lines&amp;gt; * ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This reads all columns for the specified lines. The data type of the selected lines is a structure with exactly the same data type as the database table in the ABAP Dictionary. The target area of the INTO clause should be compatible with, or at least convertible into this data type. In the other clauses, you can only address the columns under their names in the database table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reading individual columns can be considerably more efficient than reading all of the columns in a table. You should therefore only read the columns that you need in your program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reading Single Columns&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;To read single columns from the database table, use the following: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT &amp;lt;lines&amp;gt; &amp;lt;s1&amp;gt; [AS &amp;lt;a 1&amp;gt;] &amp;lt;s 2&amp;gt; [AS &amp;lt;a 2&amp;gt;] ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where &amp;lt;s i &amp;gt; are single columns. There are different ways of addressing the columns, depending on the form of your FROM clause&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example using &amp;lt;b&amp;gt;*&amp;lt;/b&amp;gt; in select statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reading all columns of more than one line: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA WA TYPE SPFLI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT &amp;lt;b&amp;gt;*&amp;lt;/b&amp;gt;INTO   CORRESPONDING FIELDS OF WA&lt;/P&gt;&lt;P&gt;FROM   SPFLI&lt;/P&gt;&lt;P&gt;WHERE  CARRID EQ 'LH'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WRITE: / SY-DBCNT, &lt;/P&gt;&lt;P&gt;           WA-CARRID, WA-CONNID, WA-CITYFROM, WA-CITYTO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points for helpfull answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;venu.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2005 07:30:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-doubt/m-p/974949#M70619</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-04T07:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: sql doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-doubt/m-p/974950#M70620</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;Just to add on to what Ravi has posted, you need not even declare the explicit work area WA_MARA. TABLES statement creates an implicit work area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE mtart matnr matkl&lt;/P&gt;&lt;P&gt;         FROM mara&lt;/P&gt;&lt;P&gt;         INTO (mara-mtart, mara-matnr, mara-matkl)&lt;/P&gt;&lt;P&gt;        WHERE matnr EQ variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, in OO ABAP world it is not reccomended to use implicit work area. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/Sagar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Sagar Acharya&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2005 10:33:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-doubt/m-p/974950#M70620</guid>
      <dc:creator>sagar-acharya</dc:creator>
      <dc:date>2005-10-04T10:33:00Z</dc:date>
    </item>
  </channel>
</rss>

