<?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: select from internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958750#M66911</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;with internal tables you can use only &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab (from) (at)(where)&lt;/P&gt;&lt;P&gt;endloop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab with index n.&lt;/P&gt;&lt;P&gt;read table itab with key &amp;lt;condition one&amp;gt; &amp;lt;condition two&amp;gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;describe ........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Aug 2005 09:17:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-08-11T09:17:13Z</dc:date>
    <item>
      <title>select from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958744#M66905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am a beginner in ABAP and I have a question for you:&lt;/P&gt;&lt;P&gt;I have selected some data into an internal table (ex: IT_MAT ). Now I need to select again the data from IT_MAT to make some calculations, but I get the error &lt;/P&gt;&lt;P&gt;"IT_MAT" is not defined in the ABAP Dictionary as a table, projection view or database view.  &lt;/P&gt;&lt;P&gt;What can I do to run a select like Select * from IT_MAT &amp;#133;. ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2005 08:50:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958744#M66905</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-11T08:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: select from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958745#M66906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;please post whatever coding you have done&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2005 08:51:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958745#M66906</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-11T08:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: select from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958746#M66907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;report  Z_STOC_0_RAION no standard page heading line-size 92   .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of IT_ARTICOLE occurs 128 ,&lt;/P&gt;&lt;P&gt;MATNR like MARA-MATNR,&lt;/P&gt;&lt;P&gt;MAKTX like MAKT-MAKTX,&lt;/P&gt;&lt;P&gt;EKGRP like MARC-EKGRP,&lt;/P&gt;&lt;P&gt;EKNAM like T024-EKNAM,&lt;/P&gt;&lt;P&gt;WERKS like MARD-WERKS,&lt;/P&gt;&lt;P&gt;LABST like MARD-LABST,&lt;/P&gt;&lt;P&gt;MSTAE like MARA-MSTAE,&lt;/P&gt;&lt;P&gt;LVORM like MARA-LVORM,&lt;/P&gt;&lt;P&gt;LIFNR like EINA-LIFNR,&lt;/P&gt;&lt;P&gt;SPERQ like LFA1-SPERQ,&lt;/P&gt;&lt;P&gt;end of IT_ARTICOLE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: N type I .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen begin of block MATNR with frame title text-111.&lt;/P&gt;&lt;P&gt;select-options MATERIAL for IT_ARTICOLE-MATNR obligatory.&lt;/P&gt;&lt;P&gt;selection-screen end of block MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select distinct&lt;/P&gt;&lt;P&gt;A~MATNR&lt;/P&gt;&lt;P&gt;B~MAKTX&lt;/P&gt;&lt;P&gt;C~WERKS&lt;/P&gt;&lt;P&gt;C~LABST&lt;/P&gt;&lt;P&gt;A~MSTAE&lt;/P&gt;&lt;P&gt;G~EKGRP&lt;/P&gt;&lt;P&gt;H~EKNAM&lt;/P&gt;&lt;P&gt;into corresponding fields&lt;/P&gt;&lt;P&gt; of table IT_ARTICOLE from MARA as A&lt;/P&gt;&lt;P&gt;   join MAKT as B on A&lt;SUB&gt;MATNR = B&lt;/SUB&gt;MATNR&lt;/P&gt;&lt;P&gt;    join MARD as C on A&lt;SUB&gt;MATNR = C&lt;/SUB&gt;MATNR&lt;/P&gt;&lt;P&gt;       join MARD as D on A&lt;SUB&gt;MATNR = D&lt;/SUB&gt;MATNR&lt;/P&gt;&lt;P&gt;         join EINA as E on A&lt;SUB&gt;MATNR = E&lt;/SUB&gt;MATNR&lt;/P&gt;&lt;P&gt;           join LFA1 as F on E&lt;SUB&gt;LIFNR = F&lt;/SUB&gt;LIFNR&lt;/P&gt;&lt;P&gt;             join MARC as G on A&lt;SUB&gt;MATNR = G&lt;/SUB&gt;MATNR and G~WERKS = 'HY01'&lt;/P&gt;&lt;P&gt;               join T024 as H on G&lt;SUB&gt;EKGRP = H&lt;/SUB&gt;EKNAM&lt;/P&gt;&lt;P&gt;           where A~MATNR in MATERIAL&lt;/P&gt;&lt;P&gt;           and A~MSTAE not in ('01','02','03')&lt;/P&gt;&lt;P&gt;           and c~werks = 'HY01'&lt;/P&gt;&lt;P&gt;           and C~LABST = 0&lt;/P&gt;&lt;P&gt;           and A~LVORM &amp;lt;&amp;gt; 'X'&lt;/P&gt;&lt;P&gt;           and f~sperq not in ('01','02','03')&lt;/P&gt;&lt;P&gt;           and f~sperm &amp;lt;&amp;gt; 'X' .&lt;/P&gt;&lt;P&gt;           &lt;/P&gt;&lt;P&gt;select count(*) from IT_ARTICOLE group by it_articole-EKGRP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2005 08:55:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958746#M66907</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-11T08:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: select from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958747#M66908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Select query from internal table is not possible.It is for abap Dictionary only.&lt;/P&gt;&lt;P&gt;Use abap statement Read table &amp;lt;internal table&amp;gt; with key...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds&lt;/P&gt;&lt;P&gt;gv&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2005 08:56:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958747#M66908</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-11T08:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: select from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958748#M66909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for select count(*) from IT_ARTICOLE group by it_articole-EKGRP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use abap statement describe table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;gv&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2005 08:57:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958748#M66909</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-11T08:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: select from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958749#M66910</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;You can use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;data : itab type standard table of it_articole,&lt;/P&gt;&lt;P&gt;       ln type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab[] = it_articole[].&lt;/P&gt;&lt;P&gt;sort itab by ekgrp.&lt;/P&gt;&lt;P&gt;delete adjacent duplicates from itab comparing ekgrp.&lt;/P&gt;&lt;P&gt;describe table itab lines ln.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instead of the line&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select count(*) from IT_ARTICOLE group by it_articole-EKGRP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because in ABAP, you cannot use select statements in internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to get data from internal table,you can use &amp;lt;b&amp;gt;read or loop&amp;lt;/b&amp;gt; statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly reward points if it is useful.If you need clarifications,get back.&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>Thu, 11 Aug 2005 09:14:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958749#M66910</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2005-08-11T09:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: select from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958750#M66911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;with internal tables you can use only &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab (from) (at)(where)&lt;/P&gt;&lt;P&gt;endloop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab with index n.&lt;/P&gt;&lt;P&gt;read table itab with key &amp;lt;condition one&amp;gt; &amp;lt;condition two&amp;gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;describe ........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2005 09:17:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958750#M66911</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-11T09:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: select from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958751#M66912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you just want to know the number of records in your i table, you can use the following statment :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : w_nb_line type i.
