<?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 (new to ABAP) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539713#M1265247</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You know, I spend a little time trying to get an idea what you are looking for, but I couldn't.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think is better if you can post the description you are using so we can give you an example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Apr 2009 17:21:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-22T17:21:21Z</dc:date>
    <item>
      <title>Select statement (new to ABAP)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539701#M1265235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I just get to know ABAP and have been studying about it. I'm practising an exercise in which i use select statement to retrieve data from many tables with the same field. The tables i use are COSS, AFVC, PRPS and IMZO with the same field OBJNR. The data i need to retrieve is POSNR from table IMZO. This is the code that i've just written. Howvever, when i execute it, it said 'Unable to interpret t_imobj-posnr'. I think the code is not right somehow. Very appreciate any guides.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  Z_IMPOS_TEST.

TABLES: coss,       "CO Object: Cost Totals for Internal Postings
        afvc,       "Operation within an order
        prps,       "WBS (Work Breakdown Structure) Element Master Data
        imzo.       "Table: CO Object - Capital Investment Prog.Pos.

TYPES: BEGIN OF st_impos,
  objnr       TYPE coss-objnr,
  gjahr       TYPE coss-gjahr,
  pspnr       TYPE prps-pspnr,
  posnr       TYPE imzo-posnr,
END OF st_impos.

DATA : st_imobj    TYPE st_impos,
       t_imobj     TYPE STANDARD TABLE OF st_impos.

*PARAMETERS: p_year TYPE coss-gjahr OBLIGATORY.

SELECT objnr gjahr
      INTO CORRESPONDING FIELDS OF st_imobj
      FROM  coss
      WHERE objnr = st_imobj-objnr
      AND  gjahr = '2007'.
   SELECT objnr
      INTO st_imobj-objnr
      FROM afvc
      WHERE projn = st_imobj-pspnr.
         SELECT objnr
         INTO st_imobj-objnr
         FROM imzo
         WHERE posnr = st_imobj-posnr.
         st_imobj-posnr = st_imobj-posnr.
         st_imobj-gjahr = '2007'.
         APPEND st_imobj TO t_imobj.
         ENDSELECT.
    ENDSELECT.
  ENDSELECT.
  
  WRITE: 'InvProgPosition is : '  t_imobj-posnr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 16:37:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539701#M1265235</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-22T16:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement (new to ABAP)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539702#M1265236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Insert a colon before t_imobj-posnr in the last line.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;WRITE: 'InvProgPosition is : ' , t_imobj-posnr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;That might not be the only problem though, st_imobj-objnr is empty when you are doing the first select, so that will not return anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 16:39:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539702#M1265236</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-04-22T16:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement (new to ABAP)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539703#M1265237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot do write &amp;lt;table name&amp;gt;-&amp;lt;field name&amp;gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;write: t_imobj-posnr " This line is in error&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this way&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at t_imobj into st_imobj.
