DUMP: replace all occurrences of space in string1 with string2.

Why does this statement results in a dump:
replace all occurrences of space in string1 with string2.
same with
replace all occurrences of ' ' in string1 with string2.
string2 is a string without spaces!
Is there any drawback on using this statements as a workaround?
while sy-subrc eq 0.
  replace space with string2 into string1.
endwhile.
Thanks
norbert

Hi,
See this example i got from ABAPDOCU
replacing values
DATA: t4(10) TYPE c VALUE 'abcdefghij',
      string4 LIKE t4,
      str41(4) TYPE c VALUE 'cdef',
      str42(4) TYPE c VALUE 'klmn',
      str43(2) TYPE c VALUE 'kl',
      str44(6) TYPE c VALUE 'klmnop',
      len4 TYPE i VALUE 2.
string4 = t4.
WRITE string4.
REPLACE str41 WITH str42 INTO string4.
WRITE / string4.
string4 = t4.
REPLACE str41 WITH str42 INTO string4 LENGTH len4.
WRITE / string4.
string4 = t4.
REPLACE str41 WITH str43 INTO string4.
WRITE / string4.
string4 = t4.
REPLACE str41 WITH str44 INTO string4.
WRITE / string4.
SKIP.
ULINE.
Example for condensing strings
DATA: string9(25) TYPE c VALUE ' one  two   three    four',
      len9 TYPE i.
len9 = strlen( string9 ).
WRITE: string9, '!'.
WRITE: / 'Length: ', len9.
CONDENSE string9.
len9 = strlen( string9 ).
WRITE: string9, '!'.
WRITE: / 'Length: ', len9.
CONDENSE string9 NO-GAPS.
len9 = strlen( string9 ).
WRITE: string9, '!'.
WRITE: / 'Length: ', len9.
SKIP.
ULINE.
Thanks & Regards,
Judith.

