<?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 Statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126507#M1188674</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Give this a try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ztest LINE-SIZE 80 MESSAGE-ID 00.

TABLES: tstc, tstct, trdir.

DATA: BEGIN OF it_tcodelisting OCCURS 0,
        pgmna LIKE tstc-pgmna,
        tcode LIKE tstc-tcode,
        sprsl LIKE tstct-sprsl,
        ttext LIKE tstct-ttext,
        secu  LIKE trdir-secu,
      END   OF it_tcodelisting.

RANGES gr_pgmna FOR tstc-pgmna.

gr_pgmna-sign = 'I'.
gr_pgmna-option = 'CP'.
gr_pgmna-low = 'Z*'.
APPEND gr_pgmna.

gr_pgmna-low = 'Y*'.
APPEND gr_pgmna.

SELECT tstc~pgmna
tstc~tcode
tstct~sprsl
tstct~ttext
trdir~secu
INTO TABLE it_tcodelisting
FROM ( tstc INNER JOIN tstct ON tstct~tcode = tstc~tcode
INNER JOIN trdir ON trdir~name = tstc~pgmna )
WHERE pgmna IN gr_pgmna.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It works for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;And please start using code tags.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rob Burbank on Feb 10, 2009 11:21 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Feb 2009 16:20:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-10T16:20:49Z</dc:date>
    <item>
      <title>Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126491#M1188658</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 am working on a report and I have written the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT tstc~pgmna&lt;/P&gt;&lt;P&gt;    tstc~tcode&lt;/P&gt;&lt;P&gt;    tstct~sprsl&lt;/P&gt;&lt;P&gt;    tstct~ttext&lt;/P&gt;&lt;P&gt;    trdir~secu&lt;/P&gt;&lt;P&gt;    INTO TABLE it_test&lt;/P&gt;&lt;P&gt;    FROM ( tstc INNER JOIN tstct ON tstct&lt;SUB&gt;tcode = tstc&lt;/SUB&gt;tcode&lt;/P&gt;&lt;P&gt;           INNER JOIN trdir ON trdir&lt;SUB&gt;name = tstc&lt;/SUB&gt;pgmna )&lt;/P&gt;&lt;P&gt;    WHERE pgmna LIKE 'Z%' OR name LIKE 'Y%'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made one change in this .... as the where condition initially it was checking the program name with what user enters but noe I have changed and made it select all the custom program name.... but somehow the performance of the program is bad now ....can you please tell me if there is anything I can do with the code to make the performance better. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Rajeev&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 20:24:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126491#M1188658</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T20:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126492#M1188659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RANGES: gr_pgmna FOR tstc-pgmna.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gr_pgmna-sign = 'I'.&lt;/P&gt;&lt;P&gt;gr_pgmna-option  = 'CP'.&lt;/P&gt;&lt;P&gt;gr_pgmna-low = 'Z*'.&lt;/P&gt;&lt;P&gt;APPEND gr_pgmna.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gr_pgmna-low = 'Y*'.&lt;/P&gt;&lt;P&gt;APPEND gr_pgmna.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT tstc~pgmna&lt;/P&gt;&lt;P&gt;tstc~tcode&lt;/P&gt;&lt;P&gt;tstct~sprsl&lt;/P&gt;&lt;P&gt;tstct~ttext&lt;/P&gt;&lt;P&gt;trdir~secu&lt;/P&gt;&lt;P&gt;INTO TABLE it_test&lt;/P&gt;&lt;P&gt;FROM ( tstc INNER JOIN tstct ON tstct&lt;SUB&gt;tcode = tstc&lt;/SUB&gt;tcode&lt;/P&gt;&lt;P&gt;INNER JOIN trdir ON trdir&lt;SUB&gt;name = tstc&lt;/SUB&gt;pgmna )&lt;/P&gt;&lt;P&gt;WHERE pgmna IN gr_pgmna&lt;/P&gt;&lt;P&gt;%_hints oracle 'INDEX ("TSTC" "TSTC~001")'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that help .. =D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 20:32:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126492#M1188659</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T20:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126493#M1188660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rajeev,&lt;/P&gt;&lt;P&gt;Try deleting non z program records after the select has extracted the data.Something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT tstc~pgmna&lt;/P&gt;&lt;P&gt;tstc~tcode&lt;/P&gt;&lt;P&gt;tstct~sprsl&lt;/P&gt;&lt;P&gt;tstct~ttext&lt;/P&gt;&lt;P&gt;trdir~secu&lt;/P&gt;&lt;P&gt;INTO TABLE it_test&lt;/P&gt;&lt;P&gt;FROM ( tstc INNER JOIN tstct ON tstct&lt;SUB&gt;tcode = tstc&lt;/SUB&gt;tcode&lt;/P&gt;&lt;P&gt;INNER JOIN trdir ON trdir&lt;SUB&gt;name = tstc&lt;/SUB&gt;pgmna ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete it_test where not ( prgname+0(1) na 'ZY')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 20:40:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126493#M1188660</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T20:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126494#M1188661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply Sam.... but my internal table is fetching only custom programs and not the non cust ones&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 20:42:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126494#M1188661</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T20:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126495#M1188662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thats what I want , fetch all programs and then delete all those are not wanted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 20:51:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126495#M1188662</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T20:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126496#M1188663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why do you have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;WHERE pgmna LIKE 'Z%' OR name LIKE 'Y%'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You are testing two different fields, one of which is not the primary key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 22:13:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126496#M1188663</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T22:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126497#M1188664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sam, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply... I tried using your code but it didn't help... I mean it's still having the same running time !!! can you please suggest something else... when I tried to do the run tima alanysis usisng SE30 .. I could see that it's hitting database 98%..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any suggestion..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Rajeev&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 15:16:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126497#M1188664</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-10T15:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126498#M1188665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am sorry Rob that was a typo...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks, &lt;/P&gt;&lt;P&gt;Rajeev&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 15:16:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126498#M1188665</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-10T15:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126499#M1188666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used the following code as suggested by you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; gr_pgmna-sign = 'I'.&lt;/P&gt;&lt;P&gt;gr_pgmna-option = 'CP'.&lt;/P&gt;&lt;P&gt;gr_pgmna-low = 'Z%'.&lt;/P&gt;&lt;P&gt;APPEND gr_pgmna.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gr_pgmna-low = 'Y%'.&lt;/P&gt;&lt;P&gt;APPEND gr_pgmna.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT tstc~pgmna&lt;/P&gt;&lt;P&gt;tstc~tcode&lt;/P&gt;&lt;P&gt;tstct~sprsl&lt;/P&gt;&lt;P&gt;tstct~ttext&lt;/P&gt;&lt;P&gt;trdir~secu&lt;/P&gt;&lt;P&gt;INTO TABLE it_tcodelisting&lt;/P&gt;&lt;P&gt;FROM ( tstc INNER JOIN tstct ON tstct&lt;SUB&gt;tcode = tstc&lt;/SUB&gt;tcode&lt;/P&gt;&lt;P&gt;INNER JOIN trdir ON trdir&lt;SUB&gt;name = tstc&lt;/SUB&gt;pgmna )&lt;/P&gt;&lt;P&gt;WHERE pgmna IN gr_pgmna.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it didn't fetch a single record... can you please tell wht's missing !!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Rajeev&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 15:18:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126499#M1188666</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-10T15:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126500#M1188667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now that you switched to ranges, the wildcard is '*', not '%'.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 15:22:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126500#M1188667</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-02-10T15:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126501#M1188668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The table TSTC has a index named 001&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 15:22:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126501#M1188668</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-10T15:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126502#M1188669</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;Initially I used '*" only but id didn't work... but '%' is working !!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 15:26:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126502#M1188669</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-10T15:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126503#M1188670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply David... I used this index statement also but still nothing is coming up as output&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 15:28:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126503#M1188670</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-10T15:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126504#M1188671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried to debug the program David and found that it's skipping the whole select statement&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 15:32:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126504#M1188671</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-10T15:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126505#M1188672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; hi, &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Initially I used '*" only but id didn't work... but '%' is working !!!&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;No it's not. Try Thomas's suggestion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 15:34:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126505#M1188672</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-10T15:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126506#M1188673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know why this is happening... but as soon as I replace "%" with '*' I am losing all my data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 15:44:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126506#M1188673</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-10T15:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126507#M1188674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Give this a try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ztest LINE-SIZE 80 MESSAGE-ID 00.

