<?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: Range table in INTO clause in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-table-in-into-clause/m-p/6537130#M1427401</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can define range in two ways:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table for Range(Obsolete way, this declares with header line)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;RANGES: robs_matnr FOR mara-matnr.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Work area for that range&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: waobs_matnr LIKE LINE OF robs_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table for range(New way)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: rnew_matnr TYPE RANGE OF mara-matnr.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Work area for range&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: wanew_matnr LIKE LINE OF rnew_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: i_matnr TYPE STANDARD TABLE OF mara-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;To fill the range table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;wanew_matnr-sign   = 'I'. " Sign can be I-Including or E- Excluding&lt;/P&gt;&lt;P&gt;wanew_matnr-option = 'BT'." Option can be BT,EQ,GT,LT etc.&lt;/P&gt;&lt;P&gt;wanew_matnr-low    = '000000000000000001'.&lt;/P&gt;&lt;P&gt;wanew_matnr-high   = '000000000000000020'.&lt;/P&gt;&lt;P&gt;APPEND wanew_matnr TO rnew_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT matnr FROM mara INTO TABLE i_matnr&lt;/P&gt;&lt;P&gt;  WHERE matnr IN rnew_matnr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Dec 2009 06:47:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-12-29T06:47:10Z</dc:date>
    <item>
      <title>Range table in INTO clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-table-in-into-clause/m-p/6537126#M1427397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I Have a table ZMCTR1AM_CNSTNTS with two columns n its entries are as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;FIELD&lt;/U&gt;NM     FIELD_VAL_&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Panel               Names&lt;/P&gt;&lt;P&gt;   Field Group     Names&lt;/P&gt;&lt;P&gt;   Field                Last Name&lt;/P&gt;&lt;P&gt;   Field                Suffix&lt;/P&gt;&lt;P&gt;   Field                First Name&lt;/P&gt;&lt;P&gt;   Field                Middle Initial&lt;/P&gt;&lt;P&gt;   Field                Nick Name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to separate entries in this table based on FIELD_NM = 'PANEL', FIELD_NM = 'FIELD GROUP' and FIELD_NM = 'FIELD' and put them in separate range table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My range table declaration is as follows,&lt;/P&gt;&lt;P&gt;DATA: ra_panel          TYPE RANGE OF JQTATTRIBUTE-PANEL,         &lt;/P&gt;&lt;P&gt;           ra_field_group TYPE RANGE OF JQTATTRIBUTE-FIELD_GROUP,   &lt;/P&gt;&lt;P&gt;           ra_field             TYPE RANGE OF JQTATTRIBUTE-FIELD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My select query which didnt work,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT field_val&lt;/P&gt;&lt;P&gt;      FROM ZMCTR1AM_CNSTNTS&lt;/P&gt;&lt;P&gt;INTO TABLE ra_panel&lt;/P&gt;&lt;P&gt;     WHERE field_nm EQ 'PANEL'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I havent worked on ranges and tried a lot of search. But didnt find any info. that i could use. Can someone tel me how do i go about doing it. I cannot use SELECT...ENDSELECT and WITH HEADER LINE as coding stds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Herwin Wilmet Dsouza on Dec 29, 2009 7:20 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Dec 2009 06:19:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/range-table-in-into-clause/m-p/6537126#M1427397</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-29T06:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Range table in INTO clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-table-in-into-clause/m-p/6537127#M1427398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont understand why do you need to use a Ranges table in a INTO clause of a select statement. Look like you have misunderstood the use of ranges. Ranges will have a SIGN, OPTION, HIGH and LOW fields and it makes no sense to use them in INTO clause. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should be using a internal table of the type of the table and use it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

data: itab type standard table of ZMCTR1AM_CNSTNTS. 