Similar Messages

  • Replace all occurrence with range - issue

    Hi,
    I have a range with "letters" like ":" or "-" or "."
    Note: all entries are with option = "equal"
    Now i need to "replace all occurrences" of "all entries in that range" with space.
    idea:
    loop at range assigning <range>.
    replace all occurrences of <range>-low in aaa with space
    endloop.
    Any better ideas ?
    Regards,
    Gordon

    Sorry but i think my question was not clear.
    is there another way instead of using the "loop" ?
    The translate or replace statement is not the problem
    thx,
    Gordon

  • Replacing all occurrences of characters in a string with one new character?

    Hi there,
    I'm looking for a way that I could replace all occurrences of a set of specific characters with just one new character for each occurrence.
    For example if I have a string which is "word1...word2.......word3....word4............word5" how would I be able to replace this with just one character such as ":" for each set of "." so that it would essentially appear like this "word1:word2:word3:word4:word5"
    If I just use replace(".", ":") I am left with "word1:::word2:::::::word4::::word5::::::::::::"
    So therefore I'm guessing this would require the use of replaceAll() maybe? but I'm not really very familiar with how regular expressions work and how this would be accomplished using them.
    Any help would be greatly appreciated :) Thanks.

    Yes, but "." means any character, so ".\+" means "any character repeated more than once". If you just mean a full stop ("period" for you Americans :p) you should use "\.+" as your regular expression, but remember that for Java you need a '\' escape to recognise '\' as '\', so in code you'd actually type your regex as:
    "\\.+"Here's an example of one way to do it:
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    public class Test {
        public static void main(String[] args) {
           String string = "example1.......example2...example3.....example4";
         Pattern pattern = Pattern.compile("\\.+");
         Matcher stringMatcher = pattern.matcher(string);
         string = stringMatcher.replaceAll(":");
         System.out.println(string);
    }Edited by: JohnGraham on Oct 24, 2008 5:19 AM
    Edited by: JohnGraham on Oct 24, 2008 5:22 AM

  • Replace all occurrences of ENTER in a string

    Hi,
    I have a string which contains line breaks:
    '<HTML><HEAD>
    </HEAD>
    <BODY>'
    and it is shown to me in the debugger as:
    '<HTML><HEAD>#</HEAD>#<BODY>'
    Now I want to replace all line breaks in the string,
    but
    replace all occurrences of `#` in text with ' '.
    doesn't work.
    So if you have an idea how to replace the # symbol for Enter in a string please tell me ;).
    regards,
    Stefan

    Hi,
    Pls use
    replace all occurences of '#' in text with cl_abap_char_utilities=>newline.
    Eddy

  • Replace all special characters in a String with underscore

    I have a String which contains some special characters even(!,$,@,*....).
    I need to replace all the special characters with _ in my String. I do have an idea of using String.replace() and analogous forms, but I would be thankful if anyone can suggest me of a better and an efficient way.
    regards,
    fun_one

    Kaj,
    Thx for your earnest reply. I did have a peep into the API on this method. But the regular expression that I need to use here was beyond my understanding. It did specify some regex that I put to use (something like myString("\D","_"), assuming that I need to replace all non-digit characters ), but it really did not help me getting the result.
    Would you spare some code for me reg. the usage of regular expressions in such a scenario?
    cheers,
    fun_one

  • How to Replace All the Bridge CS6 Stock Keywords With Bridge CS5 Keywords

    I have CS6 working in a different computer than the one that houses CS5. Bridge CS6 can read CS5 keywords when it opens an "old" photo but it has none of its own (besides the stock ones that came with the program). How can I replace all the stock CS6 keywords with the keywords from CS5?

    Have you tried the Import/Export options from the tiny menu at the top-right of the Keywords panel?

  • CS6 Find Font Replace All replaces all the text in that font with a space.

    Anybody else have this happen? It's happened to me more than once, so I don't think it's a fluke. The first time around I never noticed it until it was way too late to use UNDO. Disconcerting to say the least. It takes out all the words in that font and inserts a space.
    Using Lion 10.7.4
    MacBook Pro 2011
    CS6
    Profuse thanks to anyone who can enlighten me…
    Vicki

    backup entire site
    edit > find & replace
    find in > entire current local site or current document (whichever you prefer) 
    search > specific tag > <font> 
    Click the "-" symbol to remove tag modifier options 
    action > strip tag > replace all

  • Replace all references to files and folders with lowercase in web documents on a site

    Hi I'm working on a test server that runs Ubuntu Unix (but my PC which has Dreamweaver CC is running Windows 8.1). I would like to search and replace in Dreamweaver to change all src and href attribute values inside files (webpages, css, etc.) on my site to lowercase, but with the folder and file names' spelling otherwise unchanged. I already changed the names of the actual files and folders, but wanted to make all references in my files point to them again. I started to use regular expressions in the specific tag search, but I was not sure how to specify letter case conversion on a backtracked value. Some flavors of RegEx allow you to replace a searched value in parentheses with its lowercase counterpart by specifying something like this: \L\1
    Where \L converts the character captured in the reference \1 to lowercase. Thanks.

    Hi Jon,
    Thanks for your response. Yes, I tried. But I’m not sure you can use any RegEx special characters in the replacement text. I put in \L0 and it just replaced the match with the literal string, so href=”Support/Index.HTML” became href=”\L0”
    What I want is href=”support/index.html”
    The reason I didn’t use Dreamweaver to change the actual file and folder names is I have images widely dispersed in subfolders. I didn’t think Dreamweaver would automate that part—I think you can only select a file individually to rename it, and then DW will correct all references to it. But probably can’t rename everything with one command from the root. Well, this is turning out harder than I thought.
    Let me know if you have any other ideas.
    Thanks,
    Dave.

  • How did I replace all footage from one imovie project with another

    I have three projects in my project library A, B and C. While editing B I somehow accidentally copied all my clips from project B into project A, erased all project A footage while the title remained the same. I want my project A footage back and can't find it. Time machine wasn't set up at the time (I thought it was automatically already going from the day I purchased it). Undo functions only go back once. Three people at Apple have no answer, saying that you can't transfer contents from one project library piece to another while still in the project library part of the screen. I'm sick if it's lost because it took forever to edit, but I want to figure out what I did so I don't accidentally do it again. If I didn't transfer from project to project, how did a copy of B get into my A file and erase its contents?
    Project A seems gone, as the orange lines in the event library clips indicating which parts have been used are also gone.

    Choose Go to Folder from the Finder's Go menu, provide /Users/ as the path, drag one account's home folder to the other's desktop, and move the items inside it to the desired locations.
    (109743)

  • Is there a quick way to replace all the faces in the crowd with those of a few friends' faces?

    I took some photos of the crowd at the fabulous McCartney concert in Phoenix. I would like to replace them with the faces of three people for an article I'm doing about the concert. I was hoping that there was a feature that would automate this somehow or at least cut a few hours off the work.
    Lou

    No.
    Mylenium

  • About REPLACE ALL functionality

    Dear All,
    I have one string which contains '#' in between. And I want to replace all these '#' with ' ' (ie blank SPACE)..
    For this I am using:-
    REPLACE ALL OCCURRENCES OF '#' IN L_TEXT WITH ' '.
    But to my greatest surprise, its not able to replace it saying sy-subrc = 4 ie its not able to locate '#'.
    I have observed following:-
    1. Suppose L_TEXT = 'corrective action## is that# to be #taken'
    then replace all fails.
    2. But suppose L_TEXT = 'corrective action # # is that # to be # taken'
    then its works.
    I tried the option of
    REPLACE ALL OCCURRENCES OF REGEX '#*' IN L_TEXT WITH ' '.
    But its putting ''#" after every character !!!
    And the same functionality works with CRM4.0's ABAP editor but now when i am using it in CRM2007's ABAP editor, its not woking.
    I have tried it in ABAP editors of other systems like PRD n all. Its working there too.
    Can anybody please shed some light on this?
    regards,
    Amey Mogare

    Yes Matt,
    I suspect its not the actual character "#". !!!!
    Actually in one of the CRM transaction GUI, there is a Text Box where user can enter his Survey details. In this, if he enters a newline then in FM i'm getting it as "#"... What I mean is if I write :-
    Heading 2: h2.
    Containment text
    is as follows
    line 1
    line2
    Heading 2: h2.
    Then in FM's field its represented as
    Heading 2: h2.
    Containment text# is as follows# line 1# line2
    Heading 2: h2.
    But this is getting messed up in when we dump it into excel sheet.
    So how do i replace these with Spaces?
    sample code line would be very helpful.
    Thanks a lot for pointing this out.
    regards,
    Amey

  • Replace all occurences in 4.6c

    Hi,
    I have a program which analyse system and gives some output.(Regarding programs,FM's etc).
    I need to run this my present server which is of 4.6c.
    But this program developed in ECC 6.0 and when i loaded this notepad program it was giving some errors.
    One error is REPLACE all occurrences of '('  in i_userexit-txt WITH space.
    In 4.6 c it is not accepting ALL OCCURENCES.
    It is accepting only Replace first occurence.
    What i need to do to replace all occurences in 4.6C?
    I there any statement to replace all Occurences?
    I searched in ABAP help  for 4.6c also.
    Please help to correct this.
    Regards,
    Krishna.

    you can do something like this, this wil do REPLACE ALL OCC...:
    WHILE sy-subrc EQ 0.
    REPLACE ... " acc. to 4.6 Syntax ...
    ENDWHILE.

  • Substitutions Replace All

    Since I like to output manuscrupts to ePUB for reading in iBooks, I prefer to have typographical quotation marks—smart quotes—on. Pages 5's parity with Pages for iOS made it more difficult to globally search-and-replace ordinary quotes (inch marks) with smart quotes from the Find & Replace dialog. (The crippling of the Find & Replace even more is a subject for another rant ) But it seemed Pages 5 has the answer in its Show Substitutions submenu.
    In the help, it says:
    Choose Edit > Substitutions > Show Substitutions (the Edit menu is at the top of your computer screen).
    In the Substitutions window, select the Smart Quotes checkbox.
    Choose a quotation mark style from each of the pop-up menus.
    Click a button to replace all occurrences of quotation marks in the document, or just in the selected text.
    Which I thought means if I have straight quotes and double-dashes, hitting "replace all" or "replace in selection" will convert them to curly quotes and em dashes.
    But it doesn't.
    So far as I can tell, nothing happens.
    Knowing that a lot of this is actually shunted into OS X's Text preferences, I tried making sure the Text preferences were set properly, quit all apps, restarted, opened Pages, opened a new document, typed in a test sentence with straight quotes and double-dashes, and then did the above Help procedure.
    Nope. Still nothing happens.
    I hope this is a bug and not another "refinement". I reported it as a bug.
    This wouldn't matter on documents edited on the Mac, since typing smart quotes and em dashes still work. Moving around from Pages on iOS, however—where getting to the correct quotes is a bit of a chore—I liked being able to do a global "smartify my quotes" on Pages on Mac. But like I said, can't seem to do that anymore—and the Help seems to say that I should, using the Substitutions dialog.
    Have you gotten this to work? Have I misinterpreted what the Substitutions submenu and dialog is supposed to do?

    A workaround, of sorts. After pasting large amounts of text (full of straight quote marks and straight apostrophes) into Pages documents I, too, have tried and tried to convert to smart quotes, only to be frustrated. (I also spent quite a bit of time on the phone in November 2014 with a Pages tech support person, and he could not provide an answer. He promised to pass this on to the Pages team. This is where you start holding your breath...) Here is my workaround until (if) Apple fixes this. You are going to groan when I say this, but if you have Word on your Mac simply copy and paste the text into Word. (Perhaps you may find another word processor that does the same thing.) There the conversion is quick and simple. Then paste it back into Pages. I happen to have an older copy of Word because I was forced to start using Pages when the version of Word would not utilize the Retina display on my new Power Book an everything was fuzzy.

  • REPLACE ALL OCCURRENCIES

    Hello
    Can somebody explain me the logic of ALL OCCURRENCIES in the the example below :
    I think that this operator should replace A , ! with ' ' but the real output is different.
    The real output is AA!A. It replaces all small characters with ' '. Why
    DATA : l_PD(10) TYPE C.
    l_pd = 'AbbA!A'.
    replace all OCCURRENCES OF REGEX
      '[^!"%&''()*+,-./:;<=>?_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ]' in
      l_pd with ' '.

    ... and put search (patterns) characters in square brackets [[ and ]].
    See also [Regular Expressions in Routines|http://help.sap.com/saphelp_nw70/helpdata/en/42/9d6ceabb211d73e10000000a1553f6/frameset.htm]
    Regards,
    Clemens

  • GoLive component sizing and replace-all

    My Web site has a number of pages with a single GoLive "component" as a navigation bar (navbar). I have created a new navbar in InDesign, saved it as a PDF and as a .gif.
    (1) Do I size the new navbar precisely in InDesign, or on each page in GoLive? Or elsewhere?
    (2) How do I properly get the PDF or gif into the web-content > Components folder?
    (3) How do I replace all navbars in the Web site with the new one? One at a tme? Or--???
    Thank you.

    My Web site has a number of pages with a single GoLive "component" as a navigation bar (navbar). I have created a new navbar in InDesign, saved it as a PDF and as a .gif.
    (1) Do I size the new navbar precisely in InDesign, or on each page in GoLive? Or elsewhere?
    (2) How do I properly get the PDF or gif into the web-content > Components folder?
    (3) How do I replace all navbars in the Web site with the new one? One at a tme? Or--???
    Thank you.

Maybe you are looking for

  • How can i send multiple videos and photos, via mail, at the same time?

    you allowed to send only one video or 10(+) photos via mail. but can you send both at the same time? so 10(+) photos and a video (or more than one) in one mail? because if my mom has birthday pictures or something like that. She likes to be able to s

  • Reinstalling Audition after Windows 7 crash/corruption

    My Audition CS5.5 went down after a Windows 7 blue screen crash and won't run now.  I understand that I'm entitled to reinstall it from Adobe's web site but would like to know how to do that.  I hope reisntalling will fix the problem, which is the la

  • Change Gl Account in F-28 Transaction

    Sir, There is File Bank Charge in F-28 T-code, when Post the Document, This Bank Charge in Posting in a GL. but I want to post the this Bank Charge in different GL on some condition. So Plz Guide me how to do. Thanks ! Ram

  • Flex fields in default BPM view 11.1.1.3.0

    Hi I Jdeveloper 11.1.1.3.0 I have created a SOA composite with a BPEL flow containing a Human task. In this task I have added data fields (flex fields) which I'm able to show in the Oracle BPM worklist using the Adminstration menu option and adding t

  • Is it possible to use run-time configuration in conjunction with Session Manager?

    I'm trying to avoid using MAX, basically because it's a pain for users to configure MAX when the application already knows what the configuration is. I actually get the configuration from a database, but that's another story. I've experimented with r