<?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 while selecting material with * in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-selecting-material-with/m-p/7045652#M1501374</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK???&lt;/P&gt;&lt;P&gt;Is that all you have to say to all those people who has taken the time out of their busy schedules to help you with a detailed explanation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Aug 2010 06:28:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-08-06T06:28:40Z</dc:date>
    <item>
      <title>Problem while selecting material with *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-selecting-material-with/m-p/7045646#M1501368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  We have made a RFC to search the material now my requiremen is if there is any * in the matnr filed system should select all the material like matnr  the code is below &lt;/P&gt;&lt;P&gt;*************************&lt;/P&gt;&lt;P&gt;FUNCTION ZMS_MATERIAL_SEARCH.&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Local Interface:&lt;/P&gt;&lt;P&gt;*"  IMPORTING&lt;/P&gt;&lt;P&gt;*"     VALUE(MATNR) TYPE  MATNR OPTIONAL&lt;/P&gt;&lt;P&gt;*"     VALUE(MAKTG) TYPE  MAKTG OPTIONAL&lt;/P&gt;&lt;P&gt;*"     VALUE(MATKL) TYPE  MATKL OPTIONAL&lt;/P&gt;&lt;P&gt;*"     VALUE(WERKS) TYPE  WERKS_D OPTIONAL&lt;/P&gt;&lt;P&gt;*"     VALUE(MTART) TYPE  MTART OPTIONAL&lt;/P&gt;&lt;P&gt;*"     VALUE(DISMM) TYPE  DISMM OPTIONAL&lt;/P&gt;&lt;P&gt;*"     VALUE(MVGR2) TYPE  MVGR2 OPTIONAL&lt;/P&gt;&lt;P&gt;*"  TABLES&lt;/P&gt;&lt;P&gt;*"      FINAL STRUCTURE  ZMATERIAL_SEARCH OPTIONAL&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; IF MATNR IS INITIAL.&lt;/P&gt;&lt;P&gt;    MATNR = '*'.&lt;/P&gt;&lt;P&gt; ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; IF MAKTG IS INITIAL.&lt;/P&gt;&lt;P&gt;    MAKTG = '*'.&lt;/P&gt;&lt;P&gt; ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; IF MATKL IS INITIAL.&lt;/P&gt;&lt;P&gt;    MATKL = '*'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF MTART IS INITIAL.&lt;/P&gt;&lt;P&gt;     MTART = '*'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF DISMM IS INITIAL.&lt;/P&gt;&lt;P&gt;     DISMM = '*'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF MVGR2 IS INITIAL.&lt;/P&gt;&lt;P&gt;     MVGR2 = '*'.&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;  IF MATNR CA '*'.&lt;/P&gt;&lt;P&gt;      REPLACE ALL OCCURRENCES OF '*' IN MATNR WITH '%' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    TRANSLATE MATNR TO UPPER CASE.&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;  IF MAKTG CA '*'.&lt;/P&gt;&lt;P&gt;      REPLACE ALL OCCURRENCES OF '*' IN MAKTG WITH '%' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    TRANSLATE MAKTG TO UPPER CASE.&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;  IF MATKL CA '*'.&lt;/P&gt;&lt;P&gt;      REPLACE ALL OCCURRENCES OF '*' IN MATKL WITH '%' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    TRANSLATE MATKL TO UPPER CASE.&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;  IF MTART CA '*'.&lt;/P&gt;&lt;P&gt;      REPLACE ALL OCCURRENCES OF '*' IN MTART WITH '%' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    TRANSLATE MTART TO UPPER CASE.&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;  IF DISMM CA '*'.&lt;/P&gt;&lt;P&gt;      REPLACE ALL OCCURRENCES OF '*' IN DISMM WITH '%' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    TRANSLATE DISMM TO UPPER CASE.&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;  IF MVGR2 CA '*'.&lt;/P&gt;&lt;P&gt;      REPLACE ALL OCCURRENCES OF '*' IN MVGR2 WITH '%' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    TRANSLATE MVGR2 TO UPPER CASE.&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;&lt;/P&gt;&lt;P&gt;  SELECT A&lt;SUB&gt;MATNR A&lt;/SUB&gt;MTART A&lt;SUB&gt;MATKL B&lt;/SUB&gt;MAKTG C&lt;SUB&gt;DISMM C&lt;/SUB&gt;WERKS D~MVGR2&lt;/P&gt;&lt;P&gt;         FROM MARA AS A INNER JOIN MAKT AS B ON A&lt;SUB&gt;MATNR = B&lt;/SUB&gt;MATNR&lt;/P&gt;&lt;P&gt;         INNER JOIN MARC AS C ON A&lt;SUB&gt;MATNR = C&lt;/SUB&gt;MATNR&lt;/P&gt;&lt;P&gt;         INNER JOIN MVKE AS D ON A&lt;SUB&gt;MATNR = D&lt;/SUB&gt;MATNR INTO CORRESPONDING FIELDS OF TABLE FINAL&lt;/P&gt;&lt;P&gt;          WHERE    A~MATNR LIKE MATNR&lt;/P&gt;&lt;P&gt;             AND   A~MATKL LIKE MATKL&lt;/P&gt;&lt;P&gt;             AND   A~MTART LIKE MTART&lt;/P&gt;&lt;P&gt;             AND   B~MAKTG LIKE MAKTG&lt;/P&gt;&lt;P&gt;             AND   C~WERKS EQ   WERKS&lt;/P&gt;&lt;P&gt;             AND   C~DISMM LIKE DISMM&lt;/P&gt;&lt;P&gt;             AND   D~VKORG EQ   WERKS&lt;/P&gt;&lt;P&gt;             AND   D~MVGR2 LIKE MVGR2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFUNCTION.&lt;/P&gt;&lt;P&gt;*************&lt;/P&gt;&lt;P&gt;now my problem is I have Two material 4110  and 4110V1  when i search material with 4110*  in output it is giving only 4110V1  as material, my requirement is in output it should give 4110  and 4110V1  for the input as 4110*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so what modification i need in my program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt; zafar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Jul 2010 05:43:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-selecting-material-with/m-p/7045646#M1501368</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-24T05:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while selecting material with *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-selecting-material-with/m-p/7045647#M1501369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to populate ranges and pass the material number. I think this should be best way of handling situations like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: R_MATNR TYPE RANGE OF MATNR,&lt;/P&gt;&lt;P&gt;WA_MATNR LIKE LINE OF R_MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;WA_MATNR-SIGN = 'I'.
