<?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: RANGES in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/ranges/m-p/2735775#M635424</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think just like the select options you can use Ranges in your WHERE condition of query.&lt;/P&gt;&lt;P&gt;Select count(*) from MARA where matnr in r_matnr.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;message E000(00) with 'Materials do not exist'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Kriss&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Aug 2007 19:34:07 GMT</pubDate>
    <dc:creator>former_member192429</dc:creator>
    <dc:date>2007-08-30T19:34:07Z</dc:date>
    <item>
      <title>RANGES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ranges/m-p/2735772#M635421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i Have declared a range R_matnr which gets its values from an internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to check if the R_Matnr values are present in the table MARA or not . If they are not present then simply flag an error message. What is the simplest procedure.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2007 19:29:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ranges/m-p/2735772#M635421</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-30T19:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: RANGES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ranges/m-p/2735773#M635422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Select single * from mara 
           into mara where
               matnr in r_matnr.
if sy-subrc ne 0.
   "&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; Error
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2007 19:32:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ranges/m-p/2735773#M635422</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-08-30T19:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: RANGES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ranges/m-p/2735774#M635423</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;SELECT matnr&lt;/P&gt;&lt;P&gt;INTO w_matnr&lt;/P&gt;&lt;P&gt;FROM MARA&lt;/P&gt;&lt;P&gt;UPTO 1 ROWS&lt;/P&gt;&lt;P&gt;WHERE matnr IN r_matnr.&lt;/P&gt;&lt;P&gt;if sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MESSAGE exxx with 'text.&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;Thanks and Best Regards,&lt;/P&gt;&lt;P&gt;Vikas Bittera.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**&lt;STRONG&gt;Reward if useful&lt;/STRONG&gt;**&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2007 19:33:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ranges/m-p/2735774#M635423</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-30T19:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: RANGES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ranges/m-p/2735775#M635424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think just like the select options you can use Ranges in your WHERE condition of query.&lt;/P&gt;&lt;P&gt;Select count(*) from MARA where matnr in r_matnr.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;message E000(00) with 'Materials do not exist'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Kriss&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2007 19:34:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ranges/m-p/2735775#M635424</guid>
      <dc:creator>former_member192429</dc:creator>
      <dc:date>2007-08-30T19:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: RANGES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ranges/m-p/2735776#M635425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you want to know if any of them are in MARA or if all of them are in MARA? If you have to know if all of them are in MARA or not, you have to loop as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at r_matnr.&lt;/P&gt;&lt;P&gt;select single * from mara where matnr = r_matnr-low. &amp;lt;-- assuming you have them as single values, not ranges.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;*-- this is not there.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you don't care about each one of them but at least one should be there, then you can simply do this&lt;/P&gt;&lt;P&gt;select count( * ) from mara where matnr in r_matnr.&lt;/P&gt;&lt;P&gt;if sy-dbcnt &amp;gt; 0.&lt;/P&gt;&lt;P&gt;*-- At least one is there&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2007 19:35:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ranges/m-p/2735776#M635425</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-30T19:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: RANGES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ranges/m-p/2735777#M635426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DATA: W_MARA TYPE MARA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM MARA INTO W_MARA WHERE MATNR IN R_MATNR.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;*message.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2007 19:35:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ranges/m-p/2735777#M635426</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-30T19:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: RANGES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ranges/m-p/2735778#M635427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Krish &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume you want to check whether all material numbers in your range are actually found in MARA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZUS_SDN_SELECT_NOT_EXISTS
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*

REPORT  zus_sdn_select_not_exists.



DATA:
  gd_count    TYPE i,
  gt_matnr    TYPE RANGE OF matnr,
  gs_rng      LIKE LINE OF gt_matnr.




START-OF-SELECTION.

  gs_rng-sign   = 'I'.
  gs_rng-option = 'EQ'.
  gs_rng-low    = '000000000000000023'.  " exists
  APPEND gs_rng TO gt_matnr.
  gs_rng-low    = '000000000000000039'.  " exists not
  APPEND gs_rng TO gt_matnr.
  gs_rng-low    = '000000000000000043'.  " exists
  APPEND gs_rng TO gt_matnr.


  CHECK ( gt_matnr IS NOT INITIAL ).

  SORT gt_matnr BY low.
  DELETE ADJACENT DUPLICATES FROM gt_matnr
    COMPARING low.

  SELECT COUNT(*) INTO gd_count FROM mara
    WHERE matnr IN gt_matnr.  " fills sy-dbcnt

  DESCRIBE TABLE gt_matnr.  " fills sy-tfill

  IF ( sy-tfill NE sy-dbcnt ).
    MESSAGE 'Not all materials found in MARA' TYPE 'I'.
  ENDIF.

END-OF-SELECTION.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2007 19:50:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ranges/m-p/2735778#M635427</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2007-08-30T19:50:36Z</dc:date>
    </item>
  </channel>
</rss>