TABLES: tstc, tstct, trdir.

DATA: BEGIN OF it_tcodelisting OCCURS 0,
        pgmna LIKE tstc-pgmna,
        tcode LIKE tstc-tcode,
        sprsl LIKE tstct-sprsl,
        ttext LIKE tstct-ttext,
        secu  LIKE trdir-secu,
      END   OF it_tcodelisting.

RANGES gr_pgmna FOR tstc-pgmna.

gr_pgmna-sign = 'I'.
gr_pgmna-option = 'CP'.
gr_pgmna-low = 'Z*'.
APPEND gr_pgmna.

gr_pgmna-low = 'Y*'.
APPEND gr_pgmna.

SELECT tstc~pgmna
tstc~tcode
tstct~sprsl
tstct~ttext
trdir~secu
INTO TABLE it_tcodelisting
FROM ( tstc INNER JOIN tstct ON tstct~tcode = tstc~tcode
INNER JOIN trdir ON trdir~name = tstc~pgmna )
WHERE pgmna IN gr_pgmna.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It works for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;And please start using code tags.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rob Burbank on Feb 10, 2009 11:21 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 16:20:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126507#M1188674</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-10T16:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126508#M1188675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply ROb.... this time it worked but the time it's taking is still the same&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 16:37:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126508#M1188675</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-10T16:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126509#M1188676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To speed it up, you will have to add the language either to the JOIN condition or the WHERE:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT tstc~pgmna tstc~tcode tstct~sprsl tstct~ttext trdir~secu
  INTO TABLE it_tcodelisting
  FROM ( tstc INNER JOIN tstct ON tstct~tcode = tstc~tcode
              INNER JOIN trdir ON trdir~name = tstc~pgmna )
  WHERE pgmna IN gr_pgmna
    AND sprsl = sy-langu.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If you can determine all the languages used in your system, you can build a range table for them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 16:58:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126509#M1188676</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-10T16:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126510#M1188677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rob it worked&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 17:12:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/5126510#M1188677</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-10T17:12:24Z</dc:date>
    </item>
  </channel>
</rss>

