<?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: Need help in search program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-search-program/m-p/6579142#M1434082</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;Simple select does this job.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: l_role TYPE string.

l_role = 'ab*' or 'a*' or 'abc* (As per your input).

SELECT ...
INTO TABLE....
FROM Zrole_db_table 
WHERE type LIKE l_role.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Performance completely depends on the number of entries in your table.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Feb 2010 14:47:44 GMT</pubDate>
    <dc:creator>vinod_vemuru2</dc:creator>
    <dc:date>2010-02-08T14:47:44Z</dc:date>
    <item>
      <title>Need help in search program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-search-program/m-p/6579141#M1434081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI All ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need to create program search from table (roles) that run exactly like the outlook &lt;/P&gt;&lt;P&gt;person search .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Letu2019s assume we have three roles in table Zrole_db_table : abc, acc, adc&lt;/P&gt;&lt;P&gt;If I type u2018abu2019  the method should return abc since only one match exists &lt;/P&gt;&lt;P&gt;If I type u2018au2019  the method should return all three roles but the &lt;/P&gt;&lt;P&gt;If I type u2018abcu2019  the method should return abc due to the exact match&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the best way to do it ,performance is very important ?&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;James&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: James Herb on Feb 8, 2010 3:34 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2010 14:11:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-search-program/m-p/6579141#M1434081</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-08T14:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in search program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-search-program/m-p/6579142#M1434082</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;Simple select does this job.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: l_role TYPE string.

l_role = 'ab*' or 'a*' or 'abc* (As per your input).

SELECT ...
INTO TABLE....
FROM Zrole_db_table 
WHERE type LIKE l_role.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Performance completely depends on the number of entries in your table.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2010 14:47:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-search-program/m-p/6579142#M1434082</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2010-02-08T14:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in search program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-search-program/m-p/6579143#M1434083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Vinod ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks this is not exactly the issue .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assume that we have 4 roles like&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;ABC&lt;/P&gt;&lt;P&gt;ABD&lt;/P&gt;&lt;P&gt;ABCD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And user request ABC &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;he will get ABC and ABCD but he should get just ABC &lt;/P&gt;&lt;P&gt;How you suggest to handle it ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: James Herb on Feb 8, 2010 4:56 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2010 15:23:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-search-program/m-p/6579143#M1434083</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-08T15:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in search program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-search-program/m-p/6579144#M1434084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello James,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How about trying this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;PARAMETERS: P_ROLE TYPE CHAR30. "Use the Data Element for role (i am not infront of an SAP system)

DATA: 
R_RNG TYPE STANDARD TABLE OF SELOPT,
W_RNG TYPE SELOPT.

W_RNG-SIGN = 'I'.
W_RNG-OPTION = 'CP'.
CONCATENATE P_ROLE '*' INTO W_RNG-LOW.
APPEND W_RNG TO R_RNG.

SELECT * FROM &amp;lt;AGR* table&amp;gt; INTO TABLE ITAB WHERE ROLE IN R_RNG.

IF SY-SUBRC = 0.
SORT ITAB BY ROLE.

READ TABLE ITAB INTO WA WITH KEY ROLE = P_ROLE BINARY SEARCH.
IF SY-SUBRC = 0.
" You have the single Role you need. In this case you will get ABC :)
ENDIF.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope i am clear.&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>Mon, 08 Feb 2010 16:20:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-search-program/m-p/6579144#M1434084</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-02-08T16:20:45Z</dc:date>
    </item>
  </channel>
</rss>

