How to remove unwanted spaces in a string

Hi all,
    Iam taking a txt field txt50 which is containing many unwanted spaces between words in it. and i want to remove all unwanted spaces between words. Please tell me the solution it.

Hi,
     TRY THIS
DATA : TEXT(50)  VALUE 'My name is Roshan Lilaram Wadhwani',
       LEN TYPE I,
       POS TYPE I,
       COUNTER TYPE I,
       V_CH,
       V_SPACE VALUE ' ',
       V_TXT(30),
       V_TXT2(20).
COMPUTE LEN = STRLEN( TEXT ).
DO LEN TIMES.
V_CH = TEXT+POS(1).
IF V_CH EQ SPACE.
  COUNTER = COUNTER + 1.
ENDIF.
IF COUNTER LT 3.
  CONCATENATE V_TXT V_CH INTO V_TXT.
ELSE.
  CONCATENATE V_TXT2 V_CH INTO V_TXT2.
ENDIF.
POS = POS + 1.
ENDDO.
WRITE : / V_TXT.
WRITE : / V_TXT2.
<b>Reward points</b>
Regards

Similar Messages

  • How to remove white space between two answer reports

    How to remove white space between two answer reports
    In Dashboard section I have 2 rqeuest. Each request renders Table View. When I display dashboard, it show white space separating the 2 table views. How do I get rid of the white space/white band ?

    See this link
    Re: Eliminating the space between two reports in OBIEE dashboard page Section
    Regards,
    Sandeep

  • How to remove ghost space on Camera Roll under Usage. No photos on camera. 545MB shown on Camera Roll and 1.8MB on Photo Stream

    How to remove ghost space on Camera Roll under Usage. No photos on camera. 545MB shown on Camera Roll and 1.8MB on Photo Stream?
    Trying to clean up space to download updated iOS. Thanks!
    Have tried unsuccessfully the left swipe and pressing the red delete. No change.

    The only problem is I have only 1.6GB available and need 3.7 to update to the iOS7.  I also have 2.6GB in the "Other" catagory.  How do I access the "Others" area in iTunes in order to see what is there and what I might be able to delete in order to create the amount of space needed.  Thanks for your help!

  • How to remove extra spaces in a xml formatted string

    Hi,
    I am trying to remove extra spaces between the xml tags. For
    example, if a string is something like
    ' <header 1> <header 2> test </header 2> </header1>'
    I want to get rid of the spaces only between the closing tag of header 1 and opening tag of header 2 and closing tag of header 2 and opening tag of header 1, in short ,I want to remove the extra spaces between the tags if there are no other characters between them. I do not want the remove the spaces between closing tag header 2 and opening tag of header ,as there is occurence of other characters.
    I am aware that this can be done by looping through the string and using instr to identify the characters '<' and '>', but I would like to use it as a last resort only.
    Can anyone suggest me a better way of doing it in a single go by manipulating the data?
    Any help is really appreciated.
    Regards,
    Anil.

    You can use the replace function. If you only expect one extra space, then:
    scott@ORA92> select replace ('<header 1> <header 2> test </header 2> </header1>',
    2      '><', '><')
    3 from dual
    4 /
    REPLACE('<HEADER1><HEADER2>TEST</HEADER2></HEADER
    <header 1> <header 2> test </header 2> </header1>
    If you expect more extra spaces, then you will need to wrap another replace function around it for each space, for example the following will eliminate up to three spaces:
    scott@ORA92> select replace (replace (replace ('<header 1> <header 2> test </header 2> </header1>',
    2      '>     <', '><'), '>     <', '><'), '> <', '><')
    3 from dual
    4 /
    REPLACE(REPLACE(REPLACE('<HEADER1><HEADER2>TEST
    <header 1><header 2> test </header 2></header1>

  • How to remove footer space in Table

    I have created a table in main window. after creating main area section, the footer section is appearing as an empty at the bottom. I tried to remove this space by giving zero height to the footer height, but the value is not accepted by the system. How can I remove the space created by the footer?
    rajan

    Hi Rajan,
    Can you please tell me how did you solve this problem ?
    I am facing the same issue in smartforms.
    Regards,
    Nitin.

  • How to remove HTML tags from a String ?

    Hello,
    How can I remove all HTML Tags from a String ?
    Would you please to give me a simple example ?
    Best regards,
    Eric

    Here's some code I cooked up. I have created an object that processes code so that it can be incorporated directly into a project. There is some redundancy so that the it can be used in more than one way. Depending on your situation you might have to make the condition statement a little more sophisticated to catch stray ">" tags.
    I have also included a Tester application.
    //This removes Html tags from a String either by submitting the String during construction and then
    // calling getProcessedString() or
    // by simply calling " stringwithoutTags=removeHtmlTags(stringWithTagsSubmission); "
    //Note: This code assumes that all"<" tags are accompanied by a ">" tag in the proper order.
    public class HtmlTagRemover
         private String stringSubmission,processedString,stringBeingProcessed;
         private int indexOfTagStart,indexOfTagEnd;
         public HtmlTagRemover()
         public HtmlTagRemover(String s)
              removeHtmlTags(s);          
         public String removeHtmlTags(String s)
              stringSubmission=s;
              stringBeingProcessed=stringSubmission;
              removeNextTag();
              return processedString;
         private void removeNextTag()
              checkForNextTag();
              while((!(indexOfTagStart==-1||indexOfTagEnd==-1))&<indexOfTagEnd)
                   removeTag();
                   checkForNextTag();
              processedString=stringBeingProcessed;
         private void checkForNextTag()
              indexOfTagStart=stringBeingProcessed.indexOf("<");
              indexOfTagEnd=stringBeingProcessed.indexOf(">");
         private void removeTag()
              StringBuffer sb=new StringBuffer("");
              sb.append(stringBeingProcessed);
              sb.delete(indexOfTagStart,indexOfTagEnd+1);
              stringBeingProcessed=sb.toString();
         public String getProcessedString()
              return processedString;
         public String getLastStringSubmission()
              return stringSubmission;
    public class HtmlRemovalTester
         static void main(String[] args)
              String output;
              HtmlTagRemover h=new HtmlTagRemover();
              output="The processed String: "+h.removeHtmlTags("<Html tag>This is a test<another Html tag> string<yet another Html tag>.");
              output=output+"\n"+" The original string:"+h.getLastStringSubmission();
              System.out.print(output);

  • How to remove empty space from a file

    Hi all,
    Can any one help on how to remove the blank spaces from a file.
    I used trim function but unable to remove the spaces.
    I have a file in which there is a name like 'JAIRAM' and am storing this file in a variable FILE_CONTENTS.
    Now am unable to compare FILE_CONTENTS with another value as it is storing empty spaces also from the file.
    Please help on this
    Thanks,
    Srini

    Trim only trim at the beginning or at the end. Can you try using the replace sql function.. see below..
    SQL> select replace('abc def',' ','') from dual ;
    REPLAC
    abcdef
    cheers

  • How to remove unwanted plugins (and no I don't want to read any unrelated articles that never answer your question)?

    I want to clear out the unwanted plugins in Fire Fox . One plugin even has a warning about not using it (Java Deployment Toolkit). But every time I ask "how to remove a plugin?" , I am redirected to an article that doesn't answer the question. And then the circular argument begins again without ever actually answering the question.
    IS IT NECESSARY TO UNINSTALL FIREFOX TO REMOVE A PLUGIN??????

    Plugins like ex Flash and Java etc are not installed in Firefox like Extensions and Themes are. They are on system and Firefox has found and is making use of them. This is why you can only activate/deactivate which tells Firefox to make use of that Plugin on system or not.

  • How to remove empty space in CSS table and move spry menu bar?

    Hello! I created www.stonecreekha.com about a year ago basically by watching youtube tutorials and haven't done much with it since so I've forgotten everything! In IE7, everything appears as it should; but in Firefox and IE8, the spry menu bar is positioned slightly higher than it should be (it slightly cuts off the foot of the golfer) and there is an empty space between the navigation bar and the photo. The source code can be viewed from the website. Here are some pics:
    IE7 - how it is supposed to look:
    IE8:
    Firefox:
    Dreamweaver:
    So basically, I need to know how to remove that empty space between the navigation bar and the picture, and how to move the spry menu bar down a few pixels, in a way that it looks correct in IE8 and Firefox, and preferably IE7 as well.
    P.S. I'm a noob so if you could be as specific as possible on what to do in Dreamweaver I'd really appreciate it. Thanks

    I belive it's because of the -minus margin being used on the navbar, that you will need to use a negative margin to bring up both the left and right bodyArea divs.
    Try :       margin-top: -18px;  on both divs.  You may need to play around with that to get it more precise.
    Again, not sure what effect that has on IE as I can't test it.
    If it affects IE, then you may need to feed IE a conditional comment for the placement of those divs.

  • How to remove the space in the info object level?

    Hi,
    I created a Master Data info Object and gave the data type as <b>Char</b> and length as <b>30</b>.
    From the source system I am getting the data of length 9. But at PSA level I am getting some erroneous records.
    Example: Data from the source system  'a12345678'
                   Data in PSA 'a12345678b'     -
    ***  where b  - Blank
    With out changing the length how can I remove the spaces (Blank)?
    Can any one suggest me how to remove, where and what to apply ?
    I need to do any settings at the info object level or at the Transfer Rule?
    Please provide the each and every step to resolve my problem.
    Thank you

    Hey  you can allow space in RSKC tcode and execute it... .that's it .
    and below is the routine for invalid chars and you can have this in update rules ..
    data: w_fielda(x) type c.
    data: w_result(x) type c.
    data: w_temp_field(1) type c.
    data: w_count type i.
    w_fielda = COMM_STRUCTURE-/BIC/Zxxxxxx.
    w_count = 0.
    do x times.
    clear w_temp_field.
    w_temp_field = w_fielda+w_count(1).
    if w_temp_field CA
    '!"%&''()*+,-./:;<=>? _0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
    w_result+w_count(1) = w_temp_field.
    endif.
    w_count = w_count + 1.
    enddo.

  • How to remove blank spaces in the source code of my page?

    I created a page with the following code for testing:
    <dsp:page>
    <dsp:importbean bean="/atg/commerce/catalog/ProductLookup"/>
         <dsp:droplet name="ProductLookup">
              <dsp:param name="id" value="xprod2046" />
              <dsp:param name="elementName" value="product" />
              <dsp:oparam name="output">
                   <dsp:valueof param="product.DisplayName"/>
              </dsp:oparam>
         </dsp:droplet>
    </dsp:page>
    It only shows the product name in the browser. But if I look at the source code of my page he created 61 lines in response to this code, where a line is the product name and the other 60 have nothing.
    I know how to remove these lines that the ATG creates no content because my project is full of these empty lines.
    Anyone ever had this problem and could help me?
    Thanks

    Hi ,
    Yup this is a problem ,
    you can use following ways :
    1- use jsp comments eg :
    <dsp:page>
    <dsp:importbean bean="/atg/commerce/catalog/ProductLookup"/><%--
         ----%><dsp:droplet name="ProductLookup"><%--
              ----%><dsp:param name="id" value="xprod2046" /><%--
              ----%><dsp:param name="elementName" value="product" /><%--
              ----%><dsp:oparam name="output"><%--
                   ----%><dsp:valueof param="product.DisplayName"/><%--
              ----%></dsp:oparam><%--
         ----%></dsp:droplet><%--
    ----%></dsp:page>
    2- End tags at next line :
    e g :
    * <dsp:page
    * ><dsp:droplet name=”xyz”
    * ><dsp:oparam name=”output”
    * >Name: <dsp:valueof param=”abc”
    * /></dsp:oparam
    * ></dsp:droplet
    * ></dsp:page>
    3- Always use TAB instead of using SPACEBAR whie writing source code.
    4 - From JSP 2.1 onwards we have a page directive trimwhitespaces ( see if that works , i was not able to ), google for it for more info
    5 - You can modify your build scripts to remove white spaces from jsps while building EAR.(complex though, as you may not want to trim all white space.)
    6 - modifying the deployment descriptor.
    <init-param>
    <param-name>trimSpaces</param-name>
    <param-value>true</param-value>
    </init-param>

  • How to remove Name space and Software Component in XI??

    Hi Frnds,
    How to delete Software Component and Name spaces.
    Please share me any documents.
    Regards,
    Raj

    Hi Raja,
    Check the sap help
    http://help.sap.com/saphelp_nw04s/helpdata/en/e8/c5fe4e336c4fdd89eb5fe5abc02865/frameset.htm
    Re: How to Remove Components
    Thanks!

  • How to remove extra spaces from Data Matrix Label?

    Hi All,
    Kindly let me know how we can remove extra spaces from Data Matrix Label.
    Suppose we have this following code in SO10.
    ^FO1380,1879^COY,78^BY4^BXR,6,200^FH^FD[)>_1E06_1DF01001T_1D6JUN&v_huf&&v_hul&_1DV&v_supnum1&_1D16K&v_del&_1D6D&v_flddat1&095_1D2L&v_unload&_1D
    P&v_article&_1D4L&v_madein&_1D_1E_04^FS.
    Variable have there own value. and the desired result will be shown like the attachment.
    But in my code it splits into new line when CMIR value has 3 spaces.
    If CMIR value is 1S0 820 355 A . then it creats a new line.
    Kindly suggest me any possible solution.
    Thanks,
    Partha

    Hi Gaurav,
    In print preview we can't see any space or new line. But when it scanned by TSB (barcode scanner) it will generate a new line when there is 3 space CMIR value.
    So where should I write SHIFT CMIR LEFT DELETING LEADING space this code?
    Because there is no space coming at the time of debugging or print preview.
    And in SO10 the code written as
    ^FO1380,1879^BY4^BXR,6,200^FH^FD[)>
    Here CMIR value is 1SO 820 303 A
    and generated output is like this.
    And desired output should be like this.

  • How to remove unwanted rounding

    I created a custom KF (ZBILL_QTY) with the fix unit = Dozen. with 0.000 decimal places in the properties of KF
    And write a routine to get divide 0BILL_QTY (Base UOM = 'PC') by 12  and save into the ZBILL_QTY.
    The problem is the figure display in the report always round up which I don't want it
    i.e  0BILL_QTY = 1 PC I expected  ZBILL_QTY =  0.0833 DZ  but the it display 1 rather.
    I check the record in the cube and it display 0.0833 correctly and i also set the number of decimal places to 0.0000 in the query.
    Please advise how can i remove unwanted rounding ?

    hi ,
    Although that should work fine but if not can u try:
    1.Is scaling factor for that KF is on or not,i mean test different setting with scaling factor ,Mostly it should be "not defiened"
    2.A silly try ,create a formula and use this key figure in that and don't change any setting of decimals,and see uo to what place decimals it gives in report.
    Thanks
    Mukesh
    Edited by: Mukesh Sharma on Dec 12, 2008 5:41 AM

  • How to remove extract space between pages in smartform without changing output

    Hello Experts,
    I've been given a requirement where I need to remove extra space between pages of a smartform (refer to the attachment). If you look at the following screen shot then you will notice that that there is a command provided to display details on these pages which has a checkbox 'Go to New Page'.
    When I removed the above New Page comment then still I don't see the expected output (Refer to the attached screen shot 'Expected' to see what I need).
    Also there is another there is another New Page command (as shown below).
    When I tried to removed the above New Page Command then output was totally changed which user don't want (as shown below. Table should have been break on BCVI on red line, which happens today but with so much extra space).
    To view the correct output how user want please have a look at 'Expected' screen shot.
    Now the question is what change I should make in my smartform to accomplish the expected output.
    Many thanks in advance.

    Hello,
    I think that it should work, this construction of an loop node including all relevant items and at the event TAB event sort field only these items are copied in the OUTPUT_TAB which should be printed in a separate table on the form. After having printed the table, the content of the internal table is cleared.
    I suppose that you first should check if this TAB "event sort field" includes the correct criteria for the necessary group change. If this event is really defined correctly, then I only have one hint for you.
    I know that the only possibility to define a page break in a table in the Window MAIN is to use the following technique:
    Define an outside loop node and in this loop node a table node, but this table does not have a internal table to be looped through. It includes only the fields to be printed, maybe you have to re-design your table node.
    By the way only then you can define a command node including a page break during the processing of an internal table.
    Regards
    Juergen

Maybe you are looking for