<?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 report-query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-query/m-p/2196200#M468749</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;types: begin of ty_lfa1,&lt;/P&gt;&lt;P&gt;         lifnr type lfa1-lifnr,&lt;/P&gt;&lt;P&gt;        name1 type lfa1-name1,&lt;/P&gt;&lt;P&gt;        land1   type lfa1-land1,&lt;/P&gt;&lt;P&gt;        pstlz   type lfa1-pstlz,&lt;/P&gt;&lt;P&gt;       end of ty_lfa1.&lt;/P&gt;&lt;P&gt;data: w_lfa1 type ty_lfa1,&lt;/P&gt;&lt;P&gt;        t_lfa1 type ty_lfa1 occurs 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameters : P_cnty type lfa1-land1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from lfa1 into table t_lfa1 where land1 = p_cnty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t_lfa1 into w_lfa1.&lt;/P&gt;&lt;P&gt;write:/ 05 w_lfa1-lifnr,&lt;/P&gt;&lt;P&gt;         30 w_lfa1-name1,&lt;/P&gt;&lt;P&gt;         50 w_lfa1-land1,&lt;/P&gt;&lt;P&gt;         75 w_lfa1-pstlz.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 May 2007 03:17:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-08T03:17:10Z</dc:date>
    <item>
      <title>report-query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-query/m-p/2196200#M468749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;types: begin of ty_lfa1,&lt;/P&gt;&lt;P&gt;         lifnr type lfa1-lifnr,&lt;/P&gt;&lt;P&gt;        name1 type lfa1-name1,&lt;/P&gt;&lt;P&gt;        land1   type lfa1-land1,&lt;/P&gt;&lt;P&gt;        pstlz   type lfa1-pstlz,&lt;/P&gt;&lt;P&gt;       end of ty_lfa1.&lt;/P&gt;&lt;P&gt;data: w_lfa1 type ty_lfa1,&lt;/P&gt;&lt;P&gt;        t_lfa1 type ty_lfa1 occurs 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameters : P_cnty type lfa1-land1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from lfa1 into table t_lfa1 where land1 = p_cnty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t_lfa1 into w_lfa1.&lt;/P&gt;&lt;P&gt;write:/ 05 w_lfa1-lifnr,&lt;/P&gt;&lt;P&gt;         30 w_lfa1-name1,&lt;/P&gt;&lt;P&gt;         50 w_lfa1-land1,&lt;/P&gt;&lt;P&gt;         75 w_lfa1-pstlz.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2007 03:17:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-query/m-p/2196200#M468749</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-08T03:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: report-query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-query/m-p/2196201#M468750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i think you are getting the sql error for this select query because select * will fetch all the fields from lfa1 but your internal table contains only few fields of lfa1 so after fetching the fields it can not store in the int table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for that you have to write the select qery with the fields...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select lifnr name1 land1 pstlz into  table t_lfa1 where land1 = p_cnty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and one more thing since p_cnty is parameter so you must have to enter value other wise it will not fetch any rows..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2007 03:22:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-query/m-p/2196201#M468750</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-08T03:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: report-query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-query/m-p/2196202#M468751</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;From your code its clear that you need to give corresponding fields of table ty_lfa1 as the query would fetch records from all fields of the database table lfa1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try using the querry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from lfa1 into corresponding fields of table t_lfa1 where land1 = p_cnty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dinesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2007 03:44:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-query/m-p/2196202#M468751</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-08T03:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: report-query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-query/m-p/2196203#M468752</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;ur internal table cannt hold all the fields as u declared that with specific fields,thats the error.so either declare internal table with header line r use into corresponding option.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2007 03:49:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-query/m-p/2196203#M468752</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-08T03:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: report-query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-query/m-p/2196204#M468753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Venkat,&lt;/P&gt;&lt;P&gt;                 Use "&amp;lt;b&amp;gt;in to corresponing fields of table&amp;lt;/b&amp;gt; " clause in to ur select query.&lt;/P&gt;&lt;P&gt; u r fetching all records from LFA1 which may be in different sequence as u have given in ur structure.so type mismatch will be there.&lt;/P&gt;&lt;P&gt;therefore use this statement :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from lfa1 &amp;lt;b&amp;gt;into corresponding fields of table t_lfa1&amp;lt;/b&amp;gt; where land1 = p_cnty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if helpful.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hemant.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2007 03:50:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-query/m-p/2196204#M468753</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-08T03:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: report-query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-query/m-p/2196205#M468754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai Venkat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U would have used 'DATA' instead of 'TYPES'. b'coz, pre-defined structures can be declared with 'types'. In query, ' into corresponding fields of table' is a must.&lt;/P&gt;&lt;P&gt;Now, this script can be executed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of ty_lfa1,&lt;/P&gt;&lt;P&gt;        lifnr type lfa1-lifnr,&lt;/P&gt;&lt;P&gt;        name1 type lfa1-name1,&lt;/P&gt;&lt;P&gt;        land1 type lfa1-land1,&lt;/P&gt;&lt;P&gt;        pstlz type lfa1-pstlz,&lt;/P&gt;&lt;P&gt;       end of ty_lfa1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: w_lfa1 like ty_lfa1,&lt;/P&gt;&lt;P&gt;      t_lfa1 like ty_lfa1 occurs 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameters : P_cnty type lfa1-land1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from lfa1 into corresponding fields of table t_lfa1 where land1&lt;/P&gt;&lt;P&gt; = p_cnty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t_lfa1 into w_lfa1.&lt;/P&gt;&lt;P&gt;  write: /05 w_lfa1-lifnr,&lt;/P&gt;&lt;P&gt;  30 w_lfa1-name1,&lt;/P&gt;&lt;P&gt;  50 w_lfa1-land1,&lt;/P&gt;&lt;P&gt;  75 w_lfa1-pstlz.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2007 04:41:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-query/m-p/2196205#M468754</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-08T04:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: report-query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-query/m-p/2196206#M468755</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;U have given * where its going to select all the fields n u have taken only few of them so u have to either give it as corresponding fields or take it as an internal table.this will solve ur problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if useful reward with points,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with regards,&lt;/P&gt;&lt;P&gt;madhuri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2007 05:47:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-query/m-p/2196206#M468755</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-08T05:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: report-query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-query/m-p/2196207#M468756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi venkat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u declared internal table without header line so u have to declare a work area and populate data through workarea into internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;second one is the select statement should have the same order in which u declared all fileds in types. otherwise u would get the error.&lt;/P&gt;&lt;P&gt;instead of that u can use select statement with 'into corresponding fields of' can be used but it reduces the performance as it has to check every filed while inserting data into the internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it is useful reward some point.,&lt;/P&gt;&lt;P&gt;with regards ,&lt;/P&gt;&lt;P&gt;suresh babu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2007 05:51:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-query/m-p/2196207#M468756</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-08T05:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: report-query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-query/m-p/2196208#M468757</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;try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data :  begin of itab_lfa1,&lt;/P&gt;&lt;P&gt;           lifnr like lfa1-lifnr,&lt;/P&gt;&lt;P&gt;           name1 like lfa1-name1,&lt;/P&gt;&lt;P&gt;           land1 like lfa1-land1,&lt;/P&gt;&lt;P&gt;           pstlz like lfa1-pstlz,&lt;/P&gt;&lt;P&gt;           end of itab_lfa1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: w_lfa1 like itab_lfa1,&lt;/P&gt;&lt;P&gt;         t_lfa1 like itab_lfa1 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameters : P_cnty like lfa1-land1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from lfa1 into table itab_lfa1 where land1 = p_cnty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab_lfa1 into w_lfa1.&lt;/P&gt;&lt;P&gt;write:/ 05 w_lfa1-lifnr,&lt;/P&gt;&lt;P&gt;30 w_lfa1-name1,&lt;/P&gt;&lt;P&gt;50 w_lfa1-land1,&lt;/P&gt;&lt;P&gt;75 w_lfa1-pstlz.&lt;/P&gt;&lt;P&gt;endloop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward with points if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2007 07:02:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-query/m-p/2196208#M468757</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-08T07:02:40Z</dc:date>
    </item>
  </channel>
</rss>

