Re: FIND statement

Hi All,
i don't have SAP system with me now
i have a doubt with FIND statement
data: str(40) type c value ' everyday everybody every where'.
FIND 'ever' in str.
what will be the out put
thanks in advance
Chinna

Hi,
Find can be used :
FIND sub_string
  IN section_of dobj
  [ IN { BYTE | CHARACTER } MODE ]
  [ { RESPECTING | IGNORING } CASE ]
  [ MATCH OFFSET moff ] [MATCH LENGTH mlen ].
Use the CASE addition to define whether the search takes upper or lowercase characters into consideration. You can use the MATCH addition to define the position and length of the sequence that is found. The search is ended when the subsequence is found for the first time in the search area, or the end of the search area was reached. You are notified of the search result by setting sy-subrc.
Note
FIND does not supply the sy-fdpos system field with data.
That why your written code does not display any ouput but  change the value of sy-subrc as given below
System fields
sy-subrc Meaning
0 The subsequence was found in the search area.
4 The subsequence was not found in the search area.
8 The subsequence contains an invalid double-byte character for string processing.
Thanks,
Smita
Edited by: Smita Gupta on Nov 11, 2008 7:05 AM

Similar Messages

  • Find: stat() error /proc/26354: No such file or directory

    Dear everyone,
    I am using Solaris 10u8 on 02 Sun Fire X4240 servers. I also installed Sun Cluster 3.2u3 and Oracle RAC 10gR2 for these 2 servers.
    When I tried to execute the find command, I receive the result I need. However, in the end of the output, I saw additional lines:
    +# find / -name * log -print | grep samba+
    +/var/svc/log/network-samba:default.log+
    +/var/samba/log+
    +/etc/svc/volatile/network-samba:default.log+
    +{color:#ff0000}find: stat() error /proc/26354: No such file or directory{color}+
    I also tried with less complex syntax but got the same result, for example:
    +# find / -name samba+
    +/var/spool/samba+
    +/var/samba+
    +/usr/sfw/lib/webmin/caldera/samba+
    +/usr/sfw/lib/webmin/mscstyle3/samba+
    +/usr/sfw/lib/webmin/samba+
    +/etc/init.d/samba+
    +/etc/webmin/samba+
    +/opt/SUNWscsmb/samba+
    +{color:#ff0000}find: stat() error /proc/24252: No such file or directory+
    +find: stat() error /proc/24345: No such file or directory{color}+
    I don't know why these unormal outputs appeared. Does anyone know what the problem is here ?
    Any advice from you is appreciated. Thanks for your help and please help me in this case.
    Thanks.
    HuyNQ.

    /proc is a virtual filesystem reperesenting running processes.
    By doing a a find from / your allowing find to pass though /proc.
    Those errors indicate processes that exited while the find was running. So the files suddenly disappeared.
    The errors are harmless. But if possible, try not to allow find to scan /proc.

  • Regular expression in FIND statement

    Hi All,
    I am writing the regular expressions.
    But i didn't get properly how to write them.
    I have one internal table with the five fields.
    Exapmle wa-mandt = '800'.
                 wa_number = '3768'
                 wa_path = '/usr/tmp/sapuser/3768/test.txt.'
    append wa to itab.
    Loop at itab itno wa.
    Here i need to find client and number system id from the WA using regular expression in singe line
    endloop.
    Can anybody please explain how to write this.
    Thanks,

    Hi,
    What do you mean by FIND?
    If I got it right, you can use a READ statement with KEY f1 f2 etc BINARY SEARCH.Mention all the fields you want in the KEY fields.
    Dont forget to SORT this itab before the loop.
    Thanks
    Kiran

  • How do i find stats for my iweb designed/ mobile me hosted/ go daddy domain

    Please help me find out stats on how many visits to the site, etc.

    I use StatCounter on my sites and it gives me lots of info on visitors:
    Click to view full size
    This tutorial, #13 - Adding a StatCounter as an HTML Snippet, describes how to add it to iWeb pages.
    OT

  • Replacement of SEARCH ITAB statement in ECC 6.0

    Hello Experts,
    Can anybody tell me, which statement i can use to replace an obsolete statement i.e. SEARCH ITAB in ECC 6.0?
    Thanks in advance!!
    Best Regards,
    Bhupinder

    Hello,
    While using FIND statement, i am getting bellow syntax error
    As line type of the table "ITAB" in the CHAR MODE a indication-like and/or in the BYTE MODE a byte-like field was expected.
    My statement is
    FIND FIRST OCCURRENCE OF 'WHERE'
          IN TABLE ITAB
    What should i do to resolve this sytax error?
    Best Regards,
    Bhupinder

  • 10.5.2 Finder does not show root volume in side bar / desktop

    Hi,
    I was chating on IRC with someone who could not find his hard drive on the desktop and in the side bar after using a software. After checking the settings of the Finder, repairing the file permissions, I made a few attempts to make him reset the Finder state, without success.
    I made a few experiments on my side. I removed .DS_Store files and restarted the Finder. To my surprise, my drive is now missing from the side bar. I go to /usr with the Finder, the drive shows as if it was set "invisible". But I checked with GetFileInfo, and the /Volumes/Macintosh HD symlink has not the V attribute set while / has it. But as far as I can remember, it has always been the case.
    Anyone in the same case ?

    Folks,
    Francine Schwieder already solved the issue of the missing hard disk in side bar/desktop:
    Read her discussion and solution at http://www.pinkmutant.com/articles/invisible.html
    and the following thread http://discussions.apple.com/thread.jspa?messageID=6576031
    Albert

  • Statement SPLIT.

    Hi,
    i have a simle VAR1 (CHAR255) which contains text
    like 'test1morelines' or 'contain1moretext'' as example.
    I will only use the text before 1.
    i split at like this: split VAR1 at '1' into VAR1 dummy.
    It works OK, but i have to use the seconc VAR dummy.
    Is there any statement that deletes all char starting at vaue 1?
    thanks,
    regards, Dieter

    hiii
    first use FIND statement for finding '1' in variable then use sy-fdpos to get that position and then you can replace all value by 'SPACE' using offset (following abap statement)
    REPLACE SECTION [OFFSET off] [LENGTH len] OF dobj WITH new
                    [IN {BYTE|CHARACTER} MODE].
    regards
    twinkal

  • How to get Siri to find more specific things

    This may or may not need to go to Apple feedback, and if it does, sorry.
    I also admit I may be asking a lot.  Yet, here we go.
    Ok, as a sports writer who covers NHL hockey, it's super handy for me to use Siri to find stats really quickly.  I love that I can just ask "Who leads the Hurricanes in total points?" and boom, there it is.  Or get standings imediately.  Indespensible to the point that I am seriously considering writing my 5s off as a business expense.  True story.
    However... Siri has limits.  There's stats like all time record against certain teams, who leads teams or the league in more specific stats, and especially projected lineups.  I'd looooove to be able to ask Siri "Who's starting in goal for the Bruins tonight?" and get an answer boom right there.
    Is learning how to find more specific items a thing Siri can do, and if so, how would I go about teaching Siri this skill?  This is information readily available online, but having Siri fetch it would be fifty shades of awesome.
    Is this possible, or am I just asking way too much?

    It is not possible.

  • Find exact string using formula (excel)

    I'm trying to use FIND statement to find multiple strings in the context of a larger formula. The original formula I'm basing it off of is as follows:
    =IF(ISNUMBER(FIND("INC",A1))," ","Y")
    Obviously, this yields a Y if it finds whatever text in " ". However, I have many strings for which I'd like to check and they need to be exact; ie when I search INC and inc, I do not want Inc to be counted. So, I tried the following formulas.
    =IF(ISNUMBER(FIND(OR("INC",inc"),A1))," ","Y")
    =IF(SUM(COUNTIF(A1,"* INC*","* inc*}))," ","Y")
    The second one works best, but it also counts "Inc" as a match. Any suggestions?

    bk284,
    Well you've posted to the wrong forum as this forum is dedicated to questions/issues about customizing and programming Microsoft Project, a planning and scheduling application. However, your question is simple enough that I'll just take a shot at helping.
    Try the LOWER function, it converts a text string to lower case so the upper case, lower case issue goes away.
    If this answered your question, please mark it as the answer.
    In the future, for Excel related questions, use this forum: http://social.msdn.microsoft.com/Forums/office/en-US/home?category=officedev
    John

  • Regular Expression: Different results when using FIND or regex classes

    Hi,
    has anybody an idea why the FIND REGEX statement and the regex class delivers different results when searching for
    ^\*
    in
    I try to find every place with an asterisk as first sign of the line.
    The FIND statement
    DATA gv_string        TYPE        string.
    DATA gv_pattern       TYPE        string.
    DATA gt_match_result  TYPE        match_result_tab.
    gv_string = '****'.
    gv_pattern = '^\*'.
    FIND ALL OCCURRENCES OF REGEX gv_pattern
                               IN gv_string
                          RESULTS gt_match_result.
    returns one hit as expected. But the class cl_abap_regex and cl_abap_matcher returns four hits in this example:
    DATA gv_string        TYPE        string.
    DATA gv_pattern       TYPE        string.
    DATA gt_match_result2 TYPE        match_result_tab.
    DATA gx_regex         TYPE REF TO cl_abap_regex.
    DATA gx_matcher       TYPE REF TO cl_abap_matcher.
    gv_string = '****'.
    gv_pattern = '^\*'.
    TRY.
        CREATE OBJECT gx_regex
          EXPORTING
            pattern = gv_pattern.
      CATCH cx_sy_regex .
        BREAK-POINT.
        EXIT.
    ENDTRY.
    TRY.
        CREATE OBJECT gx_matcher
          EXPORTING
            regex = gx_regex
            text  = gv_string.
      CATCH cx_sy_matcher .
        BREAK-POINT.
        EXIT.
    ENDTRY.
    gt_match_result2 = gx_matcher->find_all( ).
    BREAK-POINT.
    Looks like the class doesn't consider the start of line symbol (^). Is there an error in my implementation?
    Any help is appreciated.
    Matthias

    Hi Jim,
    thank you for your reply. But to negate a value set of single characters you have to use
    [^  ]
    I used just the character
    ^
    This is defined as anchor character for the start of a line (See the documentation link you posted -> chapter 'Special characters for search strings') .
    As I understand it, should the FIND REGEX statement does the same as the CL_ABAP_REGEX and CL_ABAP_MATCHER classes. Therefore, I do not understand, why both implementations deliver another result.
    And I didn't find an answer for that. Does anyone else?
    Matthias

  • "FIND" vs "="

    Hi,
    Can somebody explain me, why
    FIND lc_keyword IN SECTION OFFSET lc_offset LENGTH lv_length OF lc_text.
    lv_result = boolc( sy-subrc = 0 ).
    is 30% faster than
    lv_result = boolc( lc_text+lc_offset(lv_length) = lc_keyword ).
    given
    CONSTANTS lc_text    TYPE string VALUE 'This is the text being searched for the keyword'.
    CONSTANTS lc_keyword TYPE string VALUE 'being'.
    CONSTANTS lc_offset  TYPE i      VALUE 17.
    DATA lv_result TYPE boolean.
    DATA lv_length TYPE i.
    lv_length = strlen( lc_keyword ).
    Does this mean we should switch to FIND for section-wise string comparison in performance-critical routines?
    --Florian

    For all those not capable of German, let me translate section 4.5 of the document "Requirements for ABAP Programs in Unicode System" mentioned by Volker. There are some more sections in this document that touch the topic of string comparisons, esp. section 4.5, but none of them comments on performance:
    4.2 Access with Offset and Length
    Generally, offset/length accesses are critical because the length of a character depends on the operating system, thus especially with mixed structures, it is not clear whether the unit to be used should be byte or number of characters. Although this led to considerable restrictions, offset/length accesses are still possible within the limits described in the following. These rules apply to accessing single fields as well as structures, the handing over of parameters to subroutines, and, finally, processing field symbols.
    1. Access to Single Fields
    Offset/length access is possible withcharacter-like fields, strings, and fields of types X and XSTRING. With character-like fields and fields of type STRING, offset and length are interpreted as number of characters. Only with types X and XSTRING, the values are interpreted as bytes.
    If your assumption is correct, Volker, this leads me to the question whether our equality operator lost traction with the switch to Unicode and should be reviewed for performance. After all, we are talking about one of the most common operations in all ABAP programs. Unfortunately, I do not have access to a non-Unicode system and cannot compare the two branches.
    Some more variant research led me to the following additional insights:
    The containment operator "CS" is 3% faster than the equality operator "=":
    lv_result = boolc( lc_text+lc_offset(lv_length) CS lc_keyword ).
    The "find" string function is 8% slower than the "FIND" statement, but still much faster than the "=" comparison:
      lv_result = boolc( find( val = lc_text
                               sub = lc_keyword
                               off = lc_offset
                               len = lv_length )
                         = lc_offset ).
    Here some absolutes for 1,000,000 repeats of the given code variants. Test system was our current development system for Business by Design Feature Pack 2.6, a system with - as far as I can tell - the latest core:
    Variant A (FIND):     344.314
    Variant B (find):     371.397
    Variant C (CS):       590.653
    Variant D (=):        607.270
    --Florian

  • State diagram: how to start??

    hi, i'm kinda new to UML diagramming and i hope you can help me in this...
    i have already drawn the use case for my project scenario, a class diagram, sequence/collaboration, activity diagrams.
    my problem is how do i start with a state diagram...i know it's about describing one (mebe more but usually one) object's behaviour throughout its lifetime, but how do i describe that in the diagram? do i need an object diagram for this (i didn't draw this diagram because i don't see any reason to yet)?
    can u guys teach me how to draw step-by-step the state diagram plz? thx....
    gildan2020

    yes, activity diagrams and state diagrams are related.
    While activity diagrams focus on the process.
    I normally do a state diagram and then do an activity diagram for the tricky transitions, or processes during a state. Therefor I identify the necessary activity diagrams by looking at my state diagram, but I guess it works the other way round as well. Very often I end up having one part of the behaviour modeled as activity diagram and one part as state diagram
    I find state diagram helpfull if an object has a certain behaviour at one point in time and a different behaviour at another time. Screenflow of a webapplication is one of my favorite examples. Each screen represents a state. Each link a transition. Even non technical users understand this very well.
    If you want to display such a behaviour in an activity diagram you end up with tons of decissions, while a state diagram shows the possibilities very visual.
    And no you don't have to have an object diagram before that. In some cases you will want to create one in the next step in order to clarify how an object 'looks like' when it is in a certain state.
    regards
    Spieler

  • Applescript won't run as .app but runs fine in AppleScript Editor

    I'm an experienced web developer.. but total applescript noob. so forgive me if this is a silly question.
    I'm calling my script it from Flash via fscommand to launch a PDF using finder, rather than a browser.
    The script works great from AppleScript Editor when i hit run but when saved as a .app it doesn't run.
    any ideas?
    Here's the code:
    property fileName : "my.pdf"
    set myPath to (path to me as string)
    set AppleScript's text item delimiters to ":"
    set the parentFolder to ¬
    ((text items 1 thru -2 of myPath) & "") as string
    set AppleScript's text item delimiters to ""
    try
    set targetFile to alias (the parentFolder & fileName)
    on error
    return quit
    end try
    tell application "Finder"
    open file targetFile
    end tell

    A script application is actually an application bundle - a bundle is a kind of folder that gets treated like a single item (in this case, an application). Getting path to me results in a path that ends with a colon (since it is a folder), so when you try to use text item delimiters to get the container you are actually just stripping off the trailing colon, so the path built for your file won't point to the correct location.
    As previously posted, the Finder can get the container, so you can just do everything in a tell application "Finder" statement:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #DAFFB6;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    property fileName : "my.pdf"
    set myPath to (path to me)
    tell application "Finder"
    set the parentFolder to container of myPath
    try
    open file ((parentFolder as text) & fileName)
    end try
    end tell
    </pre>

  • SY - System fields and return codes in ABAP

    Hi
    I'm new to ABAP, where do I find what the meaning of the system field return codes are ?
    example SY-SUBRC returns a number of codes 0, 2, 4, 8 etc what do they mean.
    Is there a resource somewhere that provides this information for all the system fields.
    I have searched high and low and have found little, they must be defined somwhere ?
    cheers Hugh

    Here is a listing of all of the system fields.
    http://help.sap.com/saphelp_scm50/helpdata/en/7b/fb96c8882811d295a90000e8353423/frameset.htm
    As for what the return codes( 0, 4, 8) for SY-SUBRC mean,  that is a little tricky.  The meanings of the values are dependent on what statement was used previously. They would mean different things when used with different statements.  For example, if you check SY-SUBRC after a FIND statement, the return code value 4, would mean something different than if you had check the SY-SUBRC value after doing an OPEN DATASET.  So you need to look at the specific statements in help.sap.com and see what it says about the SY-SUBRC values for each statement.
    http://help.sap.com/saphelp_scm50/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
    Regards,
    Rich Heilman

  • Currency Translation not working with "Time Reference from Variable"

    We have created several Currency Translations using RSCUR with a fixed "Key Date".  All have been working fine until we got the request to allow a variable date for the exchange rate date.  I have built a variable on 0DATE which I am putting a default date value into using user exit.  This default date is the SAME date as the fixed "Key Date" which we have been using.  Unfortunately when we use the "Time Reference from Variable" option and use this new variable, no currency conversion is taking place, instead it only shows the original currency values.  I am 100% sure that my variable is getting a value and it is the same date we are using for the fixed "Key Date" value so both methods should be using the exact same exchange rates.  The documentation that I can find states:
    ●      Time reference: The time reference for the currency translation can be either fixed or variable.
    If the time reference is fixed, the time at which the exchange rate is determined is independent of the data. You have the following options:
    ○       You can establish that the time reference be determined upon translation.
    ○       You can select the current date.
    ○       You can specify a fixed date as the key date.
    ○       You can specify any variable that exists for InfoObject 0DATE.
    ○       You can establish that the query key date be used. This is determined in the query settings.
    In my case I am only switching from option "You can specify a fixed date as the key date"=(Key Date) to "You can specify any variable that exists for InfoObject 0DATE"=(Time Reference from Variable).
    What am I missing?  Any help is appreciated.

    I neglected to mention that we are calling this currency translation through a WAD button using the SET_CURRENCY_TRANSLATION command.  I did do a test by applying the currency conversion within query key figure.  This seems to work.  So it appears the issue is with how the WAD is processing the variable, not the query.  When I display the variable in a drop down item within the WAD it does have the default value that I have assigned in user exit.

Maybe you are looking for

  • Ipod classic always has to restore, then doesn't sync

    Hello, my ipod's problem is the following. Whenever I connect it to itunes it comes up saying itunes has found a damaged ipod and it need to be restored, so then I restore, because I have no other option. After this, I press sync and it starts syncin

  • Please reply to this: non-consecutive element

    Hello Every one, How can i process non-consecutive element in the forall loop to update the table . i can not use .exists method as if in not allowed in forall syntax. So please can anyone give me example how to process in forall loop. in 10g we can

  • Burnt display port

    My LED display was hooked to my MacBook air and then its stopped working.... after troubleshooting for a while I notice that the Mini-Display port on my MacBook and the cord is singed. Now the Display is inoperable. This happen to anyone else? Can I

  • Stepper motor vi

    Hi, I am relatively new to the labview codes for stepper motor control. Let me start by writing what I am trying to achieve. I am trying to control a valve with a stepper motor. I have a bipolar stepper motor from Oriental motor co. mounted on the va

  • Dvd/ cd-rom driver disabled !!!

    I have gone thru all of apple's recommendations multiple times, and I still cant get this problem to go away. Please help!!!