write: st_imobj-posnr.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lalit Mohan Gupta.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 16:41:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539703#M1265237</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-22T16:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement (new to ABAP)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539704#M1265238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh i see. That's fixed. Now i can excute it, but in the write statement, there's no value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 16:43:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539704#M1265238</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-22T16:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement (new to ABAP)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539705#M1265239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The table t_imobj don´t have header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at t_imobj into st_imobj.
write: st_imobj-posnr.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Achin on Apr 22, 2009 6:45 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 16:44:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539705#M1265239</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-22T16:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement (new to ABAP)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539706#M1265240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;so possibly you are not getting any values from select statement for your condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check for sy-subrc after select. You this after your select.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;If sy-subrc ne 0.
" Error message saying no data available.
Endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lalit Mohan Gupta.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 16:46:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539706#M1265240</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-22T16:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement (new to ABAP)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539707#M1265241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the first place, you never get the posnr from the table in the select, so of course is going to be empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, using select... endselect is practically obsolete.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are several things wrong in your code. Which is fine since you are starting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck with ABAP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 16:46:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539707#M1265241</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-22T16:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement (new to ABAP)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539708#M1265242</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;SELECT objnr gjahr&lt;/P&gt;&lt;P&gt;      INTO CORRESPONDING FIELDS OF st_imobj&lt;/P&gt;&lt;P&gt;      FROM  coss&lt;/P&gt;&lt;P&gt;      WHERE objnr = st_imobj-objnr&lt;/P&gt;&lt;P&gt;      AND  gjahr = '2007'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is worng.......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and dont use select----endselect...just an advice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and i see that the way u structured ur select query ur bound to get no data!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;explain the flow based on which u need to get the data sum1 will guide u.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gudluck and have a gud time coding in abap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: JAYARAM MAGANTI on Apr 22, 2009 6:51 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 16:50:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539708#M1265242</guid>
      <dc:creator>Jay71</dc:creator>
      <dc:date>2009-04-22T16:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement (new to ABAP)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539709#M1265243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks everyone. One problem right now it keeps saying t_imoject without header line. I change its declaration to &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t_imobj     TYPE st_impos OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it still doesn't work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 16:54:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539709#M1265243</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-22T16:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement (new to ABAP)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539710#M1265244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well his select doesn't make any sense at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. He is starting a where with an empty condition (st_imobj-objnr)&lt;/P&gt;&lt;P&gt;2. In afvc he is getting again the objnr and placing it in the same variable. Doesn't make sense what he is trying to do, is wasting resources getting another time the objnr.&lt;/P&gt;&lt;P&gt;3. The same select again has an empty condition in st_imobj-pspnr because he never selected the project number in the select before.&lt;/P&gt;&lt;P&gt;4. He is getting the objnr again (is it different from the last two? then why select them in the first place if you are never going to use them?).&lt;/P&gt;&lt;P&gt;5. Again another empty where in st_imobj-posnr.&lt;/P&gt;&lt;P&gt;6. appends an empty posnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And forget about the three nested select endselect. I'm pretty sure what he is trying to do can be reduced to one select only getting one column.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 16:58:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539710#M1265244</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-22T16:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement (new to ABAP)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539711#M1265245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : t_imobj     TYPE STANDARD TABLE OF st_impos WITH HEADER LINE.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 16:58:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539711#M1265245</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-22T16:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement (new to ABAP)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539712#M1265246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for pointing out my mistakes. But you mention about one select statement only, is it a join select statement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 17:03:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539712#M1265246</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-22T17:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement (new to ABAP)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539713#M1265247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You know, I spend a little time trying to get an idea what you are looking for, but I couldn't.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think is better if you can post the description you are using so we can give you an example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 17:21:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539713#M1265247</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-22T17:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement (new to ABAP)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539714#M1265248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for giving confusion. This is what i want for the program. When i pick any Object number, i will get the Invesment Prohram Pos (POSNR). OBJNR can be retrieved in table COSS. So for example, a data in OBJNR is PR00113384 (that i get from COSS). I go to table AFVC, i enter this OBJNR, I get a corresponding PROJN (WBS Element), provided that afvc-objnr = coss-objnr. I go to PRPS, i enter this OBJNR, u will get the same WBS Element ( provided that PRPS-PSPNR = AFVC-PROJN). Finally, i go to table IMZO, i enter the OBJNR again, i will get POSNR (provided that imzo-objnr = prps-objnr).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 17:43:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539714#M1265248</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-22T17:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement (new to ABAP)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539715#M1265249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;any help? I get stuck now since i'm trying to do the nested select statement but it still gives me errors.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 21:53:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539715#M1265249</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-22T21:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement (new to ABAP)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539716#M1265250</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 are not passing any value to OBJNR , before select so you will not get any record for the select.&lt;/P&gt;&lt;P&gt;Before 1st select you need to assign values as follows:&lt;/P&gt;&lt;P&gt; st_imobj-objnr = XXXXXX.&lt;/P&gt;&lt;P&gt;Also after you are able to get data you can using &lt;/P&gt;&lt;P&gt;select single or &lt;/P&gt;&lt;P&gt;Select .... into table .... &lt;/P&gt;&lt;P&gt;to optimize the code.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;komal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 03:55:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539716#M1265250</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-23T03:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement (new to ABAP)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539717#M1265251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;the first select statement is selecting values for blanks or null..so no values are selected into tat..the 2nd select is based on the first so obviously no values flow into tat &amp;amp; tats why you are getting no values in the output..always declare internal tables with an header line or an explicit workarea.. While writing statements in an internal table always use loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t_imobj into st_imobj.&lt;/P&gt;&lt;P&gt;write: st_imobj-posnr.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You had given t_imobj-posnr which has no headerline..tat was the error in the first case..hope its solved now..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any more queries feel free to get back..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Jai..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 05:00:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539717#M1265251</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-23T05:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement (new to ABAP)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539718#M1265252</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;after every selct chk whether the condition is satisfied if no data is selected then below select will have all the values of the table into ur internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so go for if sy-subrc eq 0 .&lt;/P&gt;&lt;P&gt;then go for select.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 06:59:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539718#M1265252</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-23T06:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement (new to ABAP)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539719#M1265253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you everyone. I fixed most of the lines in the code. The syntac is correct now, but since i used nested select statements, it takes like FOREVER to give the output when i execute it!. Are there any other ways to make the code more effecient?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  z_impos_test.

