Replacing New Line character in a hexadecimal string in ECC5.0

Hi,
I am trying to create an XML document using ABAP.
I have created one DOM and later used the DOM to get the XML content into an internal table in form of Hexadecimal String. In that internal table(which contains XML in form of hexadecimal content), I want to search for the new line character and replace it by Space.
I have used class CL_XML_DOCUMENT to create such document.
Now, the keyword 'SEARCH' which searches the New Line character, works on the hexadecimal content of the internal table in 46C and I get an XML document. I get the position of the New Line in SY-FDPOS and can do whatever I want. But SEARCH on hexadecimal content is not permitted in ECC 5.0. I get a syntax error when I try to do so. Tried many options but could not succed.
Would apreciate if anyone can help in finding and replacing characters like new line, tab etc in a hexadecimal string.
Thanks.
Can anyone

Hi!
When you say hexadecimal string, you mean variable - otherwise string (= character) operations would work?
Then you have to go for hex handling -> do it yourself. Make something like
data: lf type x value '0A',
      sp type x value '20',
      i type i.
I = 0.
while sy-subrc = 0.
  if hex_string+i(1) = lf.
    hex_string+i(1) = sp.
  endif.
  add 1 to i.
endwhile.
Regards,
Christian

Similar Messages

  • FileUtilsService Write String New Line Character

    Hi All,
    SITUATION:
    Writing a custom log file using the Write String service operation.
    Everytime an event occurs, i want to insert a new line, with date time stamp, details etc.
    PROBLEM:
    In the "value" property of the "write string" service operation... im inputting my relevant data but dont know how to indicate a new line
    WHAT I TRIED:
    I've tried every form of new line character i know: \n, \r, <BR>, \u0000a, \u0000d, ACSII, CRLF, etc, etc... none of them works.
    WHAT I FEAR:
    the exact same situation as http://forums.adobe.com/message/2780658#2780658 ... with a fairly definite answer
    I'm hoping i dont have to go this LONG ugly scary route.
    WAY FORWARD:
    Your thoughts, answers, suggestions....
    Thanking you all in advance.

    if going the "executeScript" way....
    this code worked for me:
    ===========================
    import java.lang.String;
    String vLogEntry = patExecContext.getProcessDataStringValue("/process_data/@logEntry");
    String vLogEntry = vLogEntry + " \r\n";
    patExecContext.setProcessDataStringValue("/process_data/@logEntry", vLogEntry);
    =================

  • What  new line character in string is needed to show new line

    If i need to show java string in a html text area with new lines(that is 2 -3 lines of text ) what new line character i need to add.
    I tried \n and /n but these are not working fine. Can anyone help me.

    If i need to show java string in a html text area
    with new lines(that is 2 -3 lines of text ) what new
    line character i need to add.
    I tried \n and /n but these are not working fine. Can
    anyone help me.HTML ignores line breaks. You will need to use markup (<br>) to force a new line.

  • New line character in File adapter

    I am having a receiver file adapter which generates files with multiple lines.
    My problem is when the target file is opened in notepad there is no line break and the lines comes as continous string with small rectangle as separator.This fails the target upload program.
    When I remove those small squares in notepad and hit enter and then upload it gets uploaded successfully.
    Is there any way to have line break so that new line will be generated each time (the documenation says the by-default it adds new line character then why in notepad it opens like a continous string?)
    Thanks in advance.
    Regards
    Rajeev

    Hello
    I know by default File Adapter value is line break. But if I open that generated file in notepad, the record does'nt appear on the new line. Instead at the end of each line there is special character added at the end of each record. When I hit enter and deletes that special character and then try to load that file it gets loaded successfully.
    So my problem is how to generate the file will give record on the new line. I tried to give 'nl' as endSeparator.
    How to give hexadecimal values? I tried giving '0xHH' but that gives error in File Adapter
    "Error: Conversion initialization failed: Exception: java.lang.NumberFormatException: For input string: "HH"
    Thanks in advance.
    Regards
    Rajeev

  • Removing New Line Character in Input file

    Hi Experts,
    I Have a question about "New Line Character". I searched in SDN before posting this thread, But I didn't get answer.
    Question:
    Let me say my Client requirement first. After loading the data(Millions of Records) into SAP through LSMW, they asked write a program for validation of those loaded records based on I/P file. I wrote a program and It is success full.
    But, the problem is when file is in Application server in 'BIN' format, a new line character(#) is created. While comparing the last record of each line, it doesn't match. How to remove this new line character(#) in I/P file for each line of record? Please see the below records for example
    PROVINCIA DE BUENOS AIRE|   |1870|AR| #
    PROVINCIA DE BUENOS AIRE|   |1876|AR| #
    BOX 7407 PRINCETON|   |085437407|US|NJ#
    5756 2 A   CAPITAL FEDERAL|   |1431|AR|00#
    Note: This New line character is not matching the string "#".
    Please help me guys, so many objects are related with this concept. I appreciate quick response. Please.
    Thanks
    Sai

    Hi Arun, Ravi,
    I wrote the code like this, here 'fil_curre' is currency key.
    IF <l_wa_file_data>-fil_curre CS cl_abap_char_utilities=>newline.
              REPLACE ALL OCCURRENCES OF REGEX cl_abap_char_utilities=>newline
                                            IN <l_wa_file_data>-fil_curre WITH ''.
            ENDIF.
    While executing the code, the cursor here, simply jumps to next step.
    Any enhancements to this code or any new ideas?
    Thanks
    Sai

  • Want to know how to check for new line character in text file

    Hi All,
    I`m trying to read data from text file. However I`m not sure whether the data is in 1st line or nth line. Now I`m trying to read the text from the readline. But if text is "" and not NULL then my code fails. So I want to know how to check for new line character and go to next line to find the data. Please help.
    Thanks
    static int readandwriteFile(Logger logger,String filepath){
              BufferedWriter out = null;
              BufferedReader in = null;
              File fr = null;
              int get_count = 0;
              try     {
              if(new File(filepath).exists())
              fr= new File(filepath);
                        System.out.println("FileName: "+fr);
                   if(fr != null){
    in = new BufferedReader(new FileReader(fr));
                             String text = in.readLine();
                             if(text != null){
                             get_count = Integer.parseInt(text);
                             in.close();
                             else{
                                  get_count = 0;
         else{                    
    out = new BufferedWriter(new FileWriter(filepath));
         out.write("0");
                out.close();
                   }          //Reading of the row count file ended.
              catch(Exception e) {
                   e.printStackTrace();
              finally {
                   try{               if (in != null) {
                             in.close();
              if (out != null) {
                             out.close();
              catch(Exception e) {
                        e.printStackTrace();
              return get_count;
         }

    You are calling the readline() only once which means you are reading only the first line from the file...
    Use a loop (Do-While preferably)
    do{
    //your code
    }while(text == "")

  • Problem with CDATA and new line character

    I parse a xml document with org.w3c.dom, the document contain a CDATA section in which there are more lines of text, each line is terminated with the new line character (\n).
    Example:
    <nota>
    <[CDATA[
    first line
    second line
    third line
    ]]>
    </nota>
    When a parse this node:
    Text txt_nota=(Text)elm_nota.getFirstChild();
    String nota=txt_nota.getData();
    the value returned is one string with no new line characters, example:
    "first linesecond linethird line"
    what's wrong?

    Because i use the string nota into a jsp page and i print the string nota into a textarea and the text is with no newline, example:
    <textarea name="nota" rows="4" cols="60"><%= nota %></textarea>
    the text into textarea is:
    first linesecond linethird line
    but i want that the text displayed into textarea is equal the text into the CDATA section:
    first line
    second line
    third line

  • How to insert new line character?

    Hi all,
    I have two lines to print.
    out.println("Available number of columns="+cols);
    out.println("Number of columns must be present=10");My problem is:
    i want both the lines to be printed one below the other. But, it is displayed in one single line.....
    Can anyone please tell me how to insert new line character?
    I tried with \n, '\n' and \r\n but, in vain......
    Thanks for your time.
    Regards,
    Ashvini

    You should never use "\n" directly.
    The line separator character is different on different operating systems.
    And putting quotes around it in your string will make absolutely no difference in the JSP.
    To find out what the line separator is you should use System.getProperty("line.separator");
    The JSPWriter and PrintWriter classes will automatically use this property with a println statement, so a println will always finish with a line separator.
    The issue here was that HTML by default ignores all whitespace.
    The solutions provided
    - use a <br> tag instead of a carriage return
    - use <pre> tags, which tells the browser not to ignore whitespace. That can be troublesome in JSP which generates a lot of extraneous carriage returns into the code.
    Cheers,
    evnafets

  • New line character in soap body text

    Hi,
    Is there aby way to add new line character fir string message in soap body for text message output.
    like
    <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">string,3\nstring,3\n</soapenv:Body> whic is not working
    thanks

    Try this:
    concat('line1', "&#x0d;&#x0a;", 'line2')
    Ryan

  • New line character  is not working in BPEL 11g

    I am trying to use new line character &#13; in string concat operation in BPEL 11g, but it is not giving new line in output. Any idea why?

    We can achive this by embedding html tag break '&lt br &gt', something like below.
    string('Please click on the URL below to login and open your invoice Worklist.&lt br &gt
    &lt br &gt
    &lta href="http://localhost:8001/integration/worklistapp"> Invoice Worklist &lt/a&lt &lt br &lt
    &lt br &gt
    Edited by: RaviOrnext on Aug 16, 2012 4:24 AM

  • Force Windows New Line Character

    Hi,
    I've a problem with new line character. I am in Windows platform but
    when I write a file with a BufferedWitter with println I obtain the
    character "\n" x0D like separator (Unix Separator). My System property
    line.separator is "\r\n".
    Can someone tell me how can I obtain files with the correct \r\n
    Windows new line character?.
    Thanks in advance.

    Resolved
    The problem was another process that automatically was replacing "\r\n" form "\n" and I don�t know it.
    All works fine.
    Thanks a lot.

  • New Line Character in OSB for sending email in proper format

    Hi
    We have a client requirement, where in we send an error email when ever an exception occurs in the OSB flow. We are using OSB 11g and we need to format the body within or before the publish activity using a replace activity something in the below manner (replace . in variable body (replace node contents))
    fn:concat("Following Exception Occurred <NEW LINE>","ErrorCode: ",fn:data($fault/ctx.errorCode) etc etc)
    Please tell us if there is a new line character available within OSB to format the email message. Please help its urgent. Thanks

    Thanks a lot for the reply, but still in the email body, i see everything in one line (no enter0). I tried " ","",\n and CHR(13). All dont seem to work.
    Also can you provide an example for &#13: (Ampersandhash13colon)
    Please help.
    Regards
    Amit Sachdev
    Edited by: user638094 on Mar 8, 2011 12:01 AM

  • Problem is occurring in docx format; it is not printing "New Line" character in extracted txt using IFilter (offfiltx.dll) while with doc file IFilter (OffFilt.dll) is working fine.

    Problem: Problem
    is occurring in docx format; it is not printing “New Line” character in extracted txt using IFilter (offfiltx.dll) while with doc file IFilter (OffFilt.dll) is working fine.
    Environment: -
    Operating
    System:
    Windows XP SP2/7
    Language:
    C#
    MS
    Office Version: - MS Office 2007/2010/2013
    Problem
    Description: -
    We
    havedocx
    file with new line character, and we are processing this file in IFilter for extracting text, and it is giving output with concatenation of lines.
    Docx
    file format (Sample.docx)
    Test this music
    Word processing
    Testing docx file
    Output:
    - Test this music Word processing Testing docx file
    Requirement:
    - We
    have requirement to get following text in particular format with New Line from docx because client is using docx format only.
    Test this music
    Word processing
    Testing docx file
    Attempt:
    We have tried a lot after changing IFilter configuration,
    but it is not giving required output. Then we saved same file in doc format (Sample.doc), which is giving required output.
    Because it is application specific problem, kindly
    assist to resolve issue on priority. We are sharing IFilter paths for extracting text for doc and docx.
    Doc Filter Location: - %systemroot%\system32\OffFilt.dll
    Docx Filter Location: - <Drive>:\PROGRA~1\COMMON~1\MICROS~1\Filters\offfiltx.dll
    Code Snippet for setting property of filter
    internal static IFilter LoadAndInitIFilter(string fileName, string extension)
                IFilter filter
    = LoadIFilter(extension);
                if (filter
    == null)
                    return null;
                IPersistFile persistFile
    = (filter as IPersistFile);
                if (persistFile
    != null)
    persistFile.Load(fileName, 0);
                    IFILTER_FLAGS flags;
                    IFILTER_INIT iflags
    =
                                IFILTER_INIT.CANON_HYPHENS
    |
                                IFILTER_INIT.CANON_PARAGRAPHS
    |
                                IFILTER_INIT.CANON_SPACES
    |
                                IFILTER_INIT.APPLY_INDEX_ATTRIBUTES
    |
                                IFILTER_INIT.HARD_LINE_BREAKS
    |
                                IFILTER_INIT.FILTER_OWNED_VALUE_OK;
                    if (filter.Init(iflags,
    0, IntPtr.Zero, out flags)
    ==IFilterReturnCode.S_OK)
                        return filter;
                Marshal.ReleaseComObject(filter);
                return null;
    Kindly
    assist to resolve this issue and also let us know if any input is required.
    For any help, we would be really
    thankful.

    Kindly
    assist to resolve this issue and also let us know if any input is required.
    For any help, we
    would be really thankful.

  • How to remove new line character from query output?

    Hi,
    How to remove new line character from query output?
    have tried select replace(column_name, CHR(10), ' ') from table_name.
    Edited by: GreenHorn on Sep 11, 2008 12:53 AM

    Please consider, that windows uses a sequence of chr13||chr(10) Unix uses only one character chr(10).
    The new line character(s) may be OS-dependent.
    You could consider both with:
    replace(replace(column_name, CHR(13)||CHR(10), ' '),CHR(10),' ')
    Hartmut
    Edited by: hartmutm on 11.09.2008 01:32

  • Regexp_substr to exclude new line character

    I have a varchar2 field that stores new line character at the end of the char string . How do I extract just the char string and not the new line character using regexp_substr ?
    Thanks
    Billu

    Hi,
    Assuming the newline character is CHR (10),
    RTRIM (string, CHR (10))returns a copy of string with the newline (if any) removed from the end. This is more efficeint that regular expressions.
    If you really want to use regular expressions anyway, REGEXP_REPLACE is sometimes easier to use than REGEXP_SUBSTR.
    REGEXP_REPLACE ( string
                , CHR (10) || '*$'
                )does the same thing as the RTRIM expression above. Omit the * if you want to remove only 1 newline from the end.
    Edited by: Frank Kulash on Feb 9, 2010 4:37 PM

Maybe you are looking for

  • Error while deployoing the bPEL Process

    Hi , I'm getting the below error when i'm trying to deploy a BPEL Process. It got deployed and in the OPMN log i see the below error: May 20, 2008 12:34:21 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry INFO: Recoverable excepti

  • ITunes 10.1.2 upgrade on  Win XP Pro SP3 Kills Internet access

    The latest iTunes 10.1.2 install on my Win XP Pro SP3 system kills my Internet access. Internet status shows that I'm connected but Internet Explorer and Firefox can't connect to the server. Running Win XP Pro SP3 with all MS updates applied on a Dua

  • Problems printing to HP Color LaserJet 2550L

    Hello - ever since updating to ML 10.8.5, the above printer no longer prints.  I've updated the drivers to the latest from the Software Update (2.16.1 I believe as of this posting?).  This thread: https://discussions.apple.com/message/22875508 explai

  • Slightly off-topic, but Kudos to Creative's ebay out

    I ordered travelsound speakers off the outlet. it said no power adapter, no case, just the speakers and mini-cable. Well, holy cow, it arri'ved today and it was a blister packed brand new unit with power adapter/case! I'm using 'em with my zen as an

  • How can i have the date and time show up on my canon vixia hf m50

    Cannot get the date and time to show up onscreen in ANY videos on my new vixia HF M50. Can somebody help me on this?