<?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 adding one condition in where clause in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-adding-one-condition-in-where-clause/m-p/2089634#M434298</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;I am populating this internal table t_bkpf for all entries in gt_covp_ext&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  select bukrs belnr gjahr&lt;/P&gt;&lt;P&gt;         bldat budat cpudt&lt;/P&gt;&lt;P&gt;         xblnr waers awtyp awkey&lt;/P&gt;&lt;P&gt;         from bkpf&lt;/P&gt;&lt;P&gt;         into corresponding fields of table t_bkpf&lt;/P&gt;&lt;P&gt;         for all entries in gt_covp_ext&lt;/P&gt;&lt;P&gt;         where bukrs eq gt_covp_ext-bukrs and&lt;/P&gt;&lt;P&gt;               awtyp eq 'MKPF'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here i have to add one more condition in where clause&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AWKEY = ( Concatenated string of gt_covp_ext-REFBN + gt_covp_ext-REFGJ )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As i am not using loop at gt_covp_ext.How to implement this condition in Where clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.If you did not understood the requirement reply this post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mukesh Kumar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        mukesh kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Apr 2007 09:33:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-05T09:33:46Z</dc:date>
    <item>
      <title>Problem in adding one condition in where clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-adding-one-condition-in-where-clause/m-p/2089634#M434298</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;I am populating this internal table t_bkpf for all entries in gt_covp_ext&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  select bukrs belnr gjahr&lt;/P&gt;&lt;P&gt;         bldat budat cpudt&lt;/P&gt;&lt;P&gt;         xblnr waers awtyp awkey&lt;/P&gt;&lt;P&gt;         from bkpf&lt;/P&gt;&lt;P&gt;         into corresponding fields of table t_bkpf&lt;/P&gt;&lt;P&gt;         for all entries in gt_covp_ext&lt;/P&gt;&lt;P&gt;         where bukrs eq gt_covp_ext-bukrs and&lt;/P&gt;&lt;P&gt;               awtyp eq 'MKPF'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here i have to add one more condition in where clause&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AWKEY = ( Concatenated string of gt_covp_ext-REFBN + gt_covp_ext-REFGJ )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As i am not using loop at gt_covp_ext.How to implement this condition in Where clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.If you did not understood the requirement reply this post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mukesh Kumar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        mukesh kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2007 09:33:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-adding-one-condition-in-where-clause/m-p/2089634#M434298</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-05T09:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in adding one condition in where clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-adding-one-condition-in-where-clause/m-p/2089635#M434299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mukesh,&lt;/P&gt;&lt;P&gt; YOu have to have anothe fild to hold the concatenation of the fields REFBN and REFGJ , say AWKEY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at gt_covp_ext.
concatenate gt_covp_ext-refbn gt_covp_ext-refgj into gt_covp_ext-awkey.
modify gt_covp_ext index sy-tabix.
endloop.

select bukrs belnr gjahr
bldat budat cpudt
xblnr waers awtyp awkey
from bkpf
into corresponding fields of table t_bkpf
for all entries in gt_covp_ext
where bukrs eq gt_covp_ext-bukrs and
awtyp eq 'MKPF' and
&amp;lt;b&amp;gt;awkey = gt_covp_ext-awkey.&amp;lt;/b&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2007 09:37:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-adding-one-condition-in-where-clause/m-p/2089635#M434299</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-05T09:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in adding one condition in where clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-adding-one-condition-in-where-clause/m-p/2089636#M434300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;maintain one more field in that internal table like AWKEY &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;get the data &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 itab.&lt;/P&gt;&lt;P&gt;concatenate itab1 itab1 into itab-awkey.&lt;/P&gt;&lt;P&gt;modify itab.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;second select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;prabhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2007 09:37:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-adding-one-condition-in-where-clause/m-p/2089636#M434300</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-05T09:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in adding one condition in where clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-adding-one-condition-in-where-clause/m-p/2089637#M434301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;Ad one more add one more field to table  gt_covp_ext

data : begin of gt_covp_ext occurs 0,
          ....
          AWKEY(25),
         end of gt_covp_ext.

