<?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: Problem with select query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3966422#M947413</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check the first internal table if is initial or not. and then come up with a clear condtion in the where part of the query&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Jun 2008 13:14:44 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-11T13:14:44Z</dc:date>
    <item>
      <title>Problem with select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3966420#M947411</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 had a requirment as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the Selection screen i have 4 blocks.&lt;/P&gt;&lt;P&gt;in the first block i have company code.&lt;/P&gt;&lt;P&gt;second block:&lt;/P&gt;&lt;P&gt;Customer ID&lt;/P&gt;&lt;P&gt;Industry key:&lt;/P&gt;&lt;P&gt;third block:&lt;/P&gt;&lt;P&gt;Posting document type:&lt;/P&gt;&lt;P&gt;posting date&lt;/P&gt;&lt;P&gt;clearing date&lt;/P&gt;&lt;P&gt;debit/credit indicator&lt;/P&gt;&lt;P&gt;offsetting account type&lt;/P&gt;&lt;P&gt;offsetting account&lt;/P&gt;&lt;P&gt;minimum amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have designed above selection screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To featch the data there is two rules.&lt;/P&gt;&lt;P&gt;1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT	Customer KNA1-KUNNR, &lt;/P&gt;&lt;P&gt;BP name KNA1-NAME1, &lt;/P&gt;&lt;P&gt;BP street address KNA1-STRAS, &lt;/P&gt;&lt;P&gt;BP post code KNA1-PSTLZ, &lt;/P&gt;&lt;P&gt;BP city KNA1-ORT01 &lt;/P&gt;&lt;P&gt;BP country KNA1-LAND1&lt;/P&gt;&lt;P&gt;FROM	KNA1 &lt;/P&gt;&lt;P&gt;WHERE	KNA1-KUNNR and KNA1-BRSCH correspond to values from u201Ccustomer master selectionu201D on selection screen. &lt;/P&gt;&lt;P&gt; for the above i have return the code as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select kunnr&lt;/P&gt;&lt;P&gt;       name1&lt;/P&gt;&lt;P&gt;       stras&lt;/P&gt;&lt;P&gt;       pstlz&lt;/P&gt;&lt;P&gt;       ort01&lt;/P&gt;&lt;P&gt;       land1&lt;/P&gt;&lt;P&gt;       from kna1 into table it_kna1 where kunnr in kunnr and brsch in&lt;/P&gt;&lt;P&gt;brsch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For customers, selected in p.2, Select from BSAD payment items corresponding to selection criteria for payment documents from selection screen&lt;/P&gt;&lt;P&gt;Fields to select&lt;/P&gt;&lt;P&gt;	Document type BSAD u2013 BLART&lt;/P&gt;&lt;P&gt;	Document number BSAD-BELNR&lt;/P&gt;&lt;P&gt;	Customer BSAD-KUNNR&lt;/P&gt;&lt;P&gt;	Text BSAD-SGTXT (Contract nb)&lt;/P&gt;&lt;P&gt;	Offsetting account (*see Rule 1)&lt;/P&gt;&lt;P&gt;	Payment type (**see Rule 2)see &lt;/P&gt;&lt;P&gt;	Payment amount (to get from offsetting GL account)&lt;/P&gt;&lt;P&gt;	Posting date BSAD-BUDAT, &lt;/P&gt;&lt;P&gt;	Clearing date BSAD-AUGDT, &lt;/P&gt;&lt;P&gt;	Clearing document BSAD-AUGBL&lt;/P&gt;&lt;P&gt;	Reference BSAD-XBLNR (bordereau)&lt;/P&gt;&lt;P&gt;	Assignement BSAD-ZUONR (cheque nb)&lt;/P&gt;&lt;P&gt;	Debit/credit indicator BSAD-SHKZG&lt;/P&gt;&lt;P&gt;	Amount BSEG-DMBTR (*see Rule 1)&lt;/P&gt;&lt;P&gt;Sort by customer (BSAD-KUNNR) and payment type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for the above how to featch the data i am not getting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Two rules to select the above off setting account and pament type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rule 1 &lt;/P&gt;&lt;P&gt;SELECT	offsetting account number BSEG-HKONT and BSEG-DMBTR from BSEG&lt;/P&gt;&lt;P&gt;WHERE	BSEG-BELNR = BSAD-BELNR and BSEG-KOART = offsetting account type from selection screen and BSEG-DMBTR bigger then minimum amount from selection screen for payment documents.&lt;/P&gt;&lt;P&gt;Rule 2&lt;/P&gt;&lt;P&gt;IF	((document type = BT and offsetting account = 550000011) or (document type = ZF and offsetting account = 550000011))  THEN payment type = CASH&lt;/P&gt;&lt;P&gt;IF	((document type = ZF and offsetting account = 550##03 or 550##12) or (document type = DM))  THEN payment type = CHEQUE&lt;/P&gt;&lt;P&gt;IF	(document type = BT and offsetting account = 550##06) THEN payment type = VIREMENT&lt;/P&gt;&lt;P&gt;IF	(document type = DZ and offsetting account = 550##05) THEN payment type = PRELEVEMENT &lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please help me how to get the data in the above case.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 10:45:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3966420#M947411</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T10:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3966421#M947412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To the above questuion i am trying to write the query in the following format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select kunnr&lt;/P&gt;&lt;P&gt;       name1&lt;/P&gt;&lt;P&gt;       stras&lt;/P&gt;&lt;P&gt;       pstlz&lt;/P&gt;&lt;P&gt;       ort01&lt;/P&gt;&lt;P&gt;       land1&lt;/P&gt;&lt;P&gt;       from kna1 into table it_kna1 where kunnr in kunnr and brsch in&lt;/P&gt;&lt;P&gt;brsch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select blart belnr kunnr xblnr zuonr sgtxt budat augdt augbl shkzg from&lt;/P&gt;&lt;P&gt;bsad INTO CORRESPONDING FIELDS OF TABLE it_item1&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN it_kna1&lt;/P&gt;&lt;P&gt;where kunnr = it_kna1-kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when it is comming to select for all entries it is going to dump,can any body help in this problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 12:48:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3966421#M947412</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T12:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3966422#M947413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check the first internal table if is initial or not. and then come up with a clear condtion in the where part of the query&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 13:14:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3966422#M947413</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T13:14:44Z</dc:date>
    </item>
  </channel>
</rss>

