<?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 Unique values into an internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/unique-values-into-an-internal-table/m-p/2949604#M695487</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SDN,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to fetch just one field from a table into an internal table except that I only need unique values, not every occurance in the source table. So if the table has 100 records but the field has only four unique values, internal table would have only four records/rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help with declarations and Select code snippet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Saf.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Oct 2007 15:06:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-24T15:06:16Z</dc:date>
    <item>
      <title>Unique values into an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unique-values-into-an-internal-table/m-p/2949604#M695487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SDN,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to fetch just one field from a table into an internal table except that I only need unique values, not every occurance in the source table. So if the table has 100 records but the field has only four unique values, internal table would have only four records/rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help with declarations and Select code snippet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Saf.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2007 15:06:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unique-values-into-an-internal-table/m-p/2949604#M695487</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-24T15:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Unique values into an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unique-values-into-an-internal-table/m-p/2949605#M695488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Use distinct in select&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: wa   TYPE spfli, 
      ftab TYPE TABLE OF STRING. 

APPEND 'CITYFROM' TO ftab. 
APPEND 'CITYTO'   TO ftab. 

SELECT DISTINCT (ftab) 
       FROM spfli 
       INTO CORRESPONDING FIELDS OF wa 
       WHERE 
         carrid   = 'LH'. 
  WRITE: / wa-cityfrom, wa-cityto. 
ENDSELECT. 


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2007 15:17:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unique-values-into-an-internal-table/m-p/2949605#M695488</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-10-24T15:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Unique values into an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unique-values-into-an-internal-table/m-p/2949606#M695489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use DISTINCT keyword in the select query .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2007 15:20:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unique-values-into-an-internal-table/m-p/2949606#M695489</guid>
      <dc:creator>SAPAI</dc:creator>
      <dc:date>2007-10-24T15:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Unique values into an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unique-values-into-an-internal-table/m-p/2949607#M695490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. Here is my problem with distinct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_entity occurs 0,&lt;/P&gt;&lt;P&gt;  entity like /bic/pzk_entity-/bic/zk_entity,&lt;/P&gt;&lt;P&gt;     end of i_entity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following code generates a syntex error saying that /bic/zk_entity is unknown column and cannot determine this until run time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select distinct(/bic/zk_entity)&lt;/P&gt;&lt;P&gt;    from /bic/azpd_o6100&lt;/P&gt;&lt;P&gt;    into corresponding fields of table i_entity&lt;/P&gt;&lt;P&gt;       where /bic/ztimeper in r_period.&lt;/P&gt;&lt;P&gt;  endselect.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2007 15:38:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unique-values-into-an-internal-table/m-p/2949607#M695490</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-24T15:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Unique values into an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unique-values-into-an-internal-table/m-p/2949608#M695491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change select distinct(/bic/zk_entity) to&lt;/P&gt;&lt;P&gt;select distinct /bic/zk_entity&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ashish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2007 15:40:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unique-values-into-an-internal-table/m-p/2949608#M695491</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-24T15:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Unique values into an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unique-values-into-an-internal-table/m-p/2949609#M695492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change select distinct(/bic/zk_entity) to&lt;/P&gt;&lt;P&gt;select distinct /bic/zk_entity&lt;/P&gt;&lt;P&gt;from /bic/azpd_o6100&lt;/P&gt;&lt;P&gt;into corresponding fields of table i_entity&lt;/P&gt;&lt;P&gt;where /bic/ztimeper in r_period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also as you are doing into table, you do not need ENDSELECT.&lt;/P&gt;&lt;P&gt;This should help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ashish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2007 15:41:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unique-values-into-an-internal-table/m-p/2949609#M695492</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-24T15:41:18Z</dc:date>
    </item>
  </channel>
</rss>

