How to concatenate a string with spaces

Dear experts,
I would like to concatenate a string with three spaces, for example,
CONCATENATE 'X' SPACE SPACE SPACE 'Y' INTO LV_RESULT.
However, the result I got from executing the above statement is not 'X   Y' as I want, but rather 'XY'.
I did try
CONCATENATE 'X' '***' 'Y' INTO LV_RESULT.
REPLACE '***' with '   ' INTO LV_RESULT.
still doesn't work.
How can I write ABAP code to archive such a result?
Any idea would be appreciated.
Vitthavat A.

dear  Oliver Hütköper and koolspy,
I tried your solutions, and it works.
so i awarded points to you.
anyway, while trying the 'respecting blanks', i got an error:
"".", "IN BYTE MODE", "SEPARATED BY ..." or "IN CHARACTER MODE" expected"
not sure what it means. but it's ok. the problem has been solved.
thanks again.

Similar Messages

  • How to concatenate a string with single quotes

    Hi all,
        how to concatenate a string with single quotes to a variable.
    Sathya

    Hi sathyabama,
    1. simple
    2. use TILDE character <b>(`)</b>
       (just left to the '1' key)
    <b> `'mystring'`</b>
    3. just copy paste
    report abc.
    data : m(100) type c.
    concatenate `'amit mittal'` 'hello' into m separated  by space.
    write m.
    regards,
    amit m.

  • How to pad a string with space or other character

    length 14 string '00000000000155' turn to length 25 string '00000000000155         ' ,use space to pad string trail.
    using following function:
    CONCATENATE '00000000000155' '         ' into lv_string
    but result is the lv_string ='00000000000155',the spaces were not added the string trail.
    how to achieve this purpose padding string.
    pls help me.
    thank you.

    Hi ,
    Not sure what exactly you require, But in my understanding you need to add one more spave after the doknr no. Please refer this code which could be more useful.
    data: lv_objkt like aeoi-OBJKT,
          lv_doknr like draw-doknr,
          lv_dokar like draw-dokar,
          lv_doktl like draw-doktl,
          lv_dokvr like draw-dokvr,
          lv_slen type i.
    lv_dokar = 'DRW'.
    lv_doknr = '00000000000155'.
    lv_doktl = '000'.
    lv_dokvr = '-'.
    CONCATENATE lv_dokar lv_doknr INTO lv_objkt.
    lv_slen = STRLEN( lv_objkt ).
    lv_slen = lv_slen + 1.
    lv_objkt+lv_slen(3) = lv_doktl.
    CONCATENATE lv_objkt lv_dokvr INTO lv_objkt.
    WRITE: lv_objkt.

  • How to delete the file with space in name

    Hi
    I want to delete the file "test ex.txt" file.
    i run the following command in command prompt.i can delete the file successfully.
    /bin/rm -f /mnt/"test ex.txt"
    I want to run the command from java.So i am using the following code
    String cmd = "/bin/rm -f /mnt/\"test ex.txt\"";
         Runtime rt = Runtime.getRuntime();
    process = rt.exec(cmd);
    The file was not deleted.
    How to delete the file with space in name?
    Help me

    Use the form of exec that takes an array of command + args.
    arr[0] = "/bin/rm"
    arr[1] = "-f"
    arr[2] = "/home/me/some directory with spaces";Or use ProcessBuilder, which is the preferred replacement for Runtime.exec, and which Runtime.exec calls.

  • How to concatenate single quote with any field like 'VBAK'

    Hi,
    How to concatenate single quote with any fields.
    say for example I have table name as MARA, I have to pass that table name to other fields with single quote , like I have to pass that as
    tab name = 'MARA'.
    but how to do this,
    below statement will not work
    concatenate '''  'MARA'   ''' into string.. it's giving syntax error...
    Regards,
    Mrunal

    gv_name = 'MARA'.
    gc_quote = '''.
    CONCATENATE gc_quote gv_name gc_quote INTO value.
    Pushpraj

  • Use REGEXP_INSTR to find a text string with space(s) in it

    I am trying to use REGEXP_INSTR to find a text string with space(s) in it.
    (This is in a Function.)
    Let's say ParmIn_Look_For has a value of 'black dog'. I want to see if
    ParmIn_Search_This_String has 'black dog' anywhere in it. But it gives an error
    Syntax error on command line.
    If ParmIn_Look_For is just 'black' or 'dog' it works fine.
    Is there some way to put single quotes/double quotes around ParmIn_Look_For so this will
    look for 'black dog' ??
    Also: If I want to use the option of ignoring white space, is the last parm
    'ix' 'i,x' or what ?
    SELECT
    REGEXP_INSTR(ParmIn_Search_This_String,
    '('||ParmIn_Look_For||')+', 1, 1, 0, 'i')
    INTO Position_Found_In_String
    FROM DUAL;
    Thanks, Wayne

    Maybe something like this ?
    test@ORA10G>
    test@ORA10G> with t as (
      2    select 1 as num, 'this sentence has a black dog in it' as str from dual union all
      3    select 2, 'this sentence does not' from dual union all
      4    select 3, 'yet another dog that is black' from dual union all
      5    select 4, 'yet another black dog' from dual union all
      6    select 5, 'black dogs everywhere...' from dual union all
      7    select 6, 'black dog running after me...' from dual union all
      8    select 7, 'i saw a black dog' from dual)
      9  --
    10  select num, str
    11  from t
    12  where regexp_like(str,'black dog');
           NUM STR
             1 this sentence has a black dog in it
             4 yet another black dog
             5 black dogs everywhere...
             6 black dog running after me...
             7 i saw a black dog
    5 rows selected.
    test@ORA10G>
    test@ORA10G>pratz
    Also, 'x' ignores whitespace characters. Link to doc:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/conditions007.htm#i1048942
    Message was edited by:
    pratz

  • How to create a String with a specific size?

    how to create a String with a specific size?
    For example I want to create different Strings with the size of 100 , 1000 or 63k byte?

    String are immutable so just initialize it with the number of characters you want.
    You might want to look at java.lang.StringBuffer and see if that's what you want.

  • How to print a string with out using main method??

    how to print a string with out using main method??
    if we can tell me with example?
    thanks in adavance
    raja

    Hi,
    actually there's none. The UITableView class needs to "know" the tableView's height so either it can calc <number of rows> times <row height> or it has to sum the height of each single row.
    If the row which needs to be of different size always is the first or the last row you can user a tableHeader or tableFoot view.
    Regards
    Dirk

  • Padding String with spaces -tried known methods but code not working!

    I am trying to figure out an easy way to pad a string with spaces at the end. The way that definitely works is a for loop where string = string + " "; until string is the length that I need. However, for several dozen strings this is a lot of unnecessary overhead. I've done some research and tried a few different things - yet none of them seem to actually pad the string.
    import org.apache.commons.lang.StringUtils;
    public class Test
         public static void main(String[] args)
              String one = "1234";
                    //print string at current lenght
              System.out.println(one+"*");
                    //try padding using String.format (in padRight method below)
              one = padRight(one,(8-one.length()));
              System.out.println(one+"*");
                    one="1234";
                    //try padding using StringUtils
              String tmp = StringUtils.rightPad(one, (8-one.length()));
              System.out.println(tmp+"*");
         private static String padRight(String s, int n)
              return String.format("%1$-" + n + "s", s);
    }I've researched and these are the two most common methods people are suggesting. I am using java 1.5 so the String.format should work.. however, when I run it (I use JBuilder) the output is always "1234*".... after I try to pad it the output should be "1234 *" (with 4 spaces between the 4 and *) . Any suggestions is greatly appreciated! Thanks in advance.

    Wow, I completely botched that... uncle_alice, thank you for clearing that up for me.
    pbrockway2 - thank you, I actually did peruse the Formatter documentation - I would never post without researching something first... but I must have read it with one eye shut because walked away with the impression that I needed to submit the difference. I obviously misunderstood the documentation.
    Thanks!

  • How to split a string with linefeed character ( LF ) as a delimiter in VB6?

    Hi. I am writing a small program in VB 6.0. 
    I have a string named Data and it contains few characters along with <LF> in it. ( <LF> is a new line/line feed character).
    I want to split this string with <LF> as delimiter and store the tokens in an array. I tried with split function and its giving me type mismatch error. Can anyone tell me how to do it?
    I am giving the pseudo-code below.
    Dim Data as string
    Data = "hello, how are you<LS>good morning guys <LS> hi"
    Dim strarray() as stringMsgbox(Data)
    strarray = split(Data, "<LS>")
    When i see the Data in message box before split function, it shows up in different lines like this:
    hello, how are you
    good morning   guys 
    hi
    I want the final array strarray to be like this:   strarray(0) = "hello, how are you"
    strarray(1) = "good morning   guys "
    strarray(2)  = " hi"
    The spaces can be as it is. Just i need the string to be delimited wherever <LS> is there.
    Please help me as soon as possible. Though it is small one, i am stuck here.
    Thanks in advance,
    Satya.

    Hello,
    This forum is for VB.NET, please check the following resources
    http://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/6a0719fe-14af-47f7-9f51-a8ea2b9c8d6b/where-to-post-your-vb-6-questions?forum=vbgeneral
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • How to create a String with comma ?

    Hi All,
    I have a table with 10 records(employee name) and i have to make a string
    with comma delimiter and at the end with "."
    Can anybody tell me how to write a Java program for this ?
    Thanks in advance.

    // I believe the following example gives you the answer.
    class stringEG {
         public static void main(String args[]) {
         String emprs[] ={"1","2","3","4","5","6","7","8","9","10"};
         String vempname = "";
         for(int i=0; i<emprs.length; i++) {
         if(i == (emprs.length-1))
              vempname = vempname + emprs[i] + ".";
         else
              vempname = vempname + emprs[i] + ", ";
         System.out.println("vempname : "+vempname);
    Here dont assume that I asked you to get all the results and putting
    it into the string arrays. But its a simple example to suit your requirement.
    The half-way coding below answers your question, I hope.
    vempname = "";
    while (emprs.next()) {
    if(emprs.isLast())
    vempname = vempname + emprs.getString("empname") + ".";
    else
    vempname = vempname + emprs.getString("empname") + ", ";
    // nats.

  • Padding a string with spaces

    How do you pad a string w spaces using "Format into a string" w/o typing /s/s/s/s/s for say 5 spaces ?
    Solved!
    Go to Solution.
    Attachments:
    printed output.PNG ‏6 KB
    wire diagram.PNG ‏11 KB

    Hi Clint,
    this way:
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Breadcrumbs containing string with spaces - generating the anchor

    so I have a website that contains a 'breadcrumbs' line that allows users to click on it, and take them back to the parent page
    eg. "jewellery"
    I simply suffix this string with ".cfm" to generate the anchor / filename
    what's the best way to deal with strings containing spaces?
    eg. "birthday cards"
    As good practice I want to use a more compatiable filename that doesn't include spaces
    eg. "birthday_cards.cfm"
    is the REPLACE command ok to use ? or is preferrable to add an additonal field to the table, called "filename" and store the exact filename in there ?

    option 1
    use quotes like href="http:\\....."
    option 2
    convert spaces to %2B

  • How to get a string with fixed length

    I want to implement something like movechar() of c in java. I want to return a string which has a fixed length that contains the given string and spaces for remaining length.
    Please let me know how can I implement it.
    Thanks & Regards,
    Nasrin.n

    Do you mean padding a String?
          * This method pads the string s to size n using char c to make up for missing characters.
         public static String padString(String s, int n, char c, boolean paddingLeft) {
              StringBuffer str = new StringBuffer(s);
              int strLength = str.length();
              if (n > 0 && n > strLength) {
                   for (int i = 0; i <= n; i++) {
                        if (paddingLeft) {
                             if (i < n - strLength) str.insert(0, c);
                        else {
                             if (i > strLength) str.append(c);
              return str.toString();
         }

  • How to integrate Microsoft Calendar with Spaces

    how to integrate Microsoft Calendar with Spaces

    Najeeb, the steps mentioned in the guide are related to integration of Microsoft Exchange Calendar not Outlook Calendar. I was assuming that you are interested in integration of Outlook Calendar using desktop connector similar to connector for MS. word, MS.excel and MS.powerpoint.
    How to integrate Group Space Events To Outlook Group Calendars [ID 1117746.1]

Maybe you are looking for

  • Adobe acrobat 6.0

    I have a pdf pdf file where I created form fields. When I try to print the form the fields are blank. How do I correct so that the fields print?

  • List Template not visible

    Hi, I have two sites A and B. I save a list as template in site A and then import it in site B. I can create a new app using that template. I save another list as template in site A and then import it in site B successfully. But this one I don't see

  • Photosmart Essentials will not install Fatal Error

    Windows Vista Home Premium.  -- I recently move my Photosmart D7560 printer to a different computer.  I need to install Photosmart Essentials to allow me to print to a printable CD.  I downloaded the latest drivers for the full featured installation

  • How to hide elements to printer inside muse? / Como esconder elementos a la impresora en muse

    English Hello guys, there is any option to hide elements on muse site for no printing, I'm working on a catalog with pront option but i dont want the navigation menu buttons on my print sheets, any idea? Spanish Hola a todos, hay alguna opcion que bl

  • App Store appears in dock upon login despite removal

    Whenever I startup my MBP The App Store app is on the dock between Safari and Mail but not open. I have never opened it from there and I promptly remove it. When I go to the apple symbol and open it from there after its removal from the dock it will