<?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: internal table? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/2552514#M581406</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;For this, you would need to create a second internal table, to contain the data that fulfill your requeriments, or you could delete from the internal table all the entries that does not fulfill the requeriments.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like this (for create another itab):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT itab1 WHERE delkz = 'U1'.
  CLEAR: itab2.
  itab2 = itab1.
  APPEND itab2.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or this (Deleting):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DELETE itab1 WHERE delkz &amp;lt;&amp;gt; 'U1'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, you can select the data you need, either from the itab2 or, if you choose to delete from the original internal table, the itab1, like as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT * FROM dbtab FOR ALL ENTRIES IN itab1 (or itab2) WHERE log_exp.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;-h&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Jul 2007 11:23:45 GMT</pubDate>
    <dc:creator>hermanoclaro</dc:creator>
    <dc:date>2007-07-19T11:23:45Z</dc:date>
    <item>
      <title>internal table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/2552507#M581399</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;&lt;/P&gt;&lt;P&gt;I have an internal table with field DELKZ...and it contains values WB,U1,SP,KD...etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF itab-delkz = 'U1'.&lt;/P&gt;&lt;P&gt;i need to get data from a database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is i dont want to write the SELECT statement in LOOP?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz advise me regarding this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards.&lt;/P&gt;&lt;P&gt;kr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2007 10:53:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/2552507#M581399</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T10:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: internal table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/2552508#M581400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Select * from table into t_itab&lt;/P&gt;&lt;P&gt;for all entries in itab&lt;/P&gt;&lt;P&gt;where  DELKZ = 'U1'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2007 10:55:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/2552508#M581400</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T10:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: internal table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/2552509#M581401</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;&amp;lt;b&amp;gt;select * from ztable into itab2 for all entries in itab where delkz = 'U1'.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;ravish&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;plz dont forget to reward points if helpful&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2007 10:56:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/2552509#M581401</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T10:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: internal table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/2552510#M581402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;loop at itab where delkz = 'U1'.
itab2 = itab.
append itab2.
clear itab2.
endloop.

if not itab2[] is initial.
select * from &amp;lt;database table&amp;gt; into table itab_new
  for all entries in itab2
where &amp;lt;condition&amp;gt;.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2007 10:56:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/2552510#M581402</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T10:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: internal table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/2552511#M581403</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 the for all entries to avoid looping,&lt;/P&gt;&lt;P&gt;Please look the example code below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward all helpfull answers.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select SERVICEPO from ymminward into table it_std_SERVICEPO
                                where gedocno = wrk_gedocno.

sort it_std_servicepo by servicepo.
delete adjacent duplicates from it_std_servicepo.


*Getting the vendor to be supplied
if it_std_servicepo is not initial.
select emlif from ekpo into table it_std_emlif
                       for all entries in it_std_servicepo
                       where ebeln = it_std_servicepo-servicepo.

sort it_std_emlif by emlif.
delete adjacent duplicates from it_std_emlif.
endif.


*Getting the addressnumber
if it_std_emlif is not initial.
select adrnr from lfa1 into table it_std_adrnr
                       for all entries in it_std_emlif
                       where lifnr = it_std_emlif-emlif.

sort it_std_adrnr by adrnr.
delete adjacent duplicates from it_std_adrnr.
endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;rakesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2007 10:57:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/2552511#M581403</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T10:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: internal table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/2552512#M581404</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;If only one entry existing in the internal table then..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read the data into workarea where delkz = 'U1'.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;select.......&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if multiple entries are existing in itab then..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append lines of itab into itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete itab2 where delkz ne UI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if itab2[] is not initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select .....for all entries in itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if it helps..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Omkar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2007 10:58:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/2552512#M581404</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T10:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: internal table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/2552513#M581405</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 way to skip loop statement is only to use,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM &amp;lt;DATABASE TABLENAME&amp;gt; INTO CORRESPONDING FIELDS OF TABLE &amp;lt;UR TABLENAME&amp;gt; WHERE DELKZ = 'U1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But its better to use loop statement for better performance of program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls reward points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ameet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2007 11:03:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/2552513#M581405</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T11:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: internal table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/2552514#M581406</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;For this, you would need to create a second internal table, to contain the data that fulfill your requeriments, or you could delete from the internal table all the entries that does not fulfill the requeriments.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like this (for create another itab):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT itab1 WHERE delkz = 'U1'.
  CLEAR: itab2.
  itab2 = itab1.
  APPEND itab2.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or this (Deleting):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DELETE itab1 WHERE delkz &amp;lt;&amp;gt; 'U1'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, you can select the data you need, either from the itab2 or, if you choose to delete from the original internal table, the itab1, like as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT * FROM dbtab FOR ALL ENTRIES IN itab1 (or itab2) WHERE log_exp.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;-h&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2007 11:23:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/2552514#M581406</guid>
      <dc:creator>hermanoclaro</dc:creator>
      <dc:date>2007-07-19T11:23:45Z</dc:date>
    </item>
  </channel>
</rss>

