How to find string contain.

Dear all,
i want to find some char from a given string like below example
vtext = PM-BGM12_AC :
if vtext contain '_AC'  then i have to assinge btext = ' Air Conditioner'.
if vtext = PM-BGM12_BPI  contain '_BPI',
then i have to assign btext = ' Building & Permanent Improvement '
i m consfuse what to user ca , co, cs, cp.
*********point is assured *********

hi,
chk out this
<b><b>CO</b></b> Contains Only:  True, if operand1 only contains characters from operand2. Upper/lower case and trailing blanks are taken into account for both operands. If operand2 is of type string and is initial, then the logical expression is false, unless operand1 is also of type string and is initial, in which case the logical expression is always true. If the result of the comparison is negative, sy-fdpos contains the offset of the first character in operand1, that is not contained in operand2. If the result of the comparison is positive, sy-fdpos contains the length of operand1.
<b>CN</b> Contains Not Only; True if a logical expression with CO is false, that is, if operand1 contains not only characters from operand2. sy-fdpos is set in the same way as for CO. If the comparison is true, sy-fdpos contains the offset of the first character in operand1 that is not contained in operand2. If the comparison is false, sy-fdpos contains the length of operand1.
CA Contains Any: True, if operand1 contains at least one character from operand2. Upper/lower case and trailing blanks are taken into account for both operands. If operand1 or operand2 is of type string and initial, the logical expression is always false. If result of the comparison is positive, sy-fdpos contains the offset of the first character in operand1 that is also contained in operand2. If the result of the comparison is negative, sy-fdpos contains the length of operand1.
<b>NA</b> Contains Not Any: True if a logical expression with CA is false, that is if operand1 does not contain any characters from operand2. If the result of the comparison is negative, sy-fdpos contains the offset of the first character in operand1 that is also contained in operand2. If the result of the comparison is true, sy-fdpos contains the le of operand1.
CS Contains String: True if the content of operand2 is contained in operand1. Upper/lower case is not taken into account, trailing blanks of the left operand are taken into account. If operand1 is of type string and initial, or of type c and contains only blank characters, the logical expression is false, unless operand2 is also of type string and initial, or of type c and only contains blank characters. In this case the logical expression is always true. If the result of the comparison is true, sy-fdpos contains the offset of operand2 in operand1. If the result of the comparison is negative, sy-fdpos contains the length of operand1.
<b>NS</b> Contains No String: True, if a logical expression with CS is false, that is if operand1 does not contain the content of operand2. If the result of the comparison is negative, sy-fdpos contains the offset of operand2. If the comparison is true, sy-fdpos contains the length of operand1.
<b>CP</b> Covers Pattern: True, if the content of operand1 fits the pattern in operand2. Wildcard characters can be used for forming the operand2 pattern, where "" represents any character string, and "+" represents any character. Upper/lower case is not taken into account. If the comparison is true, sy-fdpos contains the offset of operand2 in operand1, whereby leading wildcard characters "" in operand2 are ignored if operand2 also contains other characters. If the comparison is false, sy-fdpos contains the length of operand1. You can select characters in operand2 for a direct comparison by adding the escape symbol "#" before the required characters. For these characters, upper/lower case is taken into account, wildcard characters and the escape symbol itself do not receive special treatment, and trailing blanks in operands of type c are not cut off.
<b>NP</b> No Pattern: True, if a logical expression with CP is false, that is, if operand1 does not fit the pattern operand2. If the comparison is false, sy-fdpos contains the offset of operand2 in operand1, whereby leading wildcard characters "*" in operand2 are ignored if operand2 also contains other characters. If the comparison is true, sy-fdpos contains the length of operand1.
thanks
jaideep
*reaward points if useful..

