SAP PI 7.3.1 XML line break within node

Good Morning All,
I've an issue with link breaks in XML. Basically, the scenario is IDoc (SAP) to File (XML 3rd Party System).
I've mapped a text field from the IDoc to the XML node (<comments>) .  The text data comes across with a delimiter !$! to indicate where a line break should occur within the <comment>  node in the XML
For example the text line comes across in the IDoc as  line 1!$!This is Line 2!$! this one is line 3!$!  and within the xml file I need to the <comment> node to look like  <comment>line 1
                                   This is line 2
                                   this one is line 3</comment>
We need this for formatting in the 3rd party system. I've tried various replaces etc. but the new line never seems to get recognized. 
Any help with this would be very much appreciated.
Thanks
G

Use OS specific new line character by using System.getProperty("line.separator"):
Here is complete code:
UDF with Context option
Parameters:String var[], ResultList result)
String temp[] = var[0].split("!$!");
for(int i = 0; i < temp.length; i++)
     result.addValue(temp[i] + System.getProperty("line.separator"));
Check it should work, I have not tested...
--Divyesh

Similar Messages

  • Remove line breaks within a xml element

    Hi,
    I have a xml element that contains a long text string with multiple line breaks. something like this:
    text
    text
    text text
    text
    text text text
    text
    How can I remove all line breks except one, i e I still want a line brek after each text line:
    text
    text
    text text
    text
    text text text
    text
    Thanks for you help!
    Magnus

    This is a media object (BLOB) in a JDE report. But we have now modified the report to get the xml file correct from start instead.
    /Magnus

  • Inserting line break within label

    Hey guys,
    i've run into a small problem with the coding. right now im
    creating image viewer within a horizontal list. at first, i had
    each object coded inside the horizontal list but then i decided to
    place everything in an xml file to make changes easier. since i've
    switched, i have not been able to figure out how to insert a line
    break for each label. this is what the code looked like when i was
    naming each object.
    <mx:HorizontalList id="PosterSelect" height="352"
    columnCount="3" columnWidth="200" width="580"
    rollOverColor="#ff3344" themeColor="#DC240B"
    itemClick="itemClicked(event)">
    <mx:dataProvider>
    <mx:Array>
    <mx:Object id="object1" label="March 12, 2008&
    #13;Chicago, IL" data="events"/>
    <mx:Object id="object2" label="March 12, 2008&
    #13;Chicago, IL" data="events"/>
    <mx:Object label="March 12, 2008& #13;Chicago, IL"
    icon="{event3}" data="events"/>
    <mx:Object label="March 12, 2008& #13;Chicago, IL"
    icon="{event4}" data="events"/>
    <mx:Object label="March 12, 2008& #13;Chicago, IL"
    icon="{event5}" data="events"/>
    </mx:Array>
    </mx:dataProvider>
    </mx:HorizontalList>
    within the label property, i used the & #13; character to
    insert a line break. now im using an item renderer to call the
    information from my xml file. the problem is... i cannot figure out
    how to insert a line break like i did previously. from what i
    understand... the text in the label field of the xml file is
    already parsed when it comes into flex. so using the & #13; or
    \n characters will not work. i also tried hitting enter to insert a
    new line in the xml file but that did not work either. does anyone
    know how i could work around this?? below is my current code and
    xml
    <eventinfo>
    <events>
    <label>March 12, 2008#13;Chicago, IL</label>
    <group>group name</group>
    <location>Detroit, MI</location>
    <icon>posters/event1.png</icon>
    <fullsize>posters/event1.png</fullsize>
    </events>
    <events>
    <label>March 12, 2008#13;Chicago, IL</label>
    <group>group name</group>
    <location>Detroit, MI</location>
    <icon>posters/event4.png</icon>
    <fullsize>posters/event1.png</fullsize>
    </events>
    </eventinfo>
    <mx:HorizontalList id="HorizontalCanvas" height="337"
    columnWidth="180" width="672"
    rollOverColor="#ff3344" themeColor="#DC240B"
    itemClick="callJavaScript()" x="10" y="33" borderStyle="solid"
    dataProvider="{eventinfo.events}" borderColor="#000000">
    <mx:itemRenderer>
    <mx:Component>
    <mx:VBox width="100%" height="350"
    horizontalAlign="center">
    <mx:Image source="{data.icon}"/>
    <mx:Label text="{data.label}"/>
    </mx:VBox>
    </mx:Component>
    </mx:itemRenderer>
    </mx:HorizontalList>

    hey atta,
    sry, i was using the &#13; character but for some reason
    when i posted the character it turned into a space so i added the
    space inbetween the & and the #13;
    but yea i think it was the height... changed it to 40 and it
    worked.. i cant believe i didnt notice that lol... oh well... thx
    for the help!!!

  • Line breaks within contents of floating fields

    Hello everyone,
    I have the following question regarding the usage of floating fields and line breaks:
    I have a text that incorporates a companies name using a floating field.
    If the name of the company is too large, a line break is forced automatically. In some cases the companies name is like "Company 123 N.V.". When the line break is forced on this company, its shows "Company 123 N." on the first line and "V." on the second line.
    How can i prevent the line break at "N."? I suppose the break is because of the "." in the text. But I want it only to be a line break if the "." is followed by a space, not if there is more text to it.
    The same sort of issue we face with floating fields containing for example telephone numbers ( format: "+31 (0) 20 - 123 456 1", line break at the "+", "(" or the spaces) and e-mail addresses ( [email protected], line break at the "@" or the ".") .
    Thanks for any reply on this.
    Regards,
    Joris

    I have the same problem. Does anyone have an answer for this one, please?
    Thanks,
    Vanessa

  • Preventing line breaks within field

    Hi,
    Some of my fields contain phrases that should stay together rather than break over a line. For example, one of my fields is a date field (e.g. 27 October 2009) and I'd liike the whole date field to stay together on one line. Is there any way to control this?
    Thanks a lot for any help provided!

    IS that within a table cell or free text?
    In free text it should stay together unless the field is right at the end of a line e.g.
    +This piece of text was written on 1st January
    2009 and has broken across a line.+
    Not much you can do for that except ensure that there is plenty of space.
    If its in a cell/column of a table - you need to give it enough width to handle the string in the word table. If you want to handle it programmatically you can but its going to squash other columns to make enough room. You are better to 'hardcode' the table column widths to handle the expected data.
    Regards
    tim

  • Detecting line-breaks within a column of an uploaded tab-delimited file.

    Suppose you upload a tab-delimited file from your laptop and split each row of the file into some structure that you append to an itab.
    Is there a way inside ABAP to detect that a field of the uploaded file has a CR or CRLF in it?  And if so, where it is ?
    Thanks in advance ...

    You can use any of the following for those char.
    DATA:   head_crnl(1)   TYPE c VALUE cl_abap_char_utilities=>cr_lf,
              top_crnl(1)    TYPE c VALUE cl_abap_char_utilities=>cr_lf,
              end_crnl(1)    TYPE c VALUE cl_abap_char_utilities=>cr_lf,
              blank_crnl(1)  TYPE c VALUE cl_abap_char_utilities=>cr_lf,
              final_crnl(1)  TYPE c VALUE cl_abap_char_utilities=>cr_lf,
              first_pgbr(1)  TYPE c VALUE cl_abap_char_utilities=>form_feed.
    Declare the above variables and check if they occur in the file. Hope this helps.

  • How to get a line break

    Hi All,
    How do I get a line break within a particular field?
    My DB structure is that I have 4 columns address_line_1, address_line_2 and so on. I cannot select them as different fields because all of them can be null, in which case i pick it from internal_address_line column.
    I use:
    SELECT DECODE(address_line_1, NULL, internal_address_line, address_line_1 || ', ' || Address_Line_2) as ADDRESS
    But instead of th comma separating the 2 address lines I want a line break so that 2 address lines come in 2 separate lines in the output.
    It doesn't allow me to use chr(10) as a line break and gives an error
    I'm using Reports 2.5
    TIA
    Naveen

    Yes, true.
    How about setting up the sections as:
    Section 1 Introduction ('Section num space introduction' in this example - tab may be better)
    Then generate the Contents.
    Then do a GREP find/change on the document after the contents:
    This will add a forced line break and tab after each section number... You might want to specify a para style in the Find Format box too, so that references to Section xx in body text are not altered.
    If you update Contents after this, you will get the line break and tab in the Contents too.

  • Missing line breaks with Excel

    Hello,
      Am downloading certain into Excel using BSP. I am changing response mime type to "application/vnd.ms-excel" and am sending tab-demilited string as data.
      Some of the columns should contain line break within the cell( Mean the Alt-Enter in Excel cell ). I tried using the character code 10 and also 13 for the break. But it did not work.
      How do I cause a line-break in the Excel cell? Any work-arounds??
    Thanks.
    Srinivas.

    Hi Srinivas,
    I think you don't have the possibility to add line breaks into a tab seperated file. You rearly had to create an excel file. Unfortenately AFAIK this is not possible in ABAP. I've done this in PHP using the <a href="http://pear.php.net/package/Spreadsheet_Excel_Writer">Spreadsheet_Excel_Writer</a>.
    Regards
    Gregor

  • ICal 5.0 inserting a line break (Lion)

    With iCal v4 (Snow Leopard 10.6) one could insert a line break within an event by typing ALT+return.
    This functionality seems to have disappeared with iCal 5.
    Has anyone else noticed this? Is there a workaround?
    Many thanks!

    I'm considering 'busycal' although I feel like a shill paying $50 for it. Please do update this if you find a solution or try another app that works well for you.  Cheers, J

  • Line Break for XML File

    All,
    I am able to generate xml file from an internal table. The problem is, if I open the file in IE everything looks good. When I open it in notepad or notepad++, everything is in one line. Can you tell me how to generate a line break after each tags.
    Please find the following code used by me for reference.
    LOOP AT lt_ohd INTO ls_ohd.
        ls_temp_ohd = ls_ohd.
        AT FIRST.
          l_ixml = cl_ixml=>create( ).
          l_document = l_ixml->create_document( ).
          l_element_ohd  = l_document->create_simple_element(
                      name = 'OHD'
                      parent = l_document ).
        ENDAT.
        AT NEW cc.
          CLEAR : lv_inhaltskom, lv_text.
          lv_inhaltskom = ls_temp_ohd-cc.
          CALL FUNCTION 'ISM_SELECT_TEXT_JJTIKO'
            EXPORTING
              pv_inhaltskom = lv_inhaltskom
            CHANGING
              pv_langtext   = lv_text.
          TRANSLATE lv_text TO UPPER CASE.
          l_value = lv_text.
          l_element_county  = l_document->create_simple_element(
                      name   = 'city_county'
                      value  = l_value
                      parent = l_element_ohd  ).
        ENDAT.
        AT NEW order.
          l_element_neighborhood  = l_document->create_simple_element(
                      name    = 'entry'
                      parent  = l_element_county  ).
        ENDAT.
        l_value = ls_temp_ohd-neighborhood.
        l_element_address  = l_document->create_simple_element(
                    name   = 'neighborhood'
                    value  = l_value
                    parent = l_element_neighborhood ).
        l_value = ls_temp_ohd-address_detail.
        l_element_address  = l_document->create_simple_element(
                    name   = 'address_detail'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-order.
        l_element_address  = l_document->create_simple_element(
                    name   = 'order'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-item.
        l_element_address  = l_document->create_simple_element(
                    name   = 'item'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-cc.
        l_element_address  = l_document->create_simple_element(
                    name   = 'cc'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-address.
        l_element_address  = l_document->create_simple_element(
                    name   = 'address'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-price.
        l_element_address  = l_document->create_simple_element(
                    name   = 'price'
                    value  = l_value
                    parent = l_element_neighborhood ).
        l_value = ls_temp_ohd-bed.
        l_element_address  = l_document->create_simple_element(
                    name   = 'bed'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-bath.
        l_element_address  = l_document->create_simple_element(
                    name   = 'bath'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-opentime.
        l_element_address  = l_document->create_simple_element(
                    name   = 'opentime'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-state.
        l_element_address  = l_document->create_simple_element(
                    name   = 'state'
                    value  = l_value
                    parent = l_element_neighborhood ).
        l_value = ls_temp_ohd-zip.
        l_element_address  = l_document->create_simple_element(
                    name   = 'zip'
                    value  = l_value
                    parent = l_element_neighborhood ).
        l_streamfactory = l_ixml->create_stream_factory( ).
        l_ostream = l_streamfactory->create_ostream_itable( table = lt_xml_table ).
        l_renderer = l_ixml->create_renderer( ostream  = l_ostream
                                              document = l_document ).
        l_rc = l_renderer->render( ).
        l_xml_size = l_ostream->get_num_written_raw( ).
      ENDLOOP.
    Regards,
    Salil
    Edited by: salil vaidya on Jan 18, 2011 2:34 PM

    Thanks.
    But now, I have a syntax error.
    BEGIN OF xml_line,
              data(256) TYPE x
    END OF xml_line.
    DATA: lt_xml_table      TYPE TABLE OF xml_line,
          ls_xml_table      TYPE xml_line.
    LOOP AT lt_xml_table INTO ls_xml_table.
        CONCATENATE ls_string cl_abap_char_utilities=>cr_lf INTO ls_string.
        MODIFY lt_xml_table FROM ls_xml_table INDEX sy-tabix.
        CLEAR : ls_xml_table, ls_string.
      ENDLOOP.

  • Line Break in XML?

    When I use "<br>" within my XML database, I get this
    error:
    "Expected end of tag 'br'(9,43)"
    I have tried <br>, </br>, <br></br>
    and searched... but haven't yet found a solution.
    Should I be using some kind of hex code?
    Thanks in advance for the assistance!
    Dan

    I spent a whole bloody day trying to solve this one!  Thanks for the advice here guys....
    Here's the "How to..." instructions I made for myself (I will need this later as a function of age)....
    Inserting <br /> line breaks in XML content:
    It's necessary to add a line of code directly after the dataset at the top of the (spry) htm page that sets the columnType:
    var dsRegInfoElem = new Spry.Data.XMLDataSet("regisinfo.xml", "sites/level1/site",{distinctOnLoad:true});
    dsRegInfoElem.setColumnType('datetime','html');<!--This line is necessary for the line breaks in the xml CDATA sections to work-->
    Make sure the xml tag that will contain the CDATA wrap is identified (here it's the <datetime> tag).
    Then, in the XML file, add the CDATA wrap just inside the tag like this:
    <datetime><![CDATA[texttexttexttext]]></datetime>
    Now just insert the <br /> where I need it!
    <datetime><![CDATA[texttext<br />texttext]]></datetime>

  • VSTO: How to set line break in Ribbon Xml?

    Hi All,
    I have a button in Ribbon.xml. it looks like:
            <group label="myLabel" id="View">
              <checkBox id="cbView" label="ViewViewviewviewview" getPressed="cbView_Pressed"/>
            </group>
    The result is shown as:
    The checkbox is too long. My question is : How to set line break in checkbox's label.
    Thanks a lot,
    By the way, in Ribbon Xml. How to add RadioButton?

    Hello Ricky,
    The Fluent UI (aka Ribbon UI) doesn't provide any attribute or callback for that. You can try to use an escape sequence "\n\r", but I am not sure whether it helps. Also you may consider placing a text block below the check box control.
    You can read more about the Ribbon UI in the following series of articles:
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)

  • When exporting XML files, I get forced line breaks before and after my xmltag

    hi everybody,
    as I said, i do a javascritp that exports xml files. First I clean up my text by removing every invisible characters with app.findpreferences. Nevertheless, my xml files is almost well formed beacause i got before and after each xmltag a forced line break. Somebody could explain to me why ?
    I don't use prettyIndent and prettyPrinting .
    Best regards
    Américo Pinto

    hi everybody,
    as I said, i do a javascritp that exports xml files. First I clean up my text by removing every invisible characters with app.findpreferences. Nevertheless, my xml files is almost well formed beacause i got before and after each xmltag a forced line break. Somebody could explain to me why ?
    I don't use prettyIndent and prettyPrinting .
    Best regards
    Américo Pinto

  • Handling Line breaks in Oracle XML Publisher

    Hi,
    I’m developing a XML Publisher report.The data definition file has a tag which contains line breaks(\n- new line).
    How to handle this logic in RTF template?
    For Example:
    XML tag:
    <CF_LONG_TEXT>Final Adjusted Total Costs: $0.00 \n Less: Initial Billing Amount - $(1.65) - Invoice # 100000 \n \n Final Billing Amount: $0.88 \n \n Computation: \n a) Adjusted Number of Full-Time Students: 2,877 </CF_LONG_TEXT>
    Desired Output:
    Final Adjusted Total Costs: $0.00
    Less: Initial Billing Amount - $(1.65) - Invoice # 100000
    Final Billing Amount: $0.88
    Computation:
    a) Adjusted Number of Full-Time Students: 2,877
    Thanks,
    Sri.

    Hi,
    Please try giving this:
    <xs:attribute name="space" default="preserve">
                          <xs:simpleType>
                              <xs:restriction base="xs:NCName">
                                 <xs:enumeration value="default"/>
                                 <xs:enumeration value="preserve"/>
                               </xs:restriction>
                          </xs:simpleType>
                    </xs:attribute>
    Regards
    Suraj

  • I need to find all XML elements and add a line break to the text of each of them

    I need to find all XML elements and add a line break to the text of each of them.
    Is this possible with a script?

    I need to go from this ...
    to this...
    but looking for the XML elements (not paragraphs) and then adding text ...
    Thanks for your attention !!!

Maybe you are looking for

  • Data not matching in RSA3 and PSA.

    Hi, I have loaded data into BW from a Generic datasource and the values in R/3 and BW are not matching. Upon analysis, I found that the values for a characteristic are not matching even in RSA3 and PSA. All the values for other characteristics match

  • Setup/ Configuration Question

    The network setup I'm using is a wireless G router, Belkin brand, and I have four WRE54G expanders throughout the warehouse. I don't have WEP turned on so I used the auto configuration on all of them. They all made connection and they all work. Howev

  • Tolerance for AP Checks

    Hi All, Where can I go to set tolerance for vendor check payments? Eg: If I am paying a vendor a check for $1, I want the system to put a tolerance around that and prevent me from paying a check worth that small an amount. Thanks, Deki

  • Is it possible to lock the keyboard?

    Hi, I am using my MacBook Air for SKYPE calls and DVD's with my 20 month old and it all goes well until he decides to put his little fingers near the keyboard... I need to be able to lock it - a bit like on a telephone. Does anyone know if this is po

  • I want to upgrade my storage on my macbook pro .I need to know what to buy

    Group: MacBook Subgroup: Pro Screen Size (inches): 13 Screen Resolution: 1280x800 glo Colour: Aluminium Family: A1278 Model Code: mbp_13_mid_10 CPU Type: Intel 2.4 GHz Core 2 Duo (P8600) CPU Speed: 2.4GHz RAM Type: DDR3 PC8500 SODIMM 1066MHz RAM slot