SELECT field_val
FROM ZMCTR1AM_CNSTNTS
INTO CORRESPONDING FIELDS OF TABLE itab
WHERE field_nm EQ 'PANEL'. " Add whatever conditions required
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vikranth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Dec 2009 06:36:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/range-table-in-into-clause/m-p/6537127#M1427398</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-29T06:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Range table in INTO clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-table-in-into-clause/m-p/6537128#M1427399</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;Declare the range table as follows,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ranges: it_matnr FOR vbap-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this range table in the &lt;STRONG&gt;where clause&lt;/STRONG&gt; and not in the &lt;STRONG&gt;into table&lt;/STRONG&gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Abhijit G. Borkar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Abhijit Borkar on Dec 29, 2009 7:38 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Dec 2009 06:37:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/range-table-in-into-clause/m-p/6537128#M1427399</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-29T06:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Range table in INTO clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-table-in-into-clause/m-p/6537129#M1427400</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;Declare range like this, chose low and high as per requirement.&lt;/P&gt;&lt;P&gt; types:&lt;/P&gt;&lt;P&gt;      begin of ty_range1,&lt;/P&gt;&lt;P&gt;      sign type c length 1,&lt;/P&gt;&lt;P&gt;      option type c length 2,&lt;/P&gt;&lt;P&gt;      low type werks,&lt;/P&gt;&lt;P&gt;      high type werks,&lt;/P&gt;&lt;P&gt;      end of ty_range1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data : lt_range type table of ty_range1,&lt;/P&gt;&lt;P&gt;         wa_range1 type ty_range1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can take into a internal table and then pass it to range table's low if required and if you want to use it in where clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Mohinder&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Dec 2009 06:45:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/range-table-in-into-clause/m-p/6537129#M1427400</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-29T06:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: Range table in INTO clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-table-in-into-clause/m-p/6537130#M1427401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can define range in two ways:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table for Range(Obsolete way, this declares with header line)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;RANGES: robs_matnr FOR mara-matnr.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Work area for that range&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: waobs_matnr LIKE LINE OF robs_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table for range(New way)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: rnew_matnr TYPE RANGE OF mara-matnr.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Work area for range&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: wanew_matnr LIKE LINE OF rnew_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: i_matnr TYPE STANDARD TABLE OF mara-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;To fill the range table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;wanew_matnr-sign   = 'I'. " Sign can be I-Including or E- Excluding&lt;/P&gt;&lt;P&gt;wanew_matnr-option = 'BT'." Option can be BT,EQ,GT,LT etc.&lt;/P&gt;&lt;P&gt;wanew_matnr-low    = '000000000000000001'.&lt;/P&gt;&lt;P&gt;wanew_matnr-high   = '000000000000000020'.&lt;/P&gt;&lt;P&gt;APPEND wanew_matnr TO rnew_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT matnr FROM mara INTO TABLE i_matnr&lt;/P&gt;&lt;P&gt;  WHERE matnr IN rnew_matnr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Dec 2009 06:47:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/range-table-in-into-clause/m-p/6537130#M1427401</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-29T06:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Range table in INTO clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-table-in-into-clause/m-p/6537131#M1427402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi vikranth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to get not just the Panel details but also Field group and field details.. then In another select query in need to combne all of these to get record from another table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will be using it in the where slause later in another select query which is like this,&lt;/P&gt;&lt;P&gt;SELECT tech_adspec_id field value_fin&lt;/P&gt;&lt;P&gt;       FROM JQTATTRIBUTE&lt;/P&gt;&lt;P&gt; INTO CORRESPONDING FIELDS OF TABLE t_names&lt;/P&gt;&lt;P&gt;      WHERE panel          IN ra_panel&lt;/P&gt;&lt;P&gt;        AND field_group    IN ra_field_group&lt;/P&gt;&lt;P&gt;        AND field          IN ra_field&lt;/P&gt;&lt;P&gt;        AND tech_adspec_id EQ ls_adspec_id-tech_adspec_id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But before that all the three ranges needs to have values from the constants table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Dec 2009 06:59:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/range-table-in-into-clause/m-p/6537131#M1427402</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-29T06:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: Range table in INTO clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-table-in-into-clause/m-p/6537132#M1427403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Herwin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understood your query now. You are using the ranges in the first select statement to build the range to be used later. In that case, you might have to use something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

DATA: ra_panel TYPE RANGE OF JQTATTRIBUTE-PANEL, 
ra_field_group TYPE RANGE OF JQTATTRIBUTE-FIELD_GROUP, 
ra_field TYPE RANGE OF JQTATTRIBUTE-FIELD.

data: begin of it_panel  occurs 0,   "internal table to hold the values 
        field_val like ZMCTR1AM_CNSTNTS-field_val,
         end of it_panel.

data: wa_panel like it_panel. "work area

SELECT field_val
FROM ZMCTR1AM_CNSTNTS
INTO TABLE it_panel
WHERE field_nm EQ 'PANEL'.

loop at it_panel into wa_panel.
ra_panel-sign = 'I'.
ra_panel-option = 'EQ'.
ra_panel-low = wa_panel.
append ra_panel.
endloop.

"similarly build other ranges and use them
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vikranth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Dec 2009 07:18:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/range-table-in-into-clause/m-p/6537132#M1427403</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-29T07:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: Range table in INTO clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-table-in-into-clause/m-p/6537133#M1427404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Vikranth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This helped.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Dec 2009 10:01:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/range-table-in-into-clause/m-p/6537133#M1427404</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-29T10:01:18Z</dc:date>
    </item>
  </channel>
</rss>