TABLES: coss,       "CO Object: Cost Totals for Internal Postings
        afvc,       "Operation within an order
        prps,       "WBS (Work Breakdown Structure) Element Master Data
        imzo.       "Table: CO Object - Capital Investment Prog.Pos.

TYPES: BEGIN OF st_impos,
  objnr       TYPE coss-objnr,
  gjahr       TYPE coss-gjahr,
  kstar       type coss-kstar,
  projn       type afvc-projn,
  pspnr       type prps-pspnr,
  posnr       type imzo-posnr,
END OF st_impos.

data: year TYPE coss-gjahr value '2007'.

DATA: t_output  TYPE STANDARD TABLE OF st_impos WITH HEADER LINE,
      st_output TYPE st_impos,
      t_output2 TYPE STANDARD TABLE OF st_impos WITH HEADER LINE,
      st_output2 TYPE st_impos.

SELECT objnr gjahr kstar FROM coss
INTO CORRESPONDING FIELDS OF st_output
WHERE ( objnr LIKE 'NV%' OR
      objnr LIKE 'PR%' ) AND
       gjahr = year.
   SELECT SINGLE projn from afvc into CORRESPONDING FIELDS OF st_output
       WHERE objnr = st_output-objnr.
 APPEND st_output to t_output.
 ENDSELECT.

SORT t_output BY objnr.
DELETE ADJACENT DUPLICATES FROM t_output.

LOOP AT t_output into st_output.
SELECT objnr pspnr
       INTO CORRESPONDING FIELDS OF st_output2
       FROM prps
       WHERE objnr = st_output-objnr
       AND   pspnr = st_output-pspnr.
  SELECT SINGLE posnr from imzo into CORRESPONDING FIELDS OF st_output2
       WHERE objnr = st_output2-objnr.
APPEND st_output2 to t_output2.
ENDSELECT.
ENDLOOP.


LOOP AT t_output2 to st_output2.
WRITE:   st_output2-posnr.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 20:52:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539719#M1265253</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-23T20:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement (new to ABAP)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539720#M1265254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jacie - I think this is a new, unrelated problem. Would you please close this thread by assigning points to everyone who helped you and open a new thread in &lt;SPAN __jive_macro_name="forum" id="234"&gt;&lt;/SPAN&gt; with just the last bit of code and a description of your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(I mean all the code in your last post)&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 Apr 23, 2009 5:10 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 21:04:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-new-to-abap/m-p/5539720#M1265254</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-23T21:04:44Z</dc:date>
    </item>
  </channel>
</rss>

