<?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 Query problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-problem/m-p/6645006#M1444036</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;add condition for VBRK where sales office (VKBUR) as per selection screen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Feb 2010 09:39:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-02-16T09:39:21Z</dc:date>
    <item>
      <title>Select Query problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-problem/m-p/6645005#M1444035</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;My Report is working fine but we want report on basis of sales office wise..means Branch employee can see only own data not of other branches.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My query is on VBRK and picking the Billing document from there. for Sales office wise data, we must goto VBRP table...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I query on VBRP and in selection screen put the Sales office input criteria.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when i am inserting 1 billing document of AAA Sales office, but in sales office inserting BBB Sales office, then the output shows. It must not show because billing document is of AAA Sales office not BBB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Query is..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM vbrk WHERE vbeln IN vbeln AND ( fkart = 'ZG1' OR fkart = 'ZG2' OR fkart = 'RE' OR fkart = 'ZWCN' OR fkart = 'G2' ) AND rfbsk EQ 'C'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF vbrk-fkart = 'ZG1'.&lt;/P&gt;&lt;P&gt;    line10 = 'YOUR ACCOUNT WITH US HAS BEEN CREDITED WITH THE AMOUNT AS MENTIONED BELOW FOR PRICE DIFFERENCE AGAINST,'.&lt;/P&gt;&lt;P&gt;  ELSEIF vbrk-fkart = 'ZG2'.&lt;/P&gt;&lt;P&gt;    line10 = 'YOUR ACCOUNT WITH US HAS BEEN CREDITED WITH THE AMOUNT AS MENTIONED BELOW FOR INCENTIVE AGAINST,'.&lt;/P&gt;&lt;P&gt;  ELSEIF vbrk-fkart = 'RE'.&lt;/P&gt;&lt;P&gt;    line10 = 'YOUR ACCOUNT WITH US HAS BEEN CREDITED WITH THE AMOUNT AS MENTIONED BELOW CREDIT FOR RETURN AGAINST,'.&lt;/P&gt;&lt;P&gt;  ELSEIF vbrk-fkart = 'ZWCN'.&lt;/P&gt;&lt;P&gt;    line10 = 'YOUR ACCOUNT WITH US HAS BEEN CREDITED WITH THE AMOUNT AS MENTIONED BELOW FOR WARRENTY CREDIT NOTE AGAINST,'.&lt;/P&gt;&lt;P&gt;  ELSEIF vbrk-fkart = 'G2'.&lt;/P&gt;&lt;P&gt;    line10 = 'YOUR ACCOUNT WITH US HAS BEEN CREDITED WITH THE AMOUNT AS MENTIONED BELOW FOR CREDIT MEMO AGAINST,'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF itab-vbeln = vbrp-vbeln.&lt;/P&gt;&lt;P&gt;    SELECT SINGLE vkbur FROM vbrp INTO itab-vkbur WHERE vbeln = itab-vbeln AND vbeln IN vbeln AND vkbur IN vkbur.&lt;/P&gt;&lt;P&gt;  ELSE.&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;plz. help..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2010 09:31:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-problem/m-p/6645005#M1444035</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-16T09:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-problem/m-p/6645006#M1444036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;add condition for VBRK where sales office (VKBUR) as per selection screen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2010 09:39:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-problem/m-p/6645006#M1444036</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-16T09:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-problem/m-p/6645007#M1444037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in which query i add condition...for VBRK or VBRP...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2010 09:51:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-problem/m-p/6645007#M1444037</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-16T09:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-problem/m-p/6645008#M1444038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;as VBRK is header you have to add there.. and while selecting data from VBAP which is item details then match VBRK fields including sales office in where condition...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2010 09:54:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-problem/m-p/6645008#M1444038</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-16T09:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-problem/m-p/6645009#M1444039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear @ABAP@ &lt;/P&gt;&lt;P&gt;your problem is solved or not?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2010 10:18:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-problem/m-p/6645009#M1444039</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-16T10:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-problem/m-p/6645010#M1444040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can join tables VBRK and VBRP on the basis ob vbeln and give the sales office in where condition alsong with other required values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exapmle&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select VBRK &lt;SUB&gt;vbeln  vbrk&lt;/SUB&gt;fkart&lt;/P&gt;&lt;P&gt;VBRP~posnr&lt;/P&gt;&lt;P&gt;into table itab&lt;/P&gt;&lt;P&gt;from VBRK inner join VBRP&lt;/P&gt;&lt;P&gt;on VBRK&lt;SUB&gt;vbeln = VBRP&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;VBRK~vbeln in s_vbelb (select options for vbeln) and&lt;/P&gt;&lt;P&gt;VBRP~VKBUR in s_vkbur (select options for sales office).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now can can loop itab and do further processing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;if itab-fkart = 'RE'.&lt;/P&gt;&lt;P&gt;............&lt;/P&gt;&lt;P&gt;elseif.&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, 16 Feb 2010 11:02:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-problem/m-p/6645010#M1444040</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-16T11:02:21Z</dc:date>
    </item>
  </channel>
</rss>