...
Describe table i_tab lines w_nb_line.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erwan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2005 09:24:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958751#M66912</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-11T09:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: select from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958752#M66913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you want to learn more about loop.. enloop, read..., describe... just take the cursor to that keyword and press F1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and if you want to learn how data flows, use debugging.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2005 09:27:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958752#M66913</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-11T09:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: select from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958753#M66914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your answers !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please tell me how can I know when I am on the last line of an internal table in a loop ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2005 10:12:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958753#M66914</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-11T10:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: select from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958754#M66915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Within a loop use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at last.&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT LAST. &lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Executes the relevant series of statements just once - either on the first loop pass (with AT FIRST) or on the last loop pass (with AT LAST). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Svetlin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Svetlin Rusev&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2005 10:17:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958754#M66915</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-11T10:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: select from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958755#M66916</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;After describing the table as I told in my previous reply,you will have the count in the variable ln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;if sy-tabix = ln.&lt;/P&gt;&lt;P&gt;...this is the last line.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the sample.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data itab type standard table of mara.&lt;/P&gt;&lt;P&gt;data ln type i.&lt;/P&gt;&lt;P&gt;data w type mara.&lt;/P&gt;&lt;P&gt;select * from mara into table itab.&lt;/P&gt;&lt;P&gt;describe table itab lines ln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into w.&lt;/P&gt;&lt;P&gt;if sy-tabix = ln.&lt;/P&gt;&lt;P&gt;write ln.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward points by clciking the star on the left side of the reply for useful answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Jayanthi Jayaraman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2005 10:19:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-internal-table/m-p/958755#M66916</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2005-08-11T10:19:50Z</dc:date>
    </item>
  </channel>
</rss>