WA_MATNR-OPTION = 'CP'.
WA_MATNR-LOW = '4110*'.
APPEND WA_MATNR TO R_MATNR.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use R_MATNR in your SELECT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Jul 2010 08:44:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-selecting-material-with/m-p/7045647#M1501369</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-07-24T08:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while selecting material with *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-selecting-material-with/m-p/7045648#M1501370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suhas,&lt;/P&gt;&lt;P&gt;    Hi I have try with given details but stil  I am getting only one entry as i mention above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt; zafar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Jul 2010 08:55:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-selecting-material-with/m-p/7045648#M1501370</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-24T08:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while selecting material with *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-selecting-material-with/m-p/7045649#M1501371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Zafar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CP operator is the right method for this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think your join statement is restricting some records,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please try to write a select statement for only table MARA first,&lt;/P&gt;&lt;P&gt;than you 'll see it will read both records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;than add your joins step by step and see which join is restricting your record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bulent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Bulent Balci on Jul 24, 2010 3:51 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Jul 2010 13:51:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-selecting-material-with/m-p/7045649#M1501371</guid>
      <dc:creator>bbalci</dc:creator>
      <dc:date>2010-07-24T13:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while selecting material with *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-selecting-material-with/m-p/7045650#M1501372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Apart from Bulent's good answer there's one more obvious thing you should do (and I'm assuming that the odd-looking selection &lt;SPAN __default_attr="Courier New" __jive_macro_name="font"&gt;D~VKORG EQ WERKS&lt;/SPAN&gt; actually makes sense due to the functional usage of those organizational units in your system)...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd say the best candidate for checking is how your material numbers are stored. Based on your results I'd bet that your system is configured to store numeric material numbers with leading zeros (you can check that easily via customizing or via SE16 with switching off all conversion exits). In that case you're numeric only material number &lt;SPAN __default_attr="Courier New" __jive_macro_name="font"&gt;4110&lt;/SPAN&gt; would actually be stored on the database as &lt;SPAN __default_attr="Courier New" __jive_macro_name="font"&gt;000000000000004110&lt;/SPAN&gt; and your selection with &lt;SPAN __default_attr="Courier New" __jive_macro_name="font"&gt;4110%&lt;/SPAN&gt; is obviously not matching that material number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if that's the case in your system, then you're in for some ugly searching, whenever a numeric material number pattern is specified. If your numeric material numbers have different lengths (and looking at the 4 digits you're giving I'm assuming this), then you'd basically need to create quite a few patterns (probably best generated/stored in a select-option), where you'd prefix all possible numbers of zeros in front of your pattern. So in your case you'd need the following patterns (substitute the &lt;SPAN __default_attr="Courier New" __jive_macro_name="font"&gt;%&lt;/SPAN&gt; with a &lt;SPAN __default_attr="Courier New" __jive_macro_name="font"&gt;*&lt;/SPAN&gt; if you use select-options):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
4110%
04110%
004110%
0004110%
\[..\]
00000000000004110%
000000000000004110
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The approach to use a more generic pattern like &lt;SPAN __default_attr="Courier New" __jive_macro_name="font"&gt;%4110%&lt;/SPAN&gt; and then use some additional ABAP coding to remove the false matches is most likely more inefficient. I.e. even if your result set would be small, the database selection would still require a full index (or table) scan to figure out the matching material numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If all of that sounds unfamiliar to you, I strongly recommend reading up on [conversion exits|http://help.sap.com/abapdocu_70/en/ABENCONVERSION_EXITS.htm], which is ABAP 101...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers, harald&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p.s.: I leave it as an exercise to the reader if my answer contains any wrong material number (pattern), where I accidentally didn't count the number of zeros properly. I'm too lazy to check that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Jul 2010 07:25:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-selecting-material-with/m-p/7045650#M1501372</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-25T07:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while selecting material with *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-selecting-material-with/m-p/7045651#M1501373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Aug 2010 05:11:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-selecting-material-with/m-p/7045651#M1501373</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-06T05:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while selecting material with *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-selecting-material-with/m-p/7045652#M1501374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK???&lt;/P&gt;&lt;P&gt;Is that all you have to say to all those people who has taken the time out of their busy schedules to help you with a detailed explanation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Aug 2010 06:28:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-selecting-material-with/m-p/7045652#M1501374</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-06T06:28:40Z</dc:date>
    </item>
  </channel>
</rss>

