<?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 where condition problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-problem/m-p/5314582#M1225277</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts &lt;/P&gt;&lt;P&gt;My sel SCr has&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(all are select option)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Customer number - KUNNR&lt;/P&gt;&lt;P&gt;region          - REGIO&lt;/P&gt;&lt;P&gt;date            -BLDAT&lt;/P&gt;&lt;P&gt;company code    -BUKRS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for (EG) if i have customer 00001 in Region AP . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to my input even i give TN its fetching the output&lt;/P&gt;&lt;P&gt;leaving my customer name(kna1-name1) blank &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you pls help me out saying where i have gone wrong???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MY CODE&lt;/P&gt;&lt;P&gt;======&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select bukrs  gjahr belnr blart bldat budat xblnr bktxt xreversal from bkpf&lt;/P&gt;&lt;P&gt;                                into corresponding fields of table it_bkpf&lt;/P&gt;&lt;P&gt;                                 where bukrs = pr_bukrs&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                                and  gjahr = wa_bkpf-gjahr&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                                  and  belnr = wa_bkpf-belnr&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                                 and blart = 'DH' and&lt;/P&gt;&lt;P&gt;                                 budat in so_budat&lt;/P&gt;&lt;P&gt;                                 and  xreversal = ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it_bkpf[] is not initial.&lt;/P&gt;&lt;P&gt;**Selection item  details based on distributor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select bukrs belnr gjahr buzei  kunnr dmbtr zuonr from bseg&lt;/P&gt;&lt;P&gt;                             into corresponding fields of table it_bseg&lt;/P&gt;&lt;P&gt;                             for all entries in it_bkpf&lt;/P&gt;&lt;P&gt;                              where bukrs = it_bkpf-bukrs and&lt;/P&gt;&lt;P&gt;                              gjahr = it_bkpf-gjahr and&lt;/P&gt;&lt;P&gt;                              belnr = it_bkpf-belnr and&lt;/P&gt;&lt;P&gt;                              kunnr in so_kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it_bseg[] is not initial.&lt;/P&gt;&lt;P&gt;**Selection region for distributor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select kunnr regio name1 from kna1&lt;/P&gt;&lt;P&gt;                    into corresponding fields of table it_kna1&lt;/P&gt;&lt;P&gt;                    for all entries in it_bseg&lt;/P&gt;&lt;P&gt;                    where kunnr = it_bseg-kunnr&lt;/P&gt;&lt;P&gt;                    and regio in so_regio.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at it_bseg into wa_bseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if  wa_bseg-kunnr &amp;lt;&amp;gt; ' ' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; wa_final-belnr = wa_bseg-belnr.&lt;/P&gt;&lt;P&gt; wa_final-dmbtr = wa_bseg-dmbtr.&lt;/P&gt;&lt;P&gt; wa_final-zuonr = wa_bseg-zuonr.&lt;/P&gt;&lt;P&gt; wa_final-kunnr = wa_bseg-kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it_bkpf into wa_bkpf with key belnr = wa_bseg-belnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_final-bldat = wa_bkpf-bldat.&lt;/P&gt;&lt;P&gt;wa_final-budat = wa_bkpf-budat.&lt;/P&gt;&lt;P&gt;wa_final-xblnr = wa_bkpf-xblnr.&lt;/P&gt;&lt;P&gt;wa_final-bktxt = wa_bkpf-bktxt.&lt;/P&gt;&lt;P&gt;ead table it_kna1 into wa_kna1 with key kunnr = wa_bseg-kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_final-name1 = wa_kna1-name1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append wa_final to it_final.&lt;/P&gt;&lt;P&gt;clear wa_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Mar 2009 12:42:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-03-10T12:42:33Z</dc:date>
    <item>
      <title>where condition problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-problem/m-p/5314582#M1225277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts &lt;/P&gt;&lt;P&gt;My sel SCr has&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(all are select option)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Customer number - KUNNR&lt;/P&gt;&lt;P&gt;region          - REGIO&lt;/P&gt;&lt;P&gt;date            -BLDAT&lt;/P&gt;&lt;P&gt;company code    -BUKRS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for (EG) if i have customer 00001 in Region AP . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to my input even i give TN its fetching the output&lt;/P&gt;&lt;P&gt;leaving my customer name(kna1-name1) blank &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you pls help me out saying where i have gone wrong???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MY CODE&lt;/P&gt;&lt;P&gt;======&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select bukrs  gjahr belnr blart bldat budat xblnr bktxt xreversal from bkpf&lt;/P&gt;&lt;P&gt;                                into corresponding fields of table it_bkpf&lt;/P&gt;&lt;P&gt;                                 where bukrs = pr_bukrs&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                                and  gjahr = wa_bkpf-gjahr&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                                  and  belnr = wa_bkpf-belnr&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                                 and blart = 'DH' and&lt;/P&gt;&lt;P&gt;                                 budat in so_budat&lt;/P&gt;&lt;P&gt;                                 and  xreversal = ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it_bkpf[] is not initial.&lt;/P&gt;&lt;P&gt;**Selection item  details based on distributor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select bukrs belnr gjahr buzei  kunnr dmbtr zuonr from bseg&lt;/P&gt;&lt;P&gt;                             into corresponding fields of table it_bseg&lt;/P&gt;&lt;P&gt;                             for all entries in it_bkpf&lt;/P&gt;&lt;P&gt;                              where bukrs = it_bkpf-bukrs and&lt;/P&gt;&lt;P&gt;                              gjahr = it_bkpf-gjahr and&lt;/P&gt;&lt;P&gt;                              belnr = it_bkpf-belnr and&lt;/P&gt;&lt;P&gt;                              kunnr in so_kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it_bseg[] is not initial.&lt;/P&gt;&lt;P&gt;**Selection region for distributor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select kunnr regio name1 from kna1&lt;/P&gt;&lt;P&gt;                    into corresponding fields of table it_kna1&lt;/P&gt;&lt;P&gt;                    for all entries in it_bseg&lt;/P&gt;&lt;P&gt;                    where kunnr = it_bseg-kunnr&lt;/P&gt;&lt;P&gt;                    and regio in so_regio.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at it_bseg into wa_bseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if  wa_bseg-kunnr &amp;lt;&amp;gt; ' ' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; wa_final-belnr = wa_bseg-belnr.&lt;/P&gt;&lt;P&gt; wa_final-dmbtr = wa_bseg-dmbtr.&lt;/P&gt;&lt;P&gt; wa_final-zuonr = wa_bseg-zuonr.&lt;/P&gt;&lt;P&gt; wa_final-kunnr = wa_bseg-kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it_bkpf into wa_bkpf with key belnr = wa_bseg-belnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_final-bldat = wa_bkpf-bldat.&lt;/P&gt;&lt;P&gt;wa_final-budat = wa_bkpf-budat.&lt;/P&gt;&lt;P&gt;wa_final-xblnr = wa_bkpf-xblnr.&lt;/P&gt;&lt;P&gt;wa_final-bktxt = wa_bkpf-bktxt.&lt;/P&gt;&lt;P&gt;ead table it_kna1 into wa_kna1 with key kunnr = wa_bseg-kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_final-name1 = wa_kna1-name1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append wa_final to it_final.&lt;/P&gt;&lt;P&gt;clear wa_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2009 12:42:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-problem/m-p/5314582#M1225277</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-10T12:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: where condition problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-problem/m-p/5314583#M1225278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;It seems ok except one thing before end loop, you should clear the work areas too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What problem you have ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shasi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2009 12:47:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-problem/m-p/5314583#M1225278</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-10T12:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: where condition problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-problem/m-p/5314584#M1225279</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 hope your code is not the same the way you mentioned well still you can try to put a breakpoint and see what all values you are getting in it_kna1 table and then match those entries with the entries in the database if for the given kunnr their is no name1 maintained in kna1 then it will not appear in your report.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2009 12:52:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-problem/m-p/5314584#M1225279</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-10T12:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: where condition problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-problem/m-p/5314585#M1225280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;It seems ok except one thing before end loop, you should clear the work areas too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What problem you have ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shasi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2009 12:53:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-problem/m-p/5314585#M1225280</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-10T12:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: where condition problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-problem/m-p/5314586#M1225281</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 hope your code is not the same the way you mentioned well still you can try to put a breakpoint and see what all values you are getting in it_kna1 table and then match those entries with the entries in the database if for the given kunnr their is no name1 maintained in kna1 then it will not appear in your report.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2009 12:59:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-problem/m-p/5314586#M1225281</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-10T12:59:53Z</dc:date>
    </item>
  </channel>
</rss>

