How to search for perticular substring in given string.

Hi, Can any one tell me how to search for perticular substring in given string.
example:
I have to search for CA in given Order type it may be CA10 or CA15. Please Do the needful.

Hi Aniruddha,
check this...
Data var string,
var = 'India'.
search var for 'Ind'.
if sy-subrc = 0.    " var having ind
Message 'Ind found' type 'I'.
else  .            "var not having ind
Message 'Ind not Found' type 'I'.
endif.
thanx
bgan.

Similar Messages

  • How to search for available class in given package?

    How to search for available class in given package or sub package?

    Finally i did it. I make hibernate and spring without much configuration. I just pass the package pattern to search for all bean. I named it package pattern injection.
    My website is still under construction yet. It named Jimmy6 Framework.
    The code it just the following for all hibernate and spring bean for the whole project.
    <bean id="sessionFactory" class="com.j6.framework.JAnnotationSessionFactoryBean">
              <property name="annotatationOrHbmXmlPackagePattern">
                   <list>
                        <value>com\.j6\.project.+?\.vo\..+?</value>                    
                   </list>
              </property>               
    <bean id="autoBeanCreatorFactoryManager" class="com.j6.framework.resource.AutoBeanCreatorFactory">
              <property name="packagePatterns">
                   <list>
                        <value>com\.j6\.project\..+?\.manager\..+?</value>
                   </list>
              </property>
         </bean>
         <bean id="autoBeanCreatorFactoryDao" class="com.j6.framework.resource.AutoBeanCreatorFactory">
              <property name="packagePatterns">
                   <list>
                        <value>com\.j6\.project\..+?\.dao\.hibernate.+?</value>
                   </list>
              </property>
         </bean>Feel free to have a look and gv some comments. Thanks :)
    Regards,
    Jimmy6
    Edited by: jimmy6 on Nov 4, 2008 8:15 AM

  • How to search for upper/lower case using string using JAVA!!!?

    -I am trying to write a program that will examine each letter in the string and count how many time the upper-case letter 'E' appears, and how many times the lower-case letter 'e' appears.
    -I also have to use a JOptionPane.showMessageDialog() to tell the user how many upper and lower case e's were in the string.
    -This will be repeated until the user types the word "Stop". 
    please help if you can
    what i have so far:
    [code]
    public class Project0 {
    public static void main(String[] args) {
      String[] uppercase = {'E'};
      String[] lowercase = {'e'};
      String isOrIsNot, inputWord;
      while (true) {
       // This line asks the user for input by popping out a single window
       // with text input
       inputWord = JOptionPane.showInputDialog(null, "Please enter a sentence");
       if ( inputWord.equals("stop") )
        System.exit(0);
       // if the inputWord is contained within uppercase or
       // lowercase return true
       if (wordIsThere(inputWord, lowercase))
        isOrIsNot = "Number of lower case e's: ";
       if (wordIsThere(inputword, uppercase))
         isOrIsNot = "number of upper case e's: ";
       // Output to a JOptionPane window whether the word is on the list or not
       JOptionPane.showMessageDialog(null, "The word " + inputWord + " " + isOrIsNot + " on the list.");
    } //main
    public static boolean wordIsThere(String findMe, String[] theList) {
      for (int i=0; i<theList.length; ++i) {
       if (findMe.equals(theList[i])) return true;
      return false;
    } // wordIsThere
    } // class Lab4Program1
    [/code]

    So what is your question? Do you get any errors? If so, post them. What doesn't work?
    And crossposted: how to search for upper/lower case using string using JAVA!!!?

  • Searching for a substring within a string

    can someone reccomend a simple way to search for a substring within a string and count the number occurences of that substring.
    The substring and the string will be provided as command line parameters.
    Thanks
    gg

    A simple way would be to use the indexOf methods in String:
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html
    Not sure what this has to do with event handling though :-P

  • How to search for perticular Bookmark present in many word files at once

    Hi all,
    We have templates created through Word 2003. We have created the Bookmarks in that some are fetched from database and others are from a XML file, through the code.
    We do Alt+i+k and the list of bookmarks present in that template appears.
    So, If I want to search for suppose a bookmark named 'GC_F_faxnumber' which is bookmark for fax number, I need to go through alll templates (there are about 500 template) one by one and then find it out.
    I need this work to be done ASAP. Could you please help me in how do I find out a bookmark in number of word files or templates the bookmark is located and in which all templates it is present.
    Thanks in advance.:)

    Hi,
    For this requirement, I think you need to iterate to open these files and use
    Bookmarks.Exists method to check whether the specify bookmark is exist or not.
    There is a link that may benefit you:
    # GoTo Bookmark in a Word Document using Excel VBA
    http://answers.microsoft.com/en-us/office/forum/office_2003-word/goto-bookmark-in-a-word-document-using-excel-vba/6161709e-5419-4cc4-9c8f-7a2cd5f56d6a
    Regards
    Starain
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to Search for a Date in a string having both characters and date

    Hi ,
      I have a requirement to search DATE in the String having Both Characters and DATE . Please kindly let me know as early as possible.
    Regards
    Anil Kumar K

    Try to use SEARCH command with the pattern, making the pattern as fine as it can, like if you have your date in the format 02/23/2007, you can give
    SEARCH STRING FOR ' //'. (assuming the date has at least a single blank before it)
    WRITE:  SY-SUBRC UNDER 'SY-SUBRC',
    SY-FDPOS UNDER 'SY-FDPOS'.
    SY-FDPOS is set to offset of the string from which you can get the date value
    Refer here
    http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb33cc358411d1829f0000e829fbfe/frameset.htm
    It would have been better if there is something like UNIX "regular expression" matching in ABAP

  • Help me about Searching for a Substring within a String

    Hello everybody,
    I have a problem like this:
    Assume i type a sentence from keyboard: "I want to play football"
    And computer will look for the word "football" to see if this word is in that sentence.
    In this case, computer found it.
    That is it ! Could anybody help me about this ?
    Thank you very much in advance.
    still_learn

    Use the String.indexOf() method:
    String original = "I want to play football";
    int result = original.indexOf("football");
    if (result != -1)
    System.out.println("computer found it");
    If the word "football" is in the original String, the indexOf() method will return the index of the word. If it does not find the word "football", it will return a value of -1. The String API is full of useful methods.
    fitz

  • Search for a word in a string.

    Hello everybody,
    Could anybody help me how to search for a word in a string ?
    Example: I have a string as below:
    String[] weather = {"snow", "rain", "sunny", "temperature", "storm", "freezing"};
    And I have a sentence like this:
    "Today is a sunny day"
    I want to break this sentence to pickup the word "sunny" and search this word in String[] weather to see if they match. How could i do that?
    Thank you very much. I really appreciate.
    still_learn

    1 iterate through the strings in your array.
    2. use String.indexOf(...) to test if the query string is present in the string

  • How to search for a BADI in a transaction

    Hi All,
    Please let me know the steps to find a BADI for a transaction.
    Thanks,
    Jaffer Ali.S

    check this.
    u can find BADI's in different ways...
    1>First go to any transaction->iN THE menu bar SYSTEM->STATUS->Get the program name ->double click->u will go to the program attached to the tcode.Now search term will be CALL CL_EXITHANDLER.Now u will get list of BADI'S available..
    2>Goto SE24->Give class name as CL_EXITHANDLER->Display->double click on get_instance mathod->Now u will go inside the method->Now put break point on the cl_exithandler.Now go to any transaction code and pass dat..U will see that it will be stopped on the break point which u set on the cl_exithandler...In the exit name u can find list of badi's attached to the tcode..
    There are multiple ways of searching for BADI.
    • Finding BADI Using CL_EXITHANDLER=>GET_INSTANCE
    • Finding BADI Using SQL Trace (TCODE-ST05).
    • Finding BADI Using Repository Information System (TCODE- SE84).
    1. Go to the Transaction, for which we want to find the BADI, take the example of Transaction VD02. Click on System->Status. Double click on the program name. Once inside the program search for ‘CL_EXITHANDLER=>GET_INSTANCE’.
    Make sure the radio button “In main program” is checked. A list of all the programs with call to the BADI’s will be listed.
    The export parameter ‘EXIT_NAME’ for the method GET_INSTANCE of class CL_EXITHANDLER will have the user exit assigned to it. The changing parameter ‘INSTANCE’ will have the interface assigned to it. Double click on the method to enter the source code.Definition of Instance would give you the Interface name.
    2. Start transaction ST05 (Performance Analysis).
    /people/alwin.vandeput2/blog/2006/04/13/how-to-search-for-badis-trace-it
    3. Go to “Maintain Transaction” (TCODE- SE93).
    Enter the Transaction VD02 for which you want to find BADI.
    Click on the Display push buttons.
    Get the Package Name. (Package VS in this case)
    Go to TCode: SE84->Enhancements->Business Add-inns->Definition
    Enter the Package Name and Execute.
    Here you get a list of all the Enhancement BADI’s for the given package MB.
    The simplese way for finding BADI is
    1. chooes Tcode Program & package for that Tcode.
    2. Go to Tcode se18
    3. Press F4
    4. search by package or by program.
    Regards
    Kiran Sure

  • How can I search the tree with a given string?

    How can I search the tree with a given string?
    I don't find any function like "search(...)".
    I want to find the tree nodes which include the given string.
    Thanks.

    Try it with .com instead of .ca - fixes it for me (corporate firewall blocks .ca here)
    http://spendolini.blogspot.com/2013/09/working-with-apex-tree.html
    Anyway - it links to an article of mine which describes interacting with the tree: Tom's Blog: Working with the tree in Apex. There is also a demo application on apex.oracle.com: http://apex.oracle.com/pls/apex/f?p=54687:38

  • How to search for file in jsp page

    i need help on how to search for a file in a folder where there is a lot of subfolder.like how u search in a document in windows. i need a complete codes in jsp page.
    thank you in advance.
    Message was edited by:
    n_dilah

    no i need to do a search engine in jsp page which is the j2ee.
    i type smth than tat file from any folder will appear the same way when u need to search your file in a document in windows.
    well can u nice people tell me where i can get the codes bcos i stinks when it come to programming.
    thank you very very very much.

  • How To Search For a Specific File name?

    Hello Everybody
    How To Search For a File Like NewFile.txt in a Root Like C:\\
    And If The File Is Found Open It And Write In It?

    http://forum.java.sun.com/thread.jspa?threadID=5194090&messageID=9763314

  • How to search for a fields ?

    Hello,
    I know it's an easy question but I've not find, how to search for a fields in Database on CR XI R2 ?
    Thanks in advance

    Hi Alexandre
    Do you want to see which database fields you have inserted in Crystal Reports and in which section you have inserted what fields?
    If yes then
    -open formula editor
    -In the right side pane expand Formatting Formulas.
    -Expand all the sections one by one and it will show you database fields,formulas and all the objects used in the sections.
    Hope this will clarify your doubts.
    Regards
    Asha.

  • How to search for a certain cross reference using its name in FM 11?

    How to search for a certain cross reference using its name in FM 11?

    Well, thank you. I am only using Find dialog box. By "name", I'd like to give an example. The background is FM 11 structured. I have an element "xref" which is used to make cross reference. Now In Chapter 1, there is a sentence like "This is an ODU for ...". I made a cross ref of the word "ODU" to its full name "outdoor unit" in Chapter 2 (in the same book). After this, the word "ODU" in the sentence in Chapter 1 will no longer be a plain text. So I no longer can use the find dialog box to search for "ODU" because it is already an xref rather than text. I am not if it's clear.

  • How to search for a badi

    how to search for a badi
    srinivas.

    Hi Srinivas,
    Good
    Check this link
    /people/alwin.vandeput2/blog/2006/04/13/how-to-search-for-badis-trace-it
    Run this program
    *& Report ZNEGI16 *
    REPORT ZNEGI16 .
    TABLES : TSTC,
    TADIR,
    MODSAPT,
    MODACT,
    TRDIR,
    TFDIR,
    ENLFDIR,
    SXS_ATTRT ,
    TSTCT.
    DATA : JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
    DATA : FIELD1(30).
    DATA : V_DEVCLASS LIKE TADIR-DEVCLASS.
    PARAMETERS : P_TCODE LIKE TSTC-TCODE,
    P_PGMNA LIKE TSTC-PGMNA .
    DATA wa_tadir type tadir.
    START-OF-SELECTION.
    IF NOT P_TCODE IS INITIAL.
    SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.
    ELSEIF NOT P_PGMNA IS INITIAL.
    TSTC-PGMNA = P_PGMNA.
    ENDIF.
    IF SY-SUBRC EQ 0.
    SELECT SINGLE * FROM TADIR
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'PROG'
    AND OBJ_NAME = TSTC-PGMNA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    IF SY-SUBRC NE 0.
    SELECT SINGLE * FROM TRDIR
    WHERE NAME = TSTC-PGMNA.
    IF TRDIR-SUBC EQ 'F'.
    SELECT SINGLE * FROM TFDIR
    WHERE PNAME = TSTC-PGMNA.
    SELECT SINGLE * FROM ENLFDIR
    WHERE FUNCNAME = TFDIR-FUNCNAME.
    SELECT SINGLE * FROM TADIR
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'FUGR'
    AND OBJ_NAME EQ ENLFDIR-AREA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    ENDIF.
    ENDIF.
    SELECT * FROM TADIR INTO TABLE JTAB
    WHERE PGMID = 'R3TR'
    AND OBJECT in ('SMOD', 'SXSD')
    AND DEVCLASS = V_DEVCLASS.
    SELECT SINGLE * FROM TSTCT
    WHERE SPRSL EQ SY-LANGU
    AND TCODE EQ P_TCODE.
    FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
    WRITE:/(19) 'Transaction Code - ',
    20(20) P_TCODE,
    45(50) TSTCT-TTEXT.
    SKIP.
    IF NOT JTAB[] IS INITIAL.
    WRITE:/(105) SY-ULINE.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    Sorting the internal Table
    sort jtab by OBJECT.
    data : wf_txt(60) type c,
    wf_smod type i ,
    wf_badi type i ,
    wf_object2(30) type C.
    clear : wf_smod, wf_badi , wf_object2.
    Get the total SMOD.
    LOOP AT JTAB into wa_tadir.
    at first.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 'Enhancement/ Business Add-in',
    41 SY-VLINE ,
    42 'Description',
    105 SY-VLINE.
    WRITE:/(105) SY-ULINE.
    endat.
    clear wf_txt.
    at new object.
    if wa_tadir-object = 'SMOD'.
    wf_object2 = 'Enhancement' .
    elseif wa_tadir-object = 'SXSD'.
    wf_object2 = ' Business Add-in'.
    endif.
    FORMAT COLOR COL_GROUP INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 wf_object2,
    105 SY-VLINE.
    endat.
    case wa_tadir-object.
    when 'SMOD'.
    wf_smod = wf_smod + 1.
    SELECT SINGLE MODTEXT into wf_txt
    FROM MODSAPT
    WHERE SPRSL = SY-LANGU
    AND NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    when 'SXSD'.
    For BADis
    wf_badi = wf_badi + 1 .
    select single TEXT into wf_txt
    from SXS_ATTRT
    where sprsl = sy-langu
    and EXIT_NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED ON.
    endcase.
    WRITE:/1 SY-VLINE,
    2 wa_tadir-OBJ_NAME hotspot on,
    41 SY-VLINE ,
    42 wf_txt,
    105 SY-VLINE.
    AT END OF object.
    write : /(105) sy-ULINE.
    ENDAT.
    ENDLOOP.
    WRITE:/(105) SY-ULINE.
    SKIP.
    FORMAT COLOR COL_TOTAL INTENSIFIED ON.
    WRITE:/ 'No.of Exits:' , wf_smod.
    WRITE:/ 'No.of BADis:' , wf_badi.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'No userexits or BADis exist'.
    ENDIF.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'Transaction does not exist'.
    ENDIF.
    AT LINE-SELECTION.
    data : wf_object type tadir-object.
    clear wf_object.
    GET CURSOR FIELD FIELD1.
    CHECK FIELD1(8) EQ 'WA_TADIR'.
    read table jtab with key obj_name = sy-lisel+1(20).
    move jtab-object to wf_object.
    case wf_object.
    when 'SMOD'.
    SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
    CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    when 'SXSD'.
    SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(20).
    CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
    endcase.
    Solution 2
    1.Get the Package of the program name of the transaction.
    2.Go to Transaction SE18.
    3.Press F4 on the badi definition name.
    4.Click the information systems button.
    5.Give the Package name and press enter.
    6.Select the BADI that is relevant to the application.
    Good Luck and thanks
    AK

Maybe you are looking for

  • Decimal places in database

    Hi all, Please can you make B1 do all calculations and store all data in the database to the maximum number of decimal places, and then let users pick to how many decimal places to view on screen? At the moment, if I only pick 2 decimal places, the d

  • Upgrade: PI 7.0 to PI 7.1

    Hi Gurus, We are running with PI 7.0 on Windows 2003 along with MS SQL Server 2005, now are planning to upgrade to PI 7.1 on both MS Windows 2003 & MS SQL Server 2005. I request you all to help me with any good reference Upgrade document and referenc

  • Load balancing problem with CSS11503

    Hello all, We have two web servers that are being load balanced with this configuration on two CSS11503 with IOS version 7.20 Build 206; content Web add service web1 add service web2 vip address 10.1.4.4 protocol tcp port 80 url "/*" advanced-balance

  • SIFR with Spry 1.6 Menus

    I am about to attempt using sIFR fonts for headings and for a Spry 1.6 vertical menu href's and was wondering if any else has tried this?

  • Set a value

    Hi, How can I set a value automatically into my action class without let user see this? I explain: My View contains 3 fields: ID, Name and Number. I want that user enter the ID and the Name and when user validate I will put into "Number" field a valu