How to add space before a string a variable.

Hi,
If i have a string variable  ' 80 '.I want it as '    80 ' ie some space appended before it.
I used  concatenate '   '    variable into variable..Its not working.How to do it??
Thanks.

check below code
Concatenate ' ' string into string respecting blanks.
<b>
... RESPECTING BLANKS</b>
Effect
The addition RESPECTING BLANKS is only allowed during string processing and causes the closing spaces for data objects dobj1 dobj2 ... or rows in the internal table itab to be taken into account. Without the addon, this is only the case with string.
Note
With addition RESPECTING BLANKS, statement CONCATENATE can be used in order to assign any character strings EX>text - taking into account the closing empty character - to target str of type string: CLEAR str. CONCATENATE str text INTO str RESPECTING BLANKS.
Example
After the first CONCATENATE statement, result contains "When_the_music_is_over", after the second statement it contains "When______the_______music_____is________ over______" . The underscores here represent blank characters.
TYPES text   TYPE c LENGTH 10.
DATA  itab   TYPE TABLE OF text.
DATA  result TYPE string.
APPEND 'When'  TO itab.
APPEND 'the'   TO itab.
APPEND 'music' TO itab.
APPEND 'is'    TO itab.
APPEND 'over'  TO itab.
CONCATENATE LINES OF itab INTO result SEPARATED BY space.
CONCATENATE LINES OF itab INTO result RESPECTING BLANKS.
Rewards if useful.........
Minal

