<?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 error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170031#M1197186</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 can use move statement only to move values into fields.&lt;/P&gt;&lt;P&gt;In case of internal table with same structures use&lt;/P&gt;&lt;P&gt;it_agr_pgmna = t_tstc-pgmna.&lt;/P&gt;&lt;P&gt;in case of different structures use MOVE-CORRESPONDING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Feb 2009 21:40:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-11T21:40:17Z</dc:date>
    <item>
      <title>Select statement error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170029#M1197184</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... where I need to generate a reprt that will show all the tcodes along with the program name (if any) and also the roles assigned to it and to get this I have written the following code... but I am getting an error...which says : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field it_agr_pgmna is unknown when I am moving my recods to the internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM tstc
INTO TABLE t_tstc
WHERE tcode IN S_tcode.

SELECT * FROM agr_tcodes
INTO TABLE t_agr_tcodes
WHERE tcode IN S_tcode.

LOOP AT t_agr_tcodes INTO s_agr_tcodes.
  READ TABLE t_tstc
  TRANSPORTING NO FIELDS
  WITH KEY tcode = s_agr_tcodes-tcode.

  IF sy-subrc eq 0.
    MOVE: s_agr_tcodes-tcode TO it_agr_tcodes-tcode,
          s_agr_tcodes-agr_name to it_agr_tcodes-agr_name,
          t_tstc-pgmna to it_agr_pgmna.
Append it_agr_tcodes.

endif.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;can you please tell me what I am doing wrong&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Rajeev&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Rajeev - please use code tags!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rob Burbank on Feb 11, 2009 5:02 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2009 21:30:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170029#M1197184</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-11T21:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170030#M1197185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think this is the field of the table only -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;t_tstc-pgmna to it_agr_tcodes-pgmna.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2009 21:38:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170030#M1197185</guid>
      <dc:creator>amit_khare</dc:creator>
      <dc:date>2009-02-11T21:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170031#M1197186</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 can use move statement only to move values into fields.&lt;/P&gt;&lt;P&gt;In case of internal table with same structures use&lt;/P&gt;&lt;P&gt;it_agr_pgmna = t_tstc-pgmna.&lt;/P&gt;&lt;P&gt;in case of different structures use MOVE-CORRESPONDING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2009 21:40:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170031#M1197186</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-11T21:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170032#M1197187</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 think you did not declare the internal tables, thats why the complier cant find it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bye&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gabriel P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2009 21:41:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170032#M1197187</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-11T21:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170033#M1197188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, the problem seems to be this undescore: it_agr_pgmna -&amp;gt; it_agr-pgmna.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2009 21:42:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170033#M1197188</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-11T21:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170034#M1197189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks you all for your quick responses ...the error is resolved... sorry those were some really stupid typo mistakes.... well now when I debbugged my code.. I found that the program name is not pulling up in when I am trying to move t_tstc-pgmna to it_agr_tcodes-pgmna...although the program name is there in tstc but somehow it's n ot pulling up when I am doing the move statement...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plasea advise&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2009 21:53:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170034#M1197189</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-11T21:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170035#M1197190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also... when I ran my program for a particular tcode... it showed me only one "Role" assigned to it but when I checked this tcode in the table agr_tcodes it showed me 2 roles assigned to it... can you please tell me why it's not pulling the other record. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Rajeev.....Gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2009 21:59:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170035#M1197190</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-11T21:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170036#M1197191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajeev,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I exactly do not know how you have defined your internal table , but from what i see,&lt;/P&gt;&lt;P&gt;when you are appending the last field value into the internal table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it should be &lt;/P&gt;&lt;P&gt;t_tstc-pgmna to it_agr_tcodes-pgmna.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rather than &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t_tstc-pgmna to it_agr_pgmna&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just compare and correct the code. It is not able to find a field "it_agr_pgmna".&lt;/P&gt;&lt;P&gt;it should rather be "it_agr_tcodes-pgmna"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check your definition and correct accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Akshay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2009 22:00:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170036#M1197191</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-11T22:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170037#M1197192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply Akshay....  have taken care of that!!! can you please have a look t the other two issued that I mentioned above..... thanks a lot&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rajeev&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2009 22:02:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170037#M1197192</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-11T22:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170038#M1197193</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;Can you please tell me how can we do that... I mean how can we use the code tag.&lt;/P&gt;&lt;P&gt;&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>Wed, 11 Feb 2009 22:07:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170038#M1197193</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-11T22:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170039#M1197194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi rajeev,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t_agr_tcodes_temp = t_agr_tcodes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete adjecent entries comparing tcodes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t_agr_tcodes_temp,&lt;/P&gt;&lt;P&gt;    loop at t_agr_tcodes.&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;   Read entries into your final table.&lt;/P&gt;&lt;P&gt;  end loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Akshay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2009 22:12:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170039#M1197194</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-11T22:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170040#M1197195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After you create your post, select all of your code (highlight it), then press the "Click to display as code" button just above the entry screen. That's the button witht the "&amp;lt;" and "&amp;gt;".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2009 22:17:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-error/m-p/5170040#M1197195</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-11T22:17:19Z</dc:date>
    </item>
  </channel>
</rss>

