<?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: help in select statement... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-select-statement/m-p/1216930#M135145</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1.If there is matnr found in COOI, then y the need to shift to eban?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.check whether OBJNR matches in both the tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. check &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE a~psphi IN so_psphi&lt;/P&gt;&lt;P&gt;AND a~pbukr = pa_bukrs&lt;/P&gt;&lt;P&gt;AND a~erdat LE v_budat&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;AND a~erdat in so_augdt&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;AND b~refbn IN so_ebeln&lt;/P&gt;&lt;P&gt;AND b~lifnr IN so_lifnr&lt;/P&gt;&lt;P&gt;AND b~matnr IN so_matnr&lt;/P&gt;&lt;P&gt;AND b~rfart = 'P'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the above where condition,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check particularly, &amp;lt;b&amp;gt;for pa_burks and RFART,and v_budat&amp;lt;/b&amp;gt; for the values u r providing , the record exists or not, because for the other as they are select options , not a problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Mar 2006 02:44:14 GMT</pubDate>
    <dc:creator>hymavathi_oruganti</dc:creator>
    <dc:date>2006-03-02T02:44:14Z</dc:date>
    <item>
      <title>help in select statement...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-select-statement/m-p/1216928#M135143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am currently having a hard time modifying a select statement. I was tasked to change the select statement because when a user types in a material number in the selection screen and execute it the report says no records found. But when I checked in cooi-matnr the material number exists. So my boss said that instead of using cooi I must eban. But my problem is how can I join eban with the existing select statement and also I am thinking if I would seperate this select statement. Also, in the existing select statement, instead of comparing cooi-refbn in so_ebeln and cooi-matnr in so_matnr I would use eban instead. Is this right? Help would really be appreciated. Thanks guys and take care!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**&lt;STRONG&gt;here is the selection screen&lt;/STRONG&gt;**&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.&lt;/P&gt;&lt;P&gt;PARAMETERS:     pa_bukrs LIKE t001-bukrs OBLIGATORY DEFAULT 'GLOB'.&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: so_psphi FOR  prps-psphi,&lt;/P&gt;&lt;P&gt;                so_ebeln FOR  ekko-ebeln,&lt;/P&gt;&lt;P&gt;                so_lifnr FOR  ekko-lifnr,&lt;/P&gt;&lt;P&gt;                so_matnr FOR  ekpo-matnr.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               so_augdt FOR  bseg-augdt.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;PARAMETERS:     pa_augdt LIKE bseg-augdt.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**&lt;STRONG&gt;here is the select statement&lt;/STRONG&gt;**&lt;/P&gt;&lt;P&gt;IF NOT so_ebeln[] IS INITIAL.&lt;/P&gt;&lt;P&gt;    PERFORM get_header.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT a&lt;SUB&gt;psphi b&lt;/SUB&gt;refbn b~lifnr&lt;/P&gt;&lt;P&gt;        FROM prps AS a INNER JOIN cooi AS b&lt;/P&gt;&lt;P&gt;           ON a&lt;SUB&gt;objnr = b&lt;/SUB&gt;objnr&lt;/P&gt;&lt;P&gt;          INTO CORRESPONDING FIELDS OF it_hdr&lt;/P&gt;&lt;P&gt;        WHERE a~psphi IN so_psphi&lt;/P&gt;&lt;P&gt;          AND a~pbukr = pa_bukrs&lt;/P&gt;&lt;P&gt;          AND a~erdat LE v_budat&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         AND a~erdat in so_augdt&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          AND b~refbn IN so_ebeln&lt;/P&gt;&lt;P&gt;          AND b~lifnr IN so_lifnr&lt;/P&gt;&lt;P&gt;          AND b~matnr IN so_matnr&lt;/P&gt;&lt;P&gt;          AND b~rfart = 'P'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Mar 2006 01:05:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-select-statement/m-p/1216928#M135143</guid>
      <dc:creator>aris_hidalgo</dc:creator>
      <dc:date>2006-03-02T01:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: help in select statement...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-select-statement/m-p/1216929#M135144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To make it more readable I would recode your sql like this:&lt;/P&gt;&lt;P&gt;SELECT prps&lt;SUB&gt;psphi cooi&lt;/SUB&gt;refbn cooi~lifnr&lt;/P&gt;&lt;P&gt;FROM prps INNER JOIN cooi &lt;/P&gt;&lt;P&gt;ON prps&lt;SUB&gt;objnr = cooi&lt;/SUB&gt;objnr&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF it_hdr&lt;/P&gt;&lt;P&gt;WHERE prps~psphi IN so_psphi&lt;/P&gt;&lt;P&gt;AND prps~pbukr = pa_bukrs&lt;/P&gt;&lt;P&gt;AND prps~erdat LE v_budat&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;AND prps~erdat in so_augdt&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;AND cooi~refbn IN so_ebeln&lt;/P&gt;&lt;P&gt;AND cooi~lifnr IN so_lifnr&lt;/P&gt;&lt;P&gt;AND cooi~matnr IN so_matnr&lt;/P&gt;&lt;P&gt;AND cooi~rfart = 'P'.&lt;/P&gt;&lt;P&gt;...........................&lt;/P&gt;&lt;P&gt;1. you say the record is in cooi, what objnr does it have and does that match the objnr in prps? If it doesn't match that's why no records are found.&lt;/P&gt;&lt;P&gt;2. check all the other criteria too, eg psphi, bukrs etc. If your select is not finding a record there must be a reason for that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Mar 2006 01:14:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-select-statement/m-p/1216929#M135144</guid>
      <dc:creator>former_member186741</dc:creator>
      <dc:date>2006-03-02T01:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: help in select statement...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-select-statement/m-p/1216930#M135145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1.If there is matnr found in COOI, then y the need to shift to eban?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.check whether OBJNR matches in both the tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. check &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE a~psphi IN so_psphi&lt;/P&gt;&lt;P&gt;AND a~pbukr = pa_bukrs&lt;/P&gt;&lt;P&gt;AND a~erdat LE v_budat&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;AND a~erdat in so_augdt&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;AND b~refbn IN so_ebeln&lt;/P&gt;&lt;P&gt;AND b~lifnr IN so_lifnr&lt;/P&gt;&lt;P&gt;AND b~matnr IN so_matnr&lt;/P&gt;&lt;P&gt;AND b~rfart = 'P'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the above where condition,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check particularly, &amp;lt;b&amp;gt;for pa_burks and RFART,and v_budat&amp;lt;/b&amp;gt; for the values u r providing , the record exists or not, because for the other as they are select options , not a problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Mar 2006 02:44:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-select-statement/m-p/1216930#M135145</guid>
      <dc:creator>hymavathi_oruganti</dc:creator>
      <dc:date>2006-03-02T02:44:14Z</dc:date>
    </item>
  </channel>
</rss>

