<?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: Select statement with wild card entry problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905168#M1328864</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Note: Also am using this select within a function module with p_lifnr as the import parameter. Thus i cannot use ranges here.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You say that a range table is not an option because this is a function module.  This is not a restriction at all.  A range table can be set up a then used in your where clause. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
ranges: r_lifnr  for lfa1-lifnr.
.....
.....
r_lifnr-sign = 'I'.
r_lifnr-option = 'CP'.
concatenate p_lifnr '*' into r_lifnr-low,
append r_lifnr.

select * from LFA1 into itab where lifnr in r_lifnr.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or am I missing something?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Larry Browning on Jul 29, 2009 9:25 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Larry Browning on Jul 29, 2009 9:35 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Jul 2009 14:24:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-29T14:24:40Z</dc:date>
    <item>
      <title>Select statement with wild card entry problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905154#M1328850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am writing a select query on LFA1 to select the vendors matching a particular pattern. I have used the like operation and i face a particular situation here &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg, Am passing the string concatenated with '%' to the like operation in where. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: p_lifnr like lfa1-lifnr, 
         v_lifnr(10) type c.

concatenate  p_lifnr '%' into v_lifnr.

select * from LFA1 into itab where lifnr like v_lifnr.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the above code, if there is a vendor '0000029123' and if i pass '0000029%' , the select will fetch the data. But at the same time if there is a vendor '0002965421' it wont work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to know any suggestions as to how to select all the records if just pass '29%' which should select both '0000029123' and '0002965421'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: Also am using this select within a function module with p_lifnr as the import parameter. Thus i cannot use ranges here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2009 11:42:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905154#M1328850</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-29T11:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with wild card entry problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905155#M1328851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try &lt;STRONG&gt;'0%29%'&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2009 11:45:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905155#M1328851</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-29T11:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with wild card entry problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905156#M1328852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;concatenate '%'  at both sides&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: p_lifnr like lfa1-lifnr,
         v_lifnr(10) type c.

data: begin of itab occurs 0.
        include structure lfa1.
data:      end of itab.

p_lifnr = '29'.

concatenate  '%' p_lifnr '%' into v_lifnr.

select * from LFA1 into table itab where lifnr like v_lifnr.

loop at itab.
write:/ itab-lifnr.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2009 11:50:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905156#M1328852</guid>
      <dc:creator>former_member222860</dc:creator>
      <dc:date>2009-07-29T11:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with wild card entry problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905157#M1328853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gary,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By using &lt;STRONG&gt;'0%29%'&lt;/STRONG&gt;, it will fetch all the records containing '29' anywhere in it. I would like to select only those starting with '29' with zero's leading it depending on the length of the value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2009 11:53:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905157#M1328853</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-29T11:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with wild card entry problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905158#M1328854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mahesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i concatenate '%' at both sides, it will fetch all records which contains the pattern. i would like to select only those starting with the entered pattern.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2009 11:54:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905158#M1328854</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-29T11:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with wild card entry problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905159#M1328855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;tables: lfa1.
data: itab type standard table of lfa1 with header line.
data: p_lifnr like lfa1-lifnr,
         v_lifnr(10) type c.

p_lifnr = '00000034'.

concatenate  p_lifnr '%' into v_lifnr.

select * from LFA1 into table itab where lifnr like v_lifnr.