Similar Messages

  • How to find the contain of @list_of_cols_val_tab_del

    Hi
    Could you please tellme how to find the contain of @list_of_cols_val_tab_del
    for a given table when we write a stored procedure in SBO_SP_TransactionNotification.
    Thanks
    Sanjaya

    The way I have handled is by inserting the values being passed to this SP to a temp table
    INSERT INTO TRANSNOTIFY VALUES (@object_type, @transaction_type, @num_of_cols_in_key, @list_of_key_cols_tab_del, @list_of_cols_val_tab_del)
    Use this script to create this table
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo\].[TRANSNOTIFY\](
         [ObjType\] [nvarchar\](20) COLLATE SQL_Latin1_General_CP850_CI_AS NULL,
         [TransType\] [nchar\](1) COLLATE SQL_Latin1_General_CP850_CI_AS NULL,
         [NumCols\] [int\] NULL,
         [KeyCols\] [nvarchar\](255) COLLATE SQL_Latin1_General_CP850_CI_AS NULL,
         [ColsVal\] [nvarchar\](255) COLLATE SQL_Latin1_General_CP850_CI_AS NULL
    ) ON [PRIMARY\]

  • How to find the container in goods receipt table

    hi,
    how to find the number of containers with respect to each material document. After posting the material document the number of containers cannot stored in MSEG or MKPF table. i can able to find only in QALS table  but how to link the material document and inspection lot.
    Thanks
    Muthuraman.D

    Hi Muthuraman,
    Can you check this bapi BAPI_INSPLOT_GETLIST.In this bapi there is a different selection criteria like material,material document no and all. I think you can use this for your report. Check this and post if need help.
    Regards,
    Madhu.

  • How to do string contains in drools.

    hi everyone
    i'm using drools for a project and have come to a problem. in two of my rules i need to check if a string contains some characters but can't seem to do get the rules to be excepted. if anyone could help me i would be very grateful.
    thanks in advance
    mike

    Display the rules.

  • How to find string with trailing space

    Hi,
    I need to search a word instead of string from another string.
    I tried below code and expected that FIND will not search 'weeds' but it seems FIND ignores trailing spaces of string zstr and thus finds word 'weeds'.
    DATA: zstr type string value 'we ',
              lv_string type string value 'These are weeds',
              result_tab TYPE match_result_tab.
    FIND FIRST OCCURRENCE OF regex zstr IN lv_string
                          IGNORING CASE
                          RESULTS result_tab.
    Please consider that zstr is runtime variable with no fixed length.
    If anybody has the solution, reply back fast !
    Regards,
    Sourabh

    Hi,
    Hi,
      DATA STRING(30) VALUE 'This is a little sentence.'.
    WRITE: / 'Searched', 'SY-SUBRC', 'SY-FDPOS'.
    ULINE /1(26).
    SEARCH STRING FOR 'X'.
    WRITE: / 'X', SY-SUBRC UNDER 'SY-SUBRC',
                   SY-FDPOS UNDER 'SY-FDPOS'
    SEARCH STRING FOR 'itt '.
    WRITE: / 'itt   ', SY-SUBRC UNDER 'SY-SUBRC',
                       SY-FDPOS UNDER 'SY-FDPOS'
    SEARCH STRING FOR '.e .'.
    WRITE: / '.e .', SY-SUBRC UNDER 'SY-SUBRC',
    SY-FDPOS UNDER 'SY-FDPOS'.
    SEARCH STRING FOR '*e'.
    WRITE: / '*e ', SY-SUBRC UNDER 'SY-SUBRC',
    SY-FDPOS UNDER 'SY-FDPOS'.
    SEARCH STRING FOR 's*'.
    WRITE: / 's* ', SY-SUBRC UNDER 'SY-SUBRC',
    SY-FDPOS UNDER 'SY-FDPOS'.
    Hope it will solve your problem..
    Pls. reward if useful...

  • How to find string range

    Say i have a string array from aa0 to aa100. Now how do i write a condition to check that this string lies between aa0 to aa100. please help

    This is the code what i have typed. Its working but when i enter a value which is less then 0 and greater than 99, it still works, where as it shouldnt. Please help
        public void focusLost(FocusEvent evt) {
                    if(evt.getSource() == mytextfield) {
                  System.out.println("Inside focuslost");
                  String text = mytextfield.getText();
                  if(text.startsWith("aa")) {
                       int value;
                       try {
                            value = Integer.parseInt(String.valueOf(text.charAt(text.length() - 1)));
                       }catch(NumberFormatException nfe) {JOptionPane.showMessageDialog(null,"textfield should be \n in the range of aa0 - aa99","Test",JOptionPane.ERROR_MESSAGE);return;}
                       if(value < 0 || value > 99) {
                            System.out.println("Inside if condition");
                            JOptionPane.showMessageDialog(null,"textfield should be \n in the range of aa0 - aa99","Test",JOptionPane.ERROR_MESSAGE);
                            mytextfield.transferFocus();
                            return;
                  else {
                        JOptionPane.showMessageDialog(null,"Invalid entry","Test",JOptionPane.ERROR_MESSAGE);
                        return;
        }

  • How to write strings containing " ?

    I have the following string: blabla"blabla
    How can I specify that the " is inside the string and ignore
    it as as3 code symbol ?
    thanks

    That depends upon your need of this, may use some simple
    logic which is suitable for your need.

  • How to find string length in pixels

    Hi,
    I have a string "lucida bright regular". How can I get size of text in pixels.
    Can java.awt.Font work.
    An example wil really help.
    Thanks
    with regards

    Not exactly.
    I am applying font on text at web server using java
    and sending the resulting html to client end where
    is is displayed.
    Client can not change the
    font of that text.
    In that case you don't know the capabilities of modern browsers...
    Just because you want something bad enough doesn't make it happen.
    This is NOT Oz, this is the real world (or what passes for it for lack of alternatives).

  • How to find String associated with some long value.

    My requirement is to know the String associated with the long value, for ex 23423423 is having some value like 'skljflsjf'. Can any body findout soln for the same.
    Thanks
    ~ Chethangowda.

    My requirement is to know the String associatedwith
    the long value, for ex 23423423 is having somevalue
    like 'skljflsjf'. Can any body findout soln forthe
    same.
    Hum... I'm not 100% sure, but it seems the answeris:
    dgjldkgjfkljg
    Please, don't thank me before you confirm thething.
    Regards.Oooohhhh! That explains it! I guess I must've missed
    the part where he said he wants it translated to
    trollish. How stupid of me.You're absolutely not to blame... to be honest, if I had not read the OP 3-4 times carefully, I would not have found the solution.

  • How to find pdf  contain hide text?

    I have attached screen shot to find hidden text using Examine Document.
    I have raise so many question, still i am not get solution for problem.
    can any one help me to find solution?
    I need to find the hidden text is exist in PDF using SDK.

    I used below code to extract text in pdf, due to hidden text some text is not extract.
    if (startPg < 0 || endPg <0 || startPg > endPg || endPg > PDDocGetNumPages(pdDoc) - 1)
      AVAlertNote("Exceeding starting or ending page number limit of current document.");
      return false;
    PDWordFinder pdWordFinder = NULL;
    DURING
    pdWordFinder = PDDocCreateWordFinderEx(pdDoc, WF_LATEST_VERSION, toUnicode, pConfig);
    if (toUnicode) fprintf(pOutput, "%c%c", 0xfe, 0xff);
    for (int i = startPg; i <= endPg; i++)
      PDWordFinderEnumWords(pdWordFinder, i, ASCallbackCreateProto(PDWordProc, &WordEnumProc), pOutput);
    PDWordFinderDestroy(pdWordFinder);
    E_RETURN(true);
    HANDLER
    char buf[256], errmsg[256];
    sprintf(buf, "[ExtractText()]Error %d: %s",  ErrGetCode(ERRORCODE), ASGetErrorString(ERRORCODE, errmsg, sizeof(errmsg)));
    AVAlertNote(buf);
    if (pdWordFinder) PDWordFinderDestroy(pdWordFinder);
    if( pOutput) fclose(pOutput);
    return false;
    END_HANDLER

  • How to convert string containing comma seperated values to an array

    my requirement is i have to first convert an comma seperated string to an array
    after that i have to pass the array values to a for loop
    eg:i have a string str=(456,457,487,465,478)
    These values i have to put in an array.
    i then i have to pass the array values to a for loop

    We understand your ¿homeworks? We are helping you, but it seems like you want us to do it.
    Try it yourself with some of the instructions.
    Anyway if there aren´t homeworks, use dinamyc sql:
    declare
    varray := '(45,65,12,4)';
    begin
    execute immediate 'update table set ss=''uu'' where id in ' || varray;
    end;

  • How to replace string containing special characters by another string

    Hi all,
    I have to Search for a pattern and replace it by a substitute pattern [Eg: Replace methodOrig (a,b) with  SessTime = getSessionParameter(time);  methodNew(a,b,SessTime) ] in files.
    i tried this using replace(),but it din't work since string1 contains special characters.
    can anyone help me asap.
    thanks in advance.

    Double-post: http://forum.java.sun.com/thread.jspa?threadID=599211&tstart=0

  • How to find tables contain in particular authorization group.

    hi all
            By using SE11 , i just enter a table name like "MARA"
             then i go for display
            then by clicking utilities->assign authorization group
              i can get the info. about tablename and which authorization group(MM) the table belongs and its desc.
    my question is if the Authorization group is MM, i need to know the list of tables belongs to that particular auth. group.
    regards
    pras

    Hi Pras,
    These are stoed in table TDDAT. you can use se16 for this table and enter MM in CCLASS field hit execute.
    Ravi
    [My SAP Blog|http://raviinsap.blogspot.com]

  • Insert string containing '&'

    How to insert string containing '&' into a table
    INSERT INTO TBL_CHANGES_ORGANISATIES(CHANGE_MANAGEMENT_ID, SUBMITTER) VALUES ('HM0000002147848|TK0000003121328','CS CSU S\&B Change Management')

    if you're in sqlplus:
    put set define offprior to running your insert.
    if you're in Toad, either:
    put set define offbefore your insert statement, and run both in as a script
    OR
    right mouseclick on the editor and untick the "Prompt for substitution variables", and you need never worry about the & again!

  • How find shape containing all pixels in string drawn at angle?

    I've drawn a string on a JPanel at an angle using the code below. I want the mouse to turn into a hand when hovering over it but I don't know how to find the shape that an angled string comprises. (I can do it if it's written horizontally). How would I calculate that?
    double theta = Math.toRadians( angle );
    AffineTransform transform = AffineTransform.getRotateInstance( theta );
    ( ( Graphics2D ) graphics ).setTransform( transform );
    graphics.drawString( text, x, y );

    For the String you can create a Rectangle where the String is contained when it has no rotation. After that you can create Area (see java.awt.geom.Area) from the Rectangle and use transform() method of area to get a rotated one. Then just use contains() method.
    Regards,
    Stas

Maybe you are looking for