<?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 Problem in select query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/7248407#M1527245</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends&lt;/P&gt;&lt;P&gt;I am using a table a981 and fetching data in internal table but the table has a fieil Country whose technical name is ALAND in dev and LAND1 in production.Now i cannot use LAND1 as it wont let me to activate the report and if i use ALAND i cannot move the request to production as it fails. So how can i achive dynamic table field in the select query based on server.My query is-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 select kschl
           wkreg
           matnr
           knumh
   from a981 into corresponding fields of table it_a981
   for all entries in it_marc where matnr = it_marc-matnr
                                and kschl in ('MWST','ZSER')
                                and aland = 'IN'
                                and datab le sy-datum
                                and datbi ge sy-datum. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to make aland dynamic.Pls suggest&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Sep 2010 14:25:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-09-03T14:25:06Z</dc:date>
    <item>
      <title>Problem in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/7248407#M1527245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends&lt;/P&gt;&lt;P&gt;I am using a table a981 and fetching data in internal table but the table has a fieil Country whose technical name is ALAND in dev and LAND1 in production.Now i cannot use LAND1 as it wont let me to activate the report and if i use ALAND i cannot move the request to production as it fails. So how can i achive dynamic table field in the select query based on server.My query is-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 select kschl
           wkreg
           matnr
           knumh
   from a981 into corresponding fields of table it_a981
   for all entries in it_marc where matnr = it_marc-matnr
                                and kschl in ('MWST','ZSER')
                                and aland = 'IN'
                                and datab le sy-datum
                                and datbi ge sy-datum. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to make aland dynamic.Pls suggest&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Sep 2010 14:25:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/7248407#M1527245</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-03T14:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/7248408#M1527246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A981 is your own custom pricing condition table, it seems that the configuration is not consistent accross the system landscape. You should check with your functional consultants to set this straight, rather than working around the problem.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Sep 2010 14:28:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/7248408#M1527246</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2010-09-03T14:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/7248409#M1527247</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;check SY-SYSID field before executing your select query&lt;/P&gt;&lt;P&gt;if it is prd maintain your selection using land1 else your regular select query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Sep 2010 18:21:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/7248409#M1527247</guid>
      <dc:creator>anesh_kumar</dc:creator>
      <dc:date>2010-09-03T18:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/7248410#M1527248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the OR condition in your select query i.e (ALAND = IN' ' or LAND1 = 'IN'.)&lt;/P&gt;&lt;P&gt;I hope it will work, but as suggested the field names shhould be identical in development and production.Please chk with functionla consultanat before making the changes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Sep 2010 12:15:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/7248410#M1527248</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-05T12:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/7248411#M1527249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you insist on having a workaround, you could always create dynamic WHERE conditions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: cond TYPE string.

IF sy-sysid EQ &amp;lt;your dev sysid&amp;gt;.
    cond = 'matnr = it_marc-matnr
            and kschl in (''MWST'',''ZSER'')
            and datab le sy-datum
            and datbi ge sy-datum'
            and land1 = ''IN''.
ELSE.
    cond = 'matnr = it_marc-matnr
            and kschl in (''MWST'',''ZSER'')
            and datab le sy-datum
            and datbi ge sy-datum'
            and aland = ''IN''.
ENDIF.

select kschl
           wkreg
           matnr
           knumh
   from a981 into corresponding fields of table it_a981
   for all entries in it_marc where (cond).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;Kyle&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Sep 2010 02:41:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/7248411#M1527249</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-06T02:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/7248412#M1527250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Strange problem, but I think that you must use same FIELD NAME for your object both in DEV and PROD, otherwise it will not work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Sep 2010 07:20:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/7248412#M1527250</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-06T07:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/7248413#M1527251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check with functional, if table field could be changed or not?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Else &lt;/P&gt;&lt;P&gt;Dynamic select query with dynamic where condition can be used whihc kYle has mentioned clearly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create the where clause based on SYSID and try it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT (FIELD_TAB) &lt;/P&gt;&lt;P&gt;FROM    (TABLENAME)&lt;/P&gt;&lt;P&gt;WHERE  (WHERE_TAB)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Sep 2010 14:16:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/7248413#M1527251</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-13T14:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/7248414#M1527252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;please check for the versions of the table and try and correct the field names...seems like you have missed out with some transport...this kind of scenario is very weird..When ur working in a real time scenario then the Development Objects in all the relevant systems across the landscape should be in sync... so it cannot be that the fieldname in Developement and Production system would be different... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@gurus: when somebody has posted a question...please guide him in the right direction..what I mean to say is thr can be multiple solutions for an issue but then we have something called best practices which should be adhered to...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sitakant&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sitakant Tripathy on Sep 13, 2010 5:10 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Sep 2010 15:09:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/7248414#M1527252</guid>
      <dc:creator>sitakant_tripathy2</dc:creator>
      <dc:date>2010-09-13T15:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/7248415#M1527253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi i got the solution...These tables are custom and generated by SD functional....The table A980 and A981 is regenerated in production with same  field name. Thank You Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Sep 2010 14:29:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/7248415#M1527253</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-17T14:29:34Z</dc:date>
    </item>
  </channel>
</rss>