loop at itab.
write: itab-lifnr.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2009 11:57:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905159#M1328855</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-29T11:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with wild card entry problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905160#M1328856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Balu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i pass '34' i want it to fetch records for '00034%' as well as '034%'. Any suggestions for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2009 12:06:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905160#M1328856</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-29T12:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with wild card entry problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905161#M1328857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vikred,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I jave a suggestion for you.&lt;/P&gt;&lt;P&gt;Just select all the vendors from vendor master containing '29' within it.&lt;/P&gt;&lt;P&gt;Use loop and inside do as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use a FM : CONVERSION_EXIT_ALPHA_OUTPUT.&lt;/P&gt;&lt;P&gt;It will remove the leading zeroes from the vendor Code.&lt;/P&gt;&lt;P&gt;After that you can check for first two characters of the vendor codes.&lt;/P&gt;&lt;P&gt;If lifnr(2) = '29', then ok other wise delete the records from your internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds,&lt;/P&gt;&lt;P&gt;Anil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2009 12:17:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905161#M1328857</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-29T12:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with wild card entry problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905162#M1328858</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 am not sure it works or not, but try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'_ _ _ _ _24%'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;% for a sequence of any characters&lt;/P&gt;&lt;P&gt;_ for a single character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2009 12:20:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905162#M1328858</guid>
      <dc:creator>sridhar_meesala</dc:creator>
      <dc:date>2009-07-29T12:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with wild card entry problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905163#M1328859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your suggestion. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If lifnr(2) = '29', then ok other wise delete the records from your internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But here if i enter '293' as my pattern to search, i cannot use just if lifnr(2). The pattern to search length may vary. Is there any possiblity to use LOOP with '29%' or '293%' in where so that i can move them to a final internal table? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2009 12:32:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905163#M1328859</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-29T12:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with wild card entry problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905164#M1328860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;basically what u want is that , u can achieve the functionality like going to LFA1 table and giving input as 34* ,034* ,0034&lt;STRONG&gt;,00034&lt;/STRONG&gt;....   for LIFNR ,rt ..!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this &lt;/P&gt;&lt;P&gt;You will have to create ranges any how..Since u r saying , you cannot use ranges , so just check these Function modules&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Think they might be helpful .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONVERSION_EXIT_ALPHA_RANGE_I&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONVERSION_EXIT_ALPHA_RANGE_O&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards ,&lt;/P&gt;&lt;P&gt;Rajesh Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2009 12:39:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905164#M1328860</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-29T12:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with wild card entry problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905165#M1328861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes dear ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rightly saying.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thats why i am telling you to check only first two characters from left side of lifnr within the loop.&lt;/P&gt;&lt;P&gt;Our purpose is that first two characters should be '29', if it is not any '0'.&lt;/P&gt;&lt;P&gt;So within loop when you check for first two characters after removing the leading zeroes, you must have '29'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So when you check itab-lifnr(2) = '29', it will check all the record, does not matter what after that.&lt;/P&gt;&lt;P&gt;You try once and let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find a simple example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: lfa1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : p_lifnr like lfa1-lifnr value '00029'.&lt;/P&gt;&lt;P&gt;data : q_lifnr like lfa1-lifnr value '00291'.&lt;/P&gt;&lt;P&gt;data : r_lifnr like lfa1-lifnr value '02934'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;          INPUT   = p_lifnr&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;         OUTPUT  = p_lifnr .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;          INPUT   = q_lifnr&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;         OUTPUT  = q_lifnr .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;          INPUT   = r_lifnr&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;         OUTPUT  = r_lifnr .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write:/ p_lifnr(2).&lt;/P&gt;&lt;P&gt;write:/ q_lifnr(2).&lt;/P&gt;&lt;P&gt;write:/ r_lifnr(2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;29&lt;/P&gt;&lt;P&gt;29&lt;/P&gt;&lt;P&gt;29&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds,&lt;/P&gt;&lt;P&gt;Anil&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Anil Katoch on Jul 29, 2009 2:41 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2009 12:41:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905165#M1328861</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-29T12:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with wild card entry problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905166#M1328862</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;u can set the value of '2' dynamically...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;length = strlen(lifnr).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if selected_data(length) = lifnr, then pass it, else delete it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Bikash&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2009 12:43:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905166#M1328862</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-29T12:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with wild card entry problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905167#M1328863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bikash and Anil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its working now. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2009 12:53:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905167#M1328863</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-29T12:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with wild card entry problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905168#M1328864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Note: Also am using this select within a function module with p_lifnr as the import parameter. Thus i cannot use ranges here.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You say that a range table is not an option because this is a function module.  This is not a restriction at all.  A range table can be set up a then used in your where clause. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
ranges: r_lifnr  for lfa1-lifnr.
.....
.....
r_lifnr-sign = 'I'.
r_lifnr-option = 'CP'.
concatenate p_lifnr '*' into r_lifnr-low,
append r_lifnr.

select * from LFA1 into itab where lifnr in r_lifnr.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or am I missing something?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Larry Browning on Jul 29, 2009 9:25 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Larry Browning on Jul 29, 2009 9:35 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2009 14:24:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905168#M1328864</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-29T14:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with wild card entry problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905169#M1328865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Larry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was under the impression that ranges are associated with a selection screen like select-options and parameters. So i thought it cannot be used in a function module as a import parameter. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you mean to say ranges can be used in function modules also?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2009 14:50:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905169#M1328865</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-29T14:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with wild card entry problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905170#M1328866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   If you are selecting all the data and looping to filter out you are probebly getting more data than you need which costs you on the performance. If you are just using the ranges table with only 29* as suggested above then you wont get all the data. SO what you will have to do is declare a ranges and use all possible values that you want like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: lr_lifnr  like rsranges,&lt;/P&gt;&lt;P&gt;         ls_lifnr like line of lr_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_lifnr-SIGN = 'I'.&lt;/P&gt;&lt;P&gt;ls_lifnr-OPTION = 'CP'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_lifnr-low = '000000029*'.&lt;/P&gt;&lt;P&gt;append ls_lifnr to lr_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_lifnr-low = '00000029*'.&lt;/P&gt;&lt;P&gt;append ls_lifnr to lr_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_lifnr-low = '0000029*'.&lt;/P&gt;&lt;P&gt;append ls_lifnr to lr_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_lifnr-low = '000029*'.&lt;/P&gt;&lt;P&gt;append ls_lifnr to lr_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_lifnr-low = '00029*'.&lt;/P&gt;&lt;P&gt;append ls_lifnr to lr_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_lifnr-low = '0029*'.&lt;/P&gt;&lt;P&gt;append ls_lifnr to lr_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_lifnr-low = '029*'.&lt;/P&gt;&lt;P&gt;append ls_lifnr to lr_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_lifnr-low = '29*'.&lt;/P&gt;&lt;P&gt;append ls_lifnr to lr_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_lifnr-OPTION = 'EQ'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_lifnr-low = '0000000029'.&lt;/P&gt;&lt;P&gt;append ls_lifnr to lr_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use the select statement with the where clause "lifnr IN lr_lifnr."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will ensure that you get anything that starts with 29. The method of adding can be done in a loop as well. Hope this helps ...I dont know if you still need it. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Kazmi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2009 15:31:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905170#M1328866</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-29T15:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with wild card entry problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905171#M1328867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;So you mean to say ranges can be used in function modules also?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, a select-option is nothing more than a range table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that Kazmi is on the right track as well to cover all your cases for leading zeros.&lt;/P&gt;&lt;P&gt;You could easily customize this method to meet your particular needs using looping techniques to shorten the code considerably.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Larry Browning on Jul 29, 2009 11:26 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2009 16:11:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-wild-card-entry-problem/m-p/5905171#M1328867</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-29T16:11:03Z</dc:date>
    </item>
  </channel>
</rss>

