Remove Carriage return from string

I have a free text area on a BSP (a form). When users type continuously in this area the text gets wraped. When the BSP is submitted it generates a sapscript form and the text area is printed on the form, but it has '##' which are placed where the text wrapped round. I would like to remove '##', so tried the following:
replace all occurrences of '##' in text_area with ' '.
This did not work as the '##' are not recognised presumably because they are some type of carriage return and not in fact has marks.

If you dont have access to the class CL_ABAP_CHAR_UTILITIES, do this instead:
DATA: crlf(2)   TYPE x VALUE '0D0A',
      itab      TYPE TABLE OF string,
      w_input   TYPE string.
   w_input = '<contains the text with the line feed.>'.
   SPLIT w_input AT crlf INTO TABLE itab.
Regards Michael.

Similar Messages

  • Remove Carriage Return from a TextEdit field

    Hi All,
    I have a tableview, of which the last field Description, is of type TextEdit. Not only this, when the data was migrated from a legacy system to SAP, either the last field with the value (If Description has value, Description field, else the field before Description) has 2 '##' at the end of it.
    The 2nd # is EQ to
    cl_abap_char_utilities=>newline
    , which I can remove using
    REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>newline IN <fs> WITH ''.
    But the first # is having the Hex Value 0D00, which is EQ to Carriage Return. CR_LF is Carraige Return and Line Feed, but here, I need to remove only CR.
    Can anyone give me the right solution?
    I tried moving this data to a string field and then do a REPLACE All... IN BYTE MODE, but again, it didn't work.
    Thanks and Regards
    Gladson Jacob

    Hi Patrick,
    The program's ending with a Short Dump. The code snippet is as below.
    DATA: it_contract TYPE TABLE OF zbpa_bp_contract,
          xstring_val TYPE x VALUE '0D00',
          value2 TYPE x VALUE '2000',
          string_value TYPE string,
          xstring_value TYPE xstring,
          stringtable TYPE TABLE OF string,
          reply_value TYPE TABLE OF tline.
    FIELD-SYMBOLS <fs> TYPE zbpa_bp_contract.
    SELECT * FROM zbpa_bp_contract
      INTO TABLE it_contract.
    *  WHERE id BETWEEN 2316 AND 2328.
    LOOP AT it_contract ASSIGNING <fs>.
      string_value = <fs>.
      APPEND string_value TO stringtable.
      CALL FUNCTION 'CONVERT_STREAM_TO_ITF_TEXT'
        TABLES
          text_stream = stringtable
          itf_text    = reply_value.
    ENDLOOP.
    The dump description is as follows
    Error analysis
        At the statment "DESCRIBE" only character-type data objects are supported at the argument position "TEXT_STREAM", but no strings are supported (data types STRING and XSTRING).
        In this particular case, the operand "TEXT_STREAM" has the type "g".
    <b>Please help.</b>
    Thanks in advance.
    Gladson
    Message was edited by:
            Gladson Jacob
    Message was edited by:
            Gladson Jacob

  • Remove carriage returns from a field in an oracle table

    I have a field that is defined as a LONG in my oracle table; the data contained in this field has carriage returns/line feeds (it's free form text); as i'm selecting data from this field, i need the carriage returns removed so that the data from this field all appears on one line.
    I tried using the TRANSLATE function to convert the carriage returns to something else, but that doesn't work.
    Example:
    Select comment from Notes:
    COMMENT
    the applicant called for an appointment;
    an exam was scheduled for 4/1/05 at 9am;
    called applicant to confirm app
    this needs to be extracted as: "the applicant called for an appointment; an exam was scheduled for 4/1/05 at 9am; called applicant to confirm app"
    How can i do this? Can the decode function be used to remove the carriage returns in this field?

    when i used translate its giving correctly,
    SQL> ed
    Wrote file afiedt.buf
    1 select translate('the applicant called for an appointment;
    2 an exam was scheduled for 4/1/05 at 9am;
    3 called applicant to confirm app
    4 this needs to be extracted as: "the applicant called for an appointment; an exam was scheduled
    5 How can i do this? Can the decode function be used to remove the carriage returns in this field
    6* ',' ') from dual
    SQL> /
    TRANSLATE('THEAPPLICANTCALLEDFORANAPPOINTMENT;ANEXAMWASSCHEDULEDFOR4/1/05AT9AM;CALLEDAPPLICANTTOCONF
    the applicant called for an appointment; an exam was scheduled for 4/1/05 at 9am; called applicant t
    SQL> ed
    Wrote file afiedt.buf
    1 select 'the applicant called for an appointment;
    2 an exam was scheduled for 4/1/05 at 9am;
    3 called applicant to confirm app
    4 this needs to be extracted as: "the applicant called for an appointment; an exam was scheduled
    5* How can i do this? Can the decode function be used to remove the carriage returns in this field
    SQL> /
    'THEAPPLICANTCALLEDFORANAPPOINTMENT;ANEXAMWASSCHEDULEDFOR4/1/05AT9AM;CALLEDAPPLICANTTOCONFIRMAPPTHIS
    the applicant called for an appointment;
    an exam was scheduled for 4/1/05 at 9am;
    called applicant to confirm app
    this needs to be extracted as: "the applicant called for an appointment; an exam was scheduled for 4
    How can i do this? Can the decode function be used to remove the carriage returns in this field?
    SQL>

  • Removing Carriage Returns within a Textarea

    Hi,
    Just wondering if someone could please let me know how to remove carriage returns from a Textarea after submitting the page?
    Within my PL/SQL process, I have used both REPLACE and TRANSLATE on both CHR(10) and CHR(13) but unfortunately it stills comes out the other end as follows:
    Description :this
    is
    a
    testWould like it all on one line minus the carriage returns.
    Thanks.
    Tony.

    The code I showed works for me. Computations and processes work similarly except that in a process you have to save the value in session state whereas in a computation that's done for you. Show your code or put an example on apex.oracle.com if you can't get it to work and I'll check it.
    Scott

  • Need to remove carriage returns, spaces, etc.

    Hello,
    I am trying to build a string that is on one line,
    1,2,3,4,5,6,7,8,9
    however, I wind up with each number on a separate line.
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9
    My code looks like this:
    var xxx = "";
    for (var i=1; i<= nNumWords; i++) {
          global.srchVals[i].name = "Payor Mix";
       global.srchVals[i].mode = 0;
       xxx = i;
       if (i < nNumWords) {
       xxx = xxx + ",";
      //xxx = xxx.replace(/\s+/g,"").trim();
      } else {
       xxx = xxx;
       //xxx = xxx.replace(/\s+/g,"").trim();
          var PMItms = [xxx];
       //console.println(xxx);
    I tried using the following line of code to remove carriage returns and spaces:
       xxx = xxx.replace(/\s+/g,"").trim();
    But it keeps on giving me the following error:
    TypeError: xxx.replace(/\s+/g, "").trim is not a function
    Any help is appreciated.
    Thanks
    Linda

    I just want to make sure I'm approaching this problem the correct way.
    I am trying to build a string that is on one line,
    1,2,3,4,5,6,7,8,9
    however, in the debugging console, I wind up with each number on a separate line.
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9
    Will "Trimming" the string correct the issue?
    Thanks
    Linda

  • Remove carriage return between text two objects

    How to remove carriage return between objects. 
    I have a text box and table  I want to remove carriage return between them. 
    Also I have a table with two columns and I want to remove carriage return between these two columns.
    Thank You in advance.

    Hi ,
    Try like this ,
    --To replace Carriage return
    =REPLACE(Fields!Column.Value, CHAR(10), "" )
    --To replace Line feed
    =REPLACE(Fields!Column.Value, CHAR(13), "" )
    --To replace Tab
    =REPLACE(Fields!Column.Value, CHAR(9), "" )
    And also , ConsumeContainerWhitespace property to remove blank space -
    http://beyondrelational.com/modules/2/blogs/115/posts/11153/consumecontainerwhitespace-property-to-remove-blank-space-in-ssrs-2008-report.aspx
    sathya - www.allaboutmssql.com ** Mark as answered if my post solved your problem and Vote as helpful if my post was useful **.

  • How to remove new line from string

    I have a string say following
    String line = "one\ntwo\nthree";Now i am trying to remove new line from string. For this i did following
    String txt = line.replaceAll("\\n","");But i see still new line is occuring. Is it correct way. Please advice me.

    Ok. I was just using \n instead of \r\n. And i am in windows. I will give a try with \r\n
    Ok i tried using following , but it doesnt work.
    line = line.replaceAll("\\r\n","");Am i missing anything here. Please guide me.
    Edited by: ArpanaK on Oct 8, 2007 4:44 PM

  • HTML Textarea removing Carriage Returns

    Hi,
    Hoping someone can assist, I am retrieving some data from a table that currently consists of carriage returns but when I try and retrieve this information via Ajax and pass it back into the HTML page textarea field within ApEx, the value returned is one continuous string.
    All my carriage returns are removed.
    Can someone please assist, possibly using a javascript solution or some other type as to how I can preserve the carriage returns.
    Thanks.
    Tony.

    Hi Tony,
    I suspect the problem is simply due to the way HTML handles line breaks, which is to say, it generally ignores them. For example, this html:
    <p>To be or not to be, that is the question;
    Whether 'tis nobler in the mind to suffer
    The slings and arrows of outrageous fortune,
    Or to take arms against a sea of troubles,
    And by opposing, end them. To die, to sleep;
    No more; </p>would be displayed in a browser as:
    To be or not to be, that is the question; Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take arms against a sea of troubles, And by opposing, end them. To die, to sleep; No more;
    One way to get around this is to wrap the string in {font:Courier}&lt;pre&gt;&lt;/pre&gt;{font} tags; another would be to replace the carriage returns with {font:Courier}&lt;br&gt;{font}
    Hope this helps.
    tx, --Jen                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Reports not retaining carriage returns from htmldb_item.textarea

    I’m created a tabular form for multi row updates using htmldb_item.textarea for one of the fields. When I update the tabular form it keeps any carriage returns in this field, which is good. I then created a “PL/SQL function body returning a SQL Query” report for printing purposes. The problem is that the field populated by the htmldb_item.textarea does not retain any of the carriage returns in the report.
    I enter the following in the textarea on the tabular form:
    Line 1
    Line 2
    Line 3
    The report I created then displays the data as:
    Line 1 Line 2 Line 3
    I need the report to display the data the same as it appears on the tabular form.
    I tried this in my report from reading other similar situations on this forums, but didn’t work.
    replace("TEXTAREA",''||chr(13)||'',''||
    ||'') as title
    Anyone know of a solution?

    How about this?
    Go the page where you can edit the report column attribute - here is the bread crumb to help you figure out what I am talking about
    Home>Application Builder>Application 99999>Page Definition>Report Attributes>Column Attributes
    The second box in this page is Column formatting, you will find 4 text boxes (Number / Date Format, CSS Class, CSS Style, Highlight words) and a text area (HTML Expression). In the text area replace #COLUMN_ALIAS# with <PRE>#COLUMN_ALIAS</PRE>. You will get your newlines without tweaking the query or removing Strip HTML. Strip HTML is a security feature that I would not disable. On the down side you will loose some of the ability to format like fonts etc (:-(,
    Here is why you loose the newlines in the report. When browsers render html they have the liberty to reformat it. When reformating they can play around with whitespaces including new lines. To force a new line you have to use the BR tag or you can say the text is preformated using the PRE tags.

  • How do we remove Carriage Return (line feed) inserted in FCC files

    Hi Experts,
    The file that we generate has a carriage return at the end.
    Is there any way in which we can remove this carriage return (line feed) from the file?
    The FCC parameters used at our end are as below:
    structure.filedNames:
    structure.fieldFixedLengths:
    structure.fixedLengthTooShortHandling: Cut
    Kindly tell us a solution ASAP.
    Thanks & Regards
    Dhwani

    Dear All,
    Let me elaborate on my query
    Consider that the files output looks like below:
    12  34  45  545 5454 UL
    23  33  43  434 4545 FG
    45  44  44  586 6535 GM
    Now there is an extra line(Carriage Return) getting inserted after the last line 45  44  44  586 6535 GM  which is not required at our end.
    The cursor of the file instead of stopping on the last character M, points to the next line.
    Can you please suggest how to remove this extra line from the files.
    I dont understan how will remove context help in this case.
    Regards
    Dhwani

  • XI: Remove Carriage Return +Line Feed at end of XML

    Hi All,
    Scenario
    Currently, we have a JMS --> XI --> IDOC scenario. The Sender Service always sends a CRLF (Carriage Return & Line Feed+) without fail at the end of each xml file once this non-sap system finishes its transaction.
    Example
    <STARTOFXML>
    Data------
    </ENDOFXML>CR+LF
    Question
    Is it possible to remove this from XI JMS Sender Adapter? From the receiver Service (JMS) this is possible.
    Cheers!
    Sulaiman

    Why do you want to remove this? Does this lead to errors?
    Regards
    Stefan

  • Remove Carriage Return between elements

    Hi All,
    Below is my xml document:
    <Message>
    <AccNo>100</AccNo>
    </Message>
    I want to convert the above document as:
    <Message><AccNo>100</AccNo></Message>
    I mean, without carriage return in between elements. The above two documents are generaring a different message signature. Please help me; as how can remove carrige returns in between elements.

    You're talking about line breaks between elements; are there any line breaks inside elements? If there are, you probably want to preserve them, but for now I'll assume all line breaks must go.
    What form is the XML document in? If it's a string, you can do a simple replaceAll(): str = str.replaceAll("[\r\n]+", ""); If it's in a file, you can read it in line-by-line with a BufferedReader and write it to a new file without inserting line breaks.

  • Removing Carriage Returns

    I have a table with a field that contains data such as this,
    and I want to remove all of the carriage returns but I am having
    difficultiy. I have tried replacing the chr(13) and the chr(10) but
    no such luck. Can anyone help? Thanks!
    ==== start of code block ====
    Part Number: 1307 G9<BR>
    Finish Family:
    CHROMES<BR>
    Finish/Color:
    STERLING NICKEL<BR>
    Dimensions:
    1 1/4 INCH DIAMETER<BR>
    Collection:
    BRASS &amp; STERLING TRADITIONS<BR>
    ==== end of code block====

    Hi,
    For me both database as well as coldfusion worked fine. You
    may also please try with small example.
    Method 1:
    At database side
    select
    replace(columnname,chr(13)||chr(10),' ') as columnname
    from <tablename>
    Method 2: Coldfusion
    <cfset pageContent = reReplace(pageContent,
    chr(10)&chr(13),"", "all" )>
    I noticed that the regular expression functions in CF support
    the newline character \n Chr(10), carriage return \r Chr(13), and
    tab \t Chr(9).
    <cfsavecontent variable="data">
    here is my
    break
    </cfsavecontent>
    <cfoutput>#ReReplace(data, "\n", "<br />",
    "ALL")#</cfoutput>
    Method 3: Coldfusion.
    Please go through the below article. Example is mentioned
    http://livedocs.macromedia.com/coldfusion/6/CFML_Reference/functions-pt248.htm
    Hope this helps. Please try it out.
    Satheesh.

  • Contribute strips carriage return from javascript

    Hi
    Has anyone had a problem where carriage returns are stripped from javascript by Contribute?
    If the code is
    <script>
    <!--
    script here
    //-->
    </script>
    It ends up as
    <script><!--script here//--></script>
    and it doesn't run because it is all commented out.
    Does anyone have a solution apart from removing the comment code?
    Administration of the site Editing setting is set to "Allow unrestricted editing" with "Protect scripts and forms" checked.

    Thanks. I finally got it to work.
    Doing the replace on the original page still got stripped. It didn't like chr(10) or chr(13). It did find /n though.
    I had to trigger a function to globally replace all the /n's with dummy text. Then, on the popup page, I had to create a function to globally replace the dummy text with /n's; and trigger in Footer section.
    What a pain, just to end up with you already had in the 1st place. lol

  • How to remove carriage returns in message mapping

    Hi Experts,
    I am getting carriage returns in one of the source field, i need to remove those carriage returns and i need to pass it to target field, can anyone suggest me how can i achieve this.

    Hello,
    Are you getting only CR or CR+LF (line feed) ?
    In this case - CRLF - you can use content conversion in your sender adapter:
    <recordset_structure>.fieldSeparator = 'nl'
    So in your receiver adapter you can replace any special char by 'nl' again.
    Check these links.
    http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
    http://help.sap.com/saphelp_nwpi711/helpdata/en/44/686e687f2a6d12e10000000a1553f6/content.htm
    Regards,
    Diego Estanguini Gabriel

Maybe you are looking for

  • Calculating App sizes on Startup

    Each time I startup my Mac, I hear the hard drive spinning and the computer's less responsive than usual. I finally found that it's going through all the apps in the Applications folder and calculating their size, plus possibly indexing my drive. I'm

  • Will Mac Min Work with 26" Samsung HDTV?

    Hey all, Thinking of getting a Mac Mini, just wondering if i simply plugged it in via HDMI or VGA to my 26" Samsung HDTV, will it work? And what would the res. be? Thx

  • Console wl properties conversion

    sorry for the cross-posting, didn't see the console list. All, I'm attempting to use the web console application/Convert weblogic.properties link to perform a propterties file conversion. I'm getting a conversion error when converting our current web

  • Get rid of the play/pause it the play back

    Does anyone know how I can get rid of the play/pause symbols of my slide show when I play it on a DVD player? Thanks Tim

  • Setting z-index upon a panel?

    Hi, I am making a custom color picker component. Simply, when the user clicks a color box, color palettet should pops up over all other components. This is my color palette panel:         <s:Panel width="111" height="215" id="colorPalette"