<?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: read table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/2008814#M409771</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;DEFINE-&amp;gt;&lt;/P&gt;&lt;P&gt;If you want to reuse the same set of statements more than once in a program, you can include them in a macro. For example, this can be useful for long calculations or complex WRITE statements. You can only use a macro within the program in which it is defined, and it can only be called in lines of the program following its definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following statement block defines a macro macro:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINE makro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   statements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You must specify complete statements between DEFINE and END&amp;amp;#8209;OF&amp;amp;#8209;DEFINITION. These statements can contain up to nine placeholders &amp;amp;1, &amp;amp;2,...., &amp;amp;9). You must define the macro before the point in the program at which you want to use it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE-&amp;gt;&lt;/P&gt;&lt;P&gt;To read a single line of any table, use the statement: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE &amp;lt;itab&amp;gt; &amp;lt;key&amp;gt; &amp;lt;result&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the statement to be valid for any kind of table, you must specify the entry using the key and not the index. You specify the key in the &amp;lt;key&amp;gt; part of the statement. The &amp;lt;result&amp;gt; part can specify a further processing option for the line that is retrieved. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the system finds an entry, it sets SY-SUBRC to zero, if not, it takes the value 4, as long as it is not influenced by one of the possible additions. If the internal table is an index table, SY-TABIX is set to the index of the line retrieved. If the table has a non-unique key and there are duplicate entries, the first entry is read. &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>Tue, 27 Mar 2007 07:21:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-27T07:21:40Z</dc:date>
    <item>
      <title>read table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/2008809#M409766</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;could u pls help me to know the functionality of the following lines?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DEFINE list_poitm_amnt&amp;gt;.&lt;/P&gt;&lt;P&gt;  read table &amp;amp;1 with key &amp;amp;2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2007 07:04:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/2008809#M409766</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-27T07:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: read table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/2008810#M409767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;  This is definition of  a macro.If you want to reuse the same set of statements more than once in a program, you can include them in a macro. For example, this can be useful for long calculations or complex WRITE statements. You can only use a macro within the program in which it is defined, and it can only be called in lines of the program following its definition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following statement block defines a macro &amp;lt;macro&amp;gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINE &amp;lt;macro&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   &amp;lt;statements&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You must specify complete statements between DEFINE and END-OF-DEFINITION. These statements can contain up to nine placeholders (&amp;amp;1, &amp;amp;2, ..., &amp;amp;9). You must define the macro before the point in the program at which you want to use it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To use a macro, use the following form: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;macro&amp;gt; [&amp;lt;p1&amp;gt; &amp;lt;p2&amp;gt; ... &amp;lt;p9&amp;gt;].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the program is generated, the system replaces &amp;lt;macro&amp;gt; by the defined statements and each placeholder &amp;amp;i by the parameter &amp;lt;p i &amp;gt;. You can use macros within macros.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;null&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2007 07:07:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/2008810#M409767</guid>
      <dc:creator>former_member673464</dc:creator>
      <dc:date>2007-03-27T07:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: read table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/2008811#M409768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;see this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE itab &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax &lt;/P&gt;&lt;P&gt;READ TABLE itab { table_key &lt;/P&gt;&lt;P&gt;                | free_key &lt;/P&gt;&lt;P&gt;                | index } result. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This statement reads a row from internal table itab. You have to specify the row by either naming values table_key for the table key, a free condition free_key or an index index. The latter choice is possible only for index tables. The output result result determines when and where the row contents are read. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the row to be read is not uniquely specified, the first suitable row is read. In the case of index tables, this row has the lowest table index of all matching rows. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;System Fields &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The statement READ TABLE sets system fields sy-subrc and sy-tabix. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sy-subrc Relevance &lt;/P&gt;&lt;P&gt;0 Row found. sy-tabix is set to the table index of the entry for index tables, and to the value 0 for hashed-tables. &lt;/P&gt;&lt;P&gt;2 Like sy-subrc equals 0. Differentiates cases that use the addition COMPARING in result. &lt;/P&gt;&lt;P&gt;4 Row not found. For sorted tables and when the BINARY SEARCH in free_key addition is used, sy-tabix is set to the table index of the entry before it was inserted with INSERT. Otherwise, sy-tabix is not defined. &lt;/P&gt;&lt;P&gt;8 Like sy-subrc equals 4. For sorted tables, however, and when the addition BINARY SEARCH is used, the end of the table was reached, and sy-tabix is set to the number of rows + 1. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The system fields sy-tfill and sy-tleng are also supplied with data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;Besides the alternatives shown above for specifying the row to be read, there is another obsolete key specification obsolete_key possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        sunil kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2007 07:10:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/2008811#M409768</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-27T07:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: read table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/2008812#M409769</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;that is a macro where &amp;amp;1 refers a table name and &amp;amp;2 refers a key in that intenal table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see...the calling stmt. may be...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;list_poitm_amnt itab f1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2007 07:11:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/2008812#M409769</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-27T07:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: read table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/2008813#M409770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raja,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look at the below SAP Link, you will understand about the Macros, These &amp;amp;1 ... are Place holders of macros, you can define upto 9 , and these will have the values, when you write the Read statment, then it will read from the valuw which &amp;amp;1 will have at that time&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db972835c111d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db972835c111d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2007 07:12:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/2008813#M409770</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-27T07:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: read table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/2008814#M409771</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;DEFINE-&amp;gt;&lt;/P&gt;&lt;P&gt;If you want to reuse the same set of statements more than once in a program, you can include them in a macro. For example, this can be useful for long calculations or complex WRITE statements. You can only use a macro within the program in which it is defined, and it can only be called in lines of the program following its definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following statement block defines a macro macro:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINE makro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   statements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You must specify complete statements between DEFINE and END&amp;amp;#8209;OF&amp;amp;#8209;DEFINITION. These statements can contain up to nine placeholders &amp;amp;1, &amp;amp;2,...., &amp;amp;9). You must define the macro before the point in the program at which you want to use it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE-&amp;gt;&lt;/P&gt;&lt;P&gt;To read a single line of any table, use the statement: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE &amp;lt;itab&amp;gt; &amp;lt;key&amp;gt; &amp;lt;result&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the statement to be valid for any kind of table, you must specify the entry using the key and not the index. You specify the key in the &amp;lt;key&amp;gt; part of the statement. The &amp;lt;result&amp;gt; part can specify a further processing option for the line that is retrieved. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the system finds an entry, it sets SY-SUBRC to zero, if not, it takes the value 4, as long as it is not influenced by one of the possible additions. If the internal table is an index table, SY-TABIX is set to the index of the line retrieved. If the table has a non-unique key and there are duplicate entries, the first entry is read. &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>Tue, 27 Mar 2007 07:21:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/2008814#M409771</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-27T07:21:40Z</dc:date>
    </item>
  </channel>
</rss>