loop at gt_covp_ext into wa_gt_covp_ext.
   concatenate gt_covp_ext-REFBN  gt_covp_ext-REFGJ into wa_gt_covp_ext-AWKEY.
  modify gt_covp_ext from wa_gt_covp_ext.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not gt_covp_ext[] is initial.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;select bukrs belnr gjahr&lt;/P&gt;&lt;P&gt;bldat budat cpudt&lt;/P&gt;&lt;P&gt;xblnr waers awtyp awkey&lt;/P&gt;&lt;P&gt;from bkpf&lt;/P&gt;&lt;P&gt;into corresponding fields of table t_bkpf&lt;/P&gt;&lt;P&gt;for all entries in gt_covp_ext&lt;/P&gt;&lt;P&gt;where bukrs eq gt_covp_ext-bukrs and&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;         AWKEY = gt_covp_ext-AWKEY&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;awtyp eq 'MKPF' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2007 09:38:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-adding-one-condition-in-where-clause/m-p/2089637#M434301</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-05T09:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in adding one condition in where clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-adding-one-condition-in-where-clause/m-p/2089638#M434302</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 to do that before doing the query on BKPF, so add the field AWKEY in gt_covp_ext.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT gt_covp_ext.

  CONCATENATE gt_covp_ext-REFBN  gt_covp_ext-REFGJ INTO gt_covp_ext-AWKEY.
  MODIFY gt_covp_ext.
ENDLOOP. 

select bukrs belnr gjahr bldat budat cpudt xblnr waers awtyp awkey
   from bkpf into corresponding fields of table t_bkpf
                                        for all entries in gt_covp_ext
                                                where awtyp eq 'MKPF'
                                                  AND AWKEY EQ  gt_covp_ext-AWKEY.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;U don't need to use BUKRS in where condition, because there's an index using AWTYP and AWKEY only.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2007 09:39:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-adding-one-condition-in-where-clause/m-p/2089638#M434302</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-05T09:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in adding one condition in where clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-adding-one-condition-in-where-clause/m-p/2089639#M434303</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;Create a new internal table gt_covp_ext_new with the same structure as gt_covp_ext. Include an extra field in gt_covp_ext_new-concat,  to store the concatenated value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Copy all entries from gt_covp_ext to gt_covp_ext_new.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at gt_covp_ext.&lt;/P&gt;&lt;P&gt;move-corresponding gt_covp_ext to gt_covp_ext_new.&lt;/P&gt;&lt;P&gt;gt_covp_ext_new-concat = gt_covp_ext-REFBN + gt_covp_ext-REFGJ .&lt;/P&gt;&lt;P&gt;append gt_covp_ext_new.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now use this new internal table in the query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select bukrs belnr gjahr&lt;/P&gt;&lt;P&gt;bldat budat cpudt&lt;/P&gt;&lt;P&gt;xblnr waers awtyp awkey&lt;/P&gt;&lt;P&gt;from bkpf&lt;/P&gt;&lt;P&gt;into corresponding fields of table t_bkpf&lt;/P&gt;&lt;P&gt;for all entries in gt_covp_ext_new&lt;/P&gt;&lt;P&gt;where bukrs eq gt_covp_ext_new-bukrs and&lt;/P&gt;&lt;P&gt;awkey eq  gt_covp_ext_new-concat and&lt;/P&gt;&lt;P&gt;awtyp eq 'MKPF'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this answers your qn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Divya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2007 09:41:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-adding-one-condition-in-where-clause/m-p/2089639#M434303</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-05T09:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in adding one condition in where clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-adding-one-condition-in-where-clause/m-p/2089640#M434304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as far as i got the knowledge from your post ,you want to add the next condition with your first select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont think there is any statement in sap like "Concatenated string of " as you have mentione din your second statement,so try to use the CONCATENATE statement outside the select query and than try to use that particular value in your existing select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2007 09:41:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-adding-one-condition-in-where-clause/m-p/2089640#M434304</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-05T09:41:57Z</dc:date>
    </item>
  </channel>
</rss>

