<?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: Value list in a select statement !? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/value-list-in-a-select-statement/m-p/898839#M54797</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are doing in a wrong way, it should be this:&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from A004&lt;/P&gt;&lt;P&gt;into corresponding fields of table i_a004Tab&lt;/P&gt;&lt;P&gt;where kappl eq 'V '&lt;/P&gt;&lt;P&gt;and kschl eq 'ZPR1'&lt;/P&gt;&lt;P&gt;and vkorg = '2000' &lt;/P&gt;&lt;P&gt;and vkorg = '3000' .&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you wanna include all the vkorg between 2000 and 3000 the you need to declare a &amp;lt;b&amp;gt;RANGE&amp;lt;/b&amp;gt; Variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;RANGES: r_vkorg FOR A004-vkorg .&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Fill the Range:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt; r_vkorg-sign = 'I'.      "(I) INCLUDE - (E) Exclude&lt;/P&gt;&lt;P&gt; r_vkorg-option = 'BT'. "(BT) Between&lt;/P&gt;&lt;P&gt; r_vkorgt-low = '2000'&lt;/P&gt;&lt;P&gt; r_vkorgt-HIGH = '3000'.&lt;/P&gt;&lt;P&gt; APPEND  r_vkorgt.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;select *&lt;/P&gt;&lt;P&gt;from A004&lt;/P&gt;&lt;P&gt;into corresponding fields of table i_a004Tab&lt;/P&gt;&lt;P&gt;where kappl eq 'V '&lt;/P&gt;&lt;P&gt;and kschl eq 'ZPR1'&lt;/P&gt;&lt;P&gt;and vkorg IN r_vkorgt.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should work for you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Carlos Lerzundy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Jan 2005 13:50:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-01-12T13:50:50Z</dc:date>
    <item>
      <title>Value list in a select statement !?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/value-list-in-a-select-statement/m-p/898838#M54796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data: v_vkorg type string.&lt;/P&gt;&lt;P&gt;v_vkorg = '2000 3000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;         from A004&lt;/P&gt;&lt;P&gt;         into corresponding fields of table i_a004Tab&lt;/P&gt;&lt;P&gt;         where kappl eq 'V '&lt;/P&gt;&lt;P&gt;           and kschl eq 'ZPR1'&lt;/P&gt;&lt;P&gt;           and vkorg in v_vkorg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gives me an error!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to do a value list.Howto ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jan 2005 13:41:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/value-list-in-a-select-statement/m-p/898838#M54796</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-12T13:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Value list in a select statement !?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/value-list-in-a-select-statement/m-p/898839#M54797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are doing in a wrong way, it should be this:&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from A004&lt;/P&gt;&lt;P&gt;into corresponding fields of table i_a004Tab&lt;/P&gt;&lt;P&gt;where kappl eq 'V '&lt;/P&gt;&lt;P&gt;and kschl eq 'ZPR1'&lt;/P&gt;&lt;P&gt;and vkorg = '2000' &lt;/P&gt;&lt;P&gt;and vkorg = '3000' .&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you wanna include all the vkorg between 2000 and 3000 the you need to declare a &amp;lt;b&amp;gt;RANGE&amp;lt;/b&amp;gt; Variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;RANGES: r_vkorg FOR A004-vkorg .&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Fill the Range:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt; r_vkorg-sign = 'I'.      "(I) INCLUDE - (E) Exclude&lt;/P&gt;&lt;P&gt; r_vkorg-option = 'BT'. "(BT) Between&lt;/P&gt;&lt;P&gt; r_vkorgt-low = '2000'&lt;/P&gt;&lt;P&gt; r_vkorgt-HIGH = '3000'.&lt;/P&gt;&lt;P&gt; APPEND  r_vkorgt.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;select *&lt;/P&gt;&lt;P&gt;from A004&lt;/P&gt;&lt;P&gt;into corresponding fields of table i_a004Tab&lt;/P&gt;&lt;P&gt;where kappl eq 'V '&lt;/P&gt;&lt;P&gt;and kschl eq 'ZPR1'&lt;/P&gt;&lt;P&gt;and vkorg IN r_vkorgt.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should work for you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Carlos Lerzundy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jan 2005 13:50:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/value-list-in-a-select-statement/m-p/898839#M54797</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-12T13:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Value list in a select statement !?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/value-list-in-a-select-statement/m-p/898840#M54798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;  i_a004tab TYPE TABLE OF a004 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;  BEGIN OF v_vkorg OCCURS 0,&lt;/P&gt;&lt;P&gt;      sign(1),&lt;/P&gt;&lt;P&gt;      option(2),&lt;/P&gt;&lt;P&gt;      low  LIKE a004-vkorg,&lt;/P&gt;&lt;P&gt;      high LIKE a004-vkorg,&lt;/P&gt;&lt;P&gt;    END   OF v_vkorg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_vkorg-sign   = 'I'.&lt;/P&gt;&lt;P&gt;v_vkorg-option = 'EQ'.&lt;/P&gt;&lt;P&gt;v_vkorg-low    = '2000'.&lt;/P&gt;&lt;P&gt;APPEND v_vkorg.&lt;/P&gt;&lt;P&gt;v_vkorg-sign   = 'I'.&lt;/P&gt;&lt;P&gt;v_vkorg-option = 'EQ'.&lt;/P&gt;&lt;P&gt;v_vkorg-low    = '3000'.&lt;/P&gt;&lt;P&gt;APPEND v_vkorg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;FROM a004&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE i_a004tab&lt;/P&gt;&lt;P&gt;WHERE kappl EQ 'V '&lt;/P&gt;&lt;P&gt;AND kschl EQ 'ZPR1'&lt;/P&gt;&lt;P&gt;AND vkorg IN v_vkorg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------" /&gt;&lt;P&gt;If it helps please give points.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jan 2005 13:59:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/value-list-in-a-select-statement/m-p/898840#M54798</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-12T13:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: Value list in a select statement !?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/value-list-in-a-select-statement/m-p/898841#M54799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;code from Fuat Ulugay   &lt;/P&gt;&lt;P&gt;is o.k.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but you have to define &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_vkorg as ranges or select-options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jan 2005 15:17:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/value-list-in-a-select-statement/m-p/898841#M54799</guid>
      <dc:creator>andreas_mann3</dc:creator>
      <dc:date>2005-01-12T15:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: Value list in a select statement !?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/value-list-in-a-select-statement/m-p/898842#M54800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As an alternative you could also do this without defining a range or select-option:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: i_a004tab TYPE TABLE OF a004 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM a004 &lt;/P&gt;&lt;P&gt;  INTO CORRESPONDING FIELDS OF TABLE i_a004tab&lt;/P&gt;&lt;P&gt; WHERE kappl EQ 'V '&lt;/P&gt;&lt;P&gt;   AND kschl EQ 'ZPR1'&lt;/P&gt;&lt;P&gt;   AND vkorg IN ('1000', '2000').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jan 2005 18:27:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/value-list-in-a-select-statement/m-p/898842#M54800</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-12T18:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Value list in a select statement !?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/value-list-in-a-select-statement/m-p/898843#M54801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One extra suggestion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The name of your internal table, i_a004Tab, suggests that the internal table structure exactly matches table a004.  Since you are doing "Select *", you are reading all of the fields from the a004.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If all of that is true, then the "into corresponding fields" is unnecessary.  You can code "into table i_a004Tab".  When I see an "into corresponding" in a select it makes me believe that the programmer required a match up by field name because the structures were not the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the flip side, I also do not recommend the use of "Select *" for performance reasons.  You should specify only the fields you need - "Select field1 field2...".  If you do that and keep the structure of i_a004Tab indentical to table a004, then you will need to keep the "into corresponding" part.  If you really do need all of the fields, then I suggest a comment to that effect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also recommend defining a range as mentioned in an earlier posting.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let us know how it goes!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jan 2005 21:31:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/value-list-in-a-select-statement/m-p/898843#M54801</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-12T21:31:04Z</dc:date>
    </item>
  </channel>
</rss>