Similar Messages

  • How to increase space before a Heading

    Hi, Three things are really getting to me in Pages 9.
    1. Can I a dotted line in the TOC for each line item. e.g.
    Heading 1.................2
    Heading 2..............3
    Heading 2..............4
    2. How do I add space before the style at the top of the page. eg.
    --- top of page ----
    [space
    of
    lets
    say 5 cm]
    Heading 1
    I can add the space IF I add an empty paragraph as the first line and add a value to "before paragraph' text inspector.
    3. Can I create a TOC which will display the headings I have in the floating text boxes?
    thanks in advance

    Hi stnsw,
    Welcome to Apple discussions and the Pages '09 forum.
    singletracknsw wrote:
    Hi, Three things are really getting to me in Pages '09.
    1. Can I a dotted line in the TOC for each line item.
    The dotted line running from the text to the next tab stop is called a 'leader.'
    A look at the article_Setting Tab Stops to Align Text_ in Chapter 5, Working with Text in the Pages '09 User Guide will explain how to set leaders to tab stops. The article starts on p. 91
    Short answer: use the Tab section of the Text Inspector.
    2. How do I add space before the style at the top of the page. eg.
    Several ways.
    • An inserted shape, either floating and set to cause wrap using the button that prevents text to the right and left of the object, or inline, and set in a paragraph of its own above the first 'real' text on the page. The object may be white, transparent, or set to any colour with opacity set to zero.
    • Type a return character before the first text on the page. Select the return and set the font size to 144 points (two inches) Adjust the size to taste using command-+ (larger) and command- - (smaller).
    • Use the Inspector to set the space before the first paragraph, as you described.
    I can add the space IF I add an empty paragraph as the first line and add a value to "before paragraph' text inspector.
    3. Can I create a TOC which will display the headings I have in the floating text boxes?
    Not using the TOC tools in Pages.
    You'll find the Pages '09 User Guide a valuable (and mostly easy to read) resource. It can be downloaded through the Help menu in Pages.
    Regards,
    Barry
    Regards,
    Barry

  • How to add '%' to a query with bind variables

    Hi,
    I am using oracle jdeveloper 11g.
    I am trying to create a table to display rows using the below query in a jspx page,
    select * from ade_txns where series='WORKPLACE_PT.11.1.1.8.0_GENERIC' and transaction like 'rkumara%'
    I am using a view with query and binding variables as below,
    select * from ade_txns where series= :p_series and transaction like :p_QAEngineer
    I will be passing p_QAEngineer using binding variable using 'ExecuteWithParams' using a dropdown(eg: 'rkumara'). But I need to add a '%' to this value as I am using a 'LIKE' clause in my query.
    I tried using,
    select * from ade_txns where series= :p_series and transaction like :p_QAEngineer+'%'
    But this is not working for me.
    Can someone please tell me how i can solve this.
    Thanks,
    Ranjeet

    does this help also?
    How to add regular expression in viewobject bind variables
    ~Abhijit

  • How to add spaces at the end of record

    Hi Friends,
    i am creating a file which contains more than 100 records.
    In ABAP i have internal table with on field(135) type c.
    some time record have length 120, somtime 130 its vary on each record.
    but i would like to add space at the end of each record till 135 length.
    Can you please help me how to add speace at the end of record.
    regards
    Malik

    So why did you said that in your first posting? My glass sphere is out for cleaning...
    Instead of type c use strings and add spaces until they have the appropriate length.
    loop at outtab assigning <pout>.
      while strlen( <pout>-val ) < 135.
        concatenate <pout>-val `` into <pout>-val.
      endwhile.
    endloop.

  • How to add namespaces before a tag name in XML??

    Dear friends:
    I have following code, and hope to add namespaces before the tagname such as Company, Location and even any attributes in this xml,
    Can you help throw some lights??
    Thanks in advance.
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Attr;
    import org.w3c.dom.Document;
    import com.sun.org.apache.xml.internal.serialize.OutputFormat;
    import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
    import org.w3c.dom.Element;
    public class DocWriteDOMStart {
        public static void main(String[] av) throws IOException {
            DocWriteDOMStart dw = new DocWriteDOMStart();
            Document doc = dw.makeDoc();
            ((org.apache.crimson.tree.XmlDocument)doc).write(System.out);
        /** Generate the XML document */
        protected Document makeDoc() {
            try {
                DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
                DocumentBuilder parser = fact.newDocumentBuilder();
                Document doc = parser.newDocument();
                Element root = doc.createElement("Company");;
                doc.appendChild(root);
                Element loc = doc.createElement("Location");
                root.appendChild(loc);
                Element emp = doc.createElement("Employee");
                loc.appendChild(emp);
                emp.appendChild(doc.createTextNode("Daniel Bush"));
                Element emp2 = doc.createElement("Employee");
                loc.appendChild(emp2);
                emp2.appendChild(doc.createTextNode("Sandy Moore"));  
                Element dept = doc.createElement("Department");
                Element e = (Element)dept;
                e.setAttribute("Nationality", "USA");
                e.setAttributeNS("www.yahoo.com", "dept", "http://www.google.com");
                //e.setAttributeNodeNS(newAttr);
                loc.appendChild(e);
                e.appendChild(doc.createTextNode("IT Depart"));
                return doc;
            } catch (Exception ex) {
                System.err.println(ex.getClass());
                System.err.println(ex.getMessage());
                return null;
    }and I got
    <?xml version="1.0" encoding="UTF-8"?>
    <Company>
      <Location>
        <Employee>Daniel Bush</Employee>
        <Employee>Sandy Moore</Employee>
        <Department Nationality="USA" dept="http://www.google.com">IT Depart</Department>
      </Location>
    </Company>hope to add namespaces before the tagname such as Company, Location and even any attributes such as dept, nationality etc in this xml,
    I try but fail.

    You would have to write code that does that, then. Right now your code writes that part of your XML as elements that aren't in a namespace. I can tell you know there are different methods to write elements that are in a namespace because you used a different method to try to write an attribute that is in a namespace.

  • How to add image between two string

    how to add a image between two string .
    example :
    String one <IMG> String two

    grid1 = new GridLayout( 2, 3, 5, 5);
    container = getContentPane();
    container.setLayout(grid1);
    The parameters in GridLayout specifies 2 rows, 3 columns, 5pixels of horizontal gap, 5pixels of vertical gap.
    Did what i could to help, now can somebody help me with JDialog? =(

  • How much free space before updating iPad to 5?

    I have an original, 64gb iPad One.
    from what I am reading here, free disc space seems to be important before doing the upgrade.
    how much free space do those of who have updated suggest, BOTH on then iPad, and on
    my PC hard drive?
    Not looking forward to a bricked-install

    The more stuff you got, the longer the whole update will take...increasing the chances something might not go smoothly.
    So delete movies/videos first as they take up the most space. You can copy them back later. It's worth the small hassle imo.

  • How to add space between two tabs in accodion widget?

    Hi! I am using the accordion widgets and trying to add space between each of the tabs, would someone help me on this. Thanks

    Directly editing the output of Muse is virtually always a bad idea. At a minimum it will create a very cumbersome workflow since Muse will overwrite your changes every time you re-export (export, upload, publish, preview).
    It depends on exactly what visual effect you want to achieve, but you probably just need to select the accordion widget and use the Spacing panel to adjust the vertical gutter value.

  • How to add a field in the step Variables

    Hi guys, how to add a Field array to the Step Variables?

    Do you mean how to add properties to a Step Type?
    Steps are instances of Step Types so you can not add properties. If you need to add property to say a Numeric Test Limit step type, then you have to create a Custom Step Type based on a Numeric Test Limit Step Type then add your additional properties. Check out the TestStand documentation for Custom Steps Type.
    Depending on your needs you might beable to use the Add Attributes to meet your requirements, depends on what TestStand version you are using. This could save you the bother of having to create your own step type.
    Regards
    Ray Farmer

  • How to add spaces to the column value to make it up specifi length string please

    Hello There,
    Could you please guide me here to solve this issue,
    in my column (named as State) contains values as below
    California
    Washington
    Utah
    Connecticut
    Massachusets
    in the output how can i add a spaces to make up every column values as 15 length (for ex, Utah is 4 length then need to add 11 spaces, California is 10 would like to add 5 spaces)
    i tried below but no use in Sql 2008 R2
    SELECT  distinct state
       state
    +SPACE(35-len(state)),
    len(state+SPACE(35-len(state)))
    FROM dbo.ordersInfo
    Thank you in advance
    Milan

    Fixed length CHAR(n) data in SQL is automatically padded with spaces. Either change the column's data type or cast to it. Also, the ISO-11179 rules are that the column should be "state_name" and not just the root attribute "state" -- state_code, state_population,
    etc are a few of the confusions you created. 
    Another rule of RDBMS is that we do not do display formatting in the data. That is what presentation layers do. Why are you trying to fake COBOL in SQL? 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Fastest way to add spaces to a String?

    I need to have strings with a fixed width containing variable length text. The following (working) code does this with stupid if() and for() statements:
            StringBuffer levelName = new StringBuffer(record.getLevel().getName());
            if (levelName.length() < LEVEL_WIDTH) {
                int g = LEVEL_WIDTH - levelName.length();
                for (int i = 0; i < g; i++) {
                    levelName.append(' ');
            sb.append(levelName); As this code is called a lot of time, i'm looking for a more efficient way to expand strings to a fixed width (by adding spaces). is there a better performing solution?

    In this simple padding situation, there's no real advantage to using a StringBuffer over just a char array:
    //(1) do this once:
    char[] spaces = new char[LEVEL_WIDTH];
    char[] buffer = new char[LEVEL_WIDTH];
    java.util.Arrays.fill(spaces, ' ');
    //(2) Do this whenever you pad:
    int len = yourString.length();
    if (len < LEVEL_WIDTH) {
        System.arraycopy(yourString, 0, buffer, 0, len);
        System.arraycopy(spaces, 0, buffer, len, LEVEL_WIDTH-len);
        yourString = new String(buffer); //(*)
    }Notes:
    1. First off, it should be noted that trying to optimize before profiling could be a waste of time: what if the next operation is a database query that takes 100,000 times are long as this?
    2. arraycopy is a native op, so it should run faster than a loop. Arrays.fill calls arraycopy, btw.
    3. For efficiency, I reuse arrays buffer and spaces.
    4. The char array is copied in line (*). It would be nice to avoid that copying: to copy the original string and append padding directly into the strings buffer, but I don't see how that's possible. Using a StringBuffer involves at least as much copying, as far as I can tell (he says, staring at the source code)...

  • Add space in the string

    Hi
    I have a varchar column, the data in the column have no space in between. I want to keep space after every 20 characters while I select data from this column, how can I acheive this.
    thanks
    Royal Thomas

    If so, try this:
    DECLARE @longStrings TABLE (string VARCHAR(MAX))
    INSERT INTO @longStrings (string) VALUES
    ('123456789012345678901234567890123456789012345678901234567890'),('123456789012345678901234567890123456789012345678901234567890123456'),('12345678901234567890123456789012345678901234567890123456789012345678901234567890')
    ;WITH rString AS (
    SELECT 1 as seq, string, LEFT(string,20)+' ' AS part, RIGHT(string,LEN(string)-20) AS remaining
    FROM @longStrings
    UNION ALL
    SELECT r.seq + 1, r.string, r.part+LEFT(remaining,20)+' ', CASE WHEN LEN(remaining) >= 20 THEN RIGHT(remaining,LEN(remaining)-20) ELSE '' END
    FROM rString r
    INNER JOIN @longStrings ls
    ON r.string = ls.string
    WHERE remaining <> ''
    SELECT string, max(part)
    FROM rString
    GROUP BY string

  • How to add chars to a String

    Hi,
    I want to construct a string by adding characters to it.
    How can I do this ?

    Never mind, yes it will work (except that you have to
    initialize the string first, like s = "something";)
    before using +=. Sorry.actually, you don't. s += "foo" is really shorthand for s = s + "foo".
    since the reference s is equal to null, the value null is converted to the String "null".
    therefore, String s = null;
    s += "foo";has the same effect as
    String s = "null" + "foo";so, strictly speaking, you don't have to initialize s to a non-null value, but if you don't, you're not going to get anything you'd like...
    and, StringBuffer is definitely the way to go here; otherwise, each time you concatenate a character to your String, you're creating a new Character object and a new String object.
    Larry

  • How to add newline into a string

    I need to define a string which contains a newline,
    what i did is :
    String newline = new String();
    newline = "\n";
    but when i add new line to other string, and print it out,
    seems it is not working....
    Anrybody knows why?
    thanks~

    Please keep in mind that newlines differ between platforms. The "\n" is very well known, however in the Windows world a newline is actually "\r\n". Thankfully you may retrieve this value from the JVM.
    String newline = System.getProperty("line.seperator");Also System.out.println() will automatically append the correct newline at the end.
    Meaning that
    System.out.println("Hello");
    System.out.print("Hello" + newline);are esentially the same.

  • How to add elements into java string array?

    I open a file and want to put the contents in a string array. I tried as below.
    String[] names;
    s = new Scanner(new BufferedReader(new FileReader("outfile.txt")));
    while (s.hasNext()) {
                    String item = s.next();
                    item.trim();
                    email = item;
                    names = email;
                }But I know that this is a wrong way of adding elements into my string array names []. How do I do it? Thanks.

    Actually you cannot increase the size of a String array. But you can create a temp array with the lengt = lengthofarray+1 and use arraycopy method to copy all elements to new array, then you can assign the value of string at the end of the temp array
    I would use this one:
    String [] sArray = null;
    s = new Scanner(new BufferedReader(new FileReader("outfile.txt")));
    while (s.hasNext()) {
        String item = s.next();
        item.trim();
        email = item;
        sArray = addToStringArray(sArray, email);
    * Method for increasing the size of a String Array with the given string.
    * Given string will be added at the end of the String array.
    * @param sArray String array to be increased. If null, an array will be returned with one element: String s
    * @param s String to be added to the end of the array. If null, sArray will be returned.(No change)
    * @return sArray increased with String s
    public String[] addToStringArray (String[] sArray, String s){
         if (sArray == null){
              if (s!= null){
                   String[] temp = {s};
                   return temp;
              }else{
                   return null;
         }else{
              if (s!= null){
                   String[] temp = new String[sArray.length+1];
                   System.arraycopy(sArray,0,temp,0,sArray.length);
                   temp[temp.length-1] = s;
                   return temp;
              }else{
                   return sArray;
    }Edited by: mimdalli on May 4, 2009 8:22 AM
    Edited by: mimdalli on May 4, 2009 8:26 AM
    Edited by: mimdalli on May 4, 2009 8:27 AM

Maybe you are looking for

  • Advice on best arrangement for home network

    This is my first post so go easy on me....please?! I have moved into a new apartment and am trying to set my network is the best way, but am struggling slightly. I have a WRT150N and WRVS4400N (Don't ask why I have both) both of which are brand new,

  • Problem  in creating the procudre:

    hi all, i am having a problem. actually i want to create a procedure: below is the code which i am using: before creating this procedure, i create table with name: ProcessTable in database. after that i create this procedure: CREATE OR REPLACE PROCED

  • 10.9.2 Update Slowed Mac Mini

    Hello, Since updating I have been almost unable to use my Mac due to it running extremely slow. Startup and opening applications feels like I'm on a Windows 95. I would like to restore to the last OS but don't have anything backed up. Any Suggestions

  • Capturing packets from two server programs in single solaris box

    Hi, Greetings. I observe that snoop is not capturing packets exchanged between two server process which are running in a same solaris machine. Are there any options with snoop, so that it is possible to capture the packets between two server processe

  • Using ACV curve files in Lightroom

    Has anybody tried to convert an existing ACV curve file for use in Lightroom? I am using a custom acv curve file for B&W toned inks, and I would like to use it within Lightroom instead of going out to PS. Is there any way to convert/load the curve in