<?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: Reg : select query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-select-query/m-p/4328618#M1031362</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI ambarish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand that your requirement has changed now as earlier you have to check teh indicator but now that is not required....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what you can do now is :-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the first select query ,select the records from the z table based on the plant entered on the selection screen into internal table itab_table3.&lt;/P&gt;&lt;P&gt;After that in the internal table there might be manyentries with so i have to take all the materials corresponding to the material type .the second select query should be  written for that.&lt;/P&gt;&lt;P&gt;Now READ that table and delete the entries where the material number is  not *.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best of luck,&lt;/P&gt;&lt;P&gt;Bhumika&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Aug 2008 06:59:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-08-14T06:59:13Z</dc:date>
    <item>
      <title>Reg : select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-select-query/m-p/4328617#M1031361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all the requirement is as follows .in the first select query we select the records from the z table based on the plant entered on the selection screen into internal table itab_table3.After that in the internal table there might be material number entries with * so i have to take all the materials corresponding to the material type .the second select query is written for that only .i am deleting all the records wherever exclude indicator is x . but now the requirement is that i need to delete the records when material number is not equal to * .bcoz all the records are fetched corresponding to the single material type .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Querying the table3 for plant entered on selection screen and&lt;/P&gt;&lt;P&gt;*--getting material no. and type&lt;/P&gt;&lt;P&gt;  SELECT werks mtart matnr exclude INTO TABLE&lt;/P&gt;&lt;P&gt;  itab_table3 FROM zwm_tbl_mat_alog WHERE werks IN s_werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT itab_table3 INTO wa_exclude WHERE exclude EQ ' '.&lt;/P&gt;&lt;P&gt;    MOVE wa_exclude TO itab_exclude.&lt;/P&gt;&lt;P&gt;    APPEND  itab_exclude .&lt;/P&gt;&lt;P&gt;    CLEAR wa_exclude.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Filtering out the records which are obtained from table3&lt;/P&gt;&lt;P&gt;  IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;    IF NOT itab_table3[] IS INITIAL.&lt;/P&gt;&lt;P&gt;      SELECT mara&lt;SUB&gt;matnr mara&lt;/SUB&gt;mtart&lt;/P&gt;&lt;P&gt;        mchb&lt;SUB&gt;werks mchb&lt;/SUB&gt;charg mchb~clabs&lt;/P&gt;&lt;P&gt;          INTO CORRESPONDING FIELDS OF TABLE itab_mchb_join&lt;/P&gt;&lt;P&gt;            FROM mara AS mara JOIN mchb AS mchb&lt;/P&gt;&lt;P&gt;              ON mara&lt;SUB&gt;matnr = mchb&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;                FOR ALL ENTRIES IN itab_exclude&lt;/P&gt;&lt;P&gt;                  WHERE mtart = itab_exclude-mtart&lt;/P&gt;&lt;P&gt;                    AND werks IN s_werks.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt; LOOP AT itab_table3 WHERE exclude EQ 'X'.&lt;/P&gt;&lt;P&gt;    DELETE itab_mchb_join WHERE matnr = itab_table3-matnr.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2008 06:48:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-select-query/m-p/4328617#M1031361</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-14T06:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Reg : select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-select-query/m-p/4328618#M1031362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI ambarish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand that your requirement has changed now as earlier you have to check teh indicator but now that is not required....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what you can do now is :-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the first select query ,select the records from the z table based on the plant entered on the selection screen into internal table itab_table3.&lt;/P&gt;&lt;P&gt;After that in the internal table there might be manyentries with so i have to take all the materials corresponding to the material type .the second select query should be  written for that.&lt;/P&gt;&lt;P&gt;Now READ that table and delete the entries where the material number is  not *.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best of luck,&lt;/P&gt;&lt;P&gt;Bhumika&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2008 06:59:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-select-query/m-p/4328618#M1031362</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-14T06:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: Reg : select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-select-query/m-p/4328619#M1031363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;Follow like this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create one more internal table with the same structure where you are getting the values,&lt;/P&gt;&lt;P&gt;Follow the logic like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA :STR1 type string value '*'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab1 into wa_itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if wa_itab1-matnr &lt;STRONG&gt;CA&lt;/STRONG&gt; STR1.&lt;/P&gt;&lt;P&gt; move wa_itab1 to wa_itab2.&lt;/P&gt;&lt;P&gt;append wa_itab2 to it_itab2.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you will get the desired values in the it_itab2 table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will helpfull for you,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;KP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: krishna prasad on Aug 14, 2008 9:19 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: krishna prasad on Aug 14, 2008 9:19 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2008 07:18:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-select-query/m-p/4328619#M1031363</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-14T07:18:54Z</dc:date>
    </item>
  </channel>
</rss>

