No Carriage return required when outputting file

Hi All.
By default, SAP inserts an end-of-line character when transferring data to the "dataset". we do not want the empty line at the end.
Here is my code :
OPEN DATASET file_path FOR OUTPUT IN BINARY MODE
                      ENCODING DEFAULT
                      WITH SMART LINEFEED
                       MESSAGE msg.
IF sy-subrc = 0.
  LOOP AT itab INTO wa.
    l_off = STRLEN( wa ).
    TRANSFER wa TO file_path LENGTH l_off NO END OF LINE.
  ENDLOOP.
  CLOSE DATASET file_path.
ELSE.
" Error that file_not_opened.
ENDIF.
As you see, I have tried all possible ways : Opening in binary format, text format, writing with length specification, no end of line - but a blank line is always coming at the end.
Any clues?
Thanks in adv.
Samant

Hi Samant,
Here is the program, i have tested it and its working fine.
REPORT ztest1 .
DATA : BEGIN OF itab OCCURS 0 ,
text(140),
END OF itab.
DATA : wa TYPE itab,
       file_path TYPE rlgrap-filename VALUE '/tmp/zt.txt',
       l_off TYPE i.
APPEND 'test1234' TO itab.
APPEND 'abcdefghijklmnopqrstuvwxyz' TO itab.
APPEND 'test1234' TO itab.
OPEN DATASET file_path FOR APPENDING IN BINARY MODE.
ENCODING DEFAULT
WITH SMART LINEFEED
*MESSAGE msg.
IF sy-subrc = 0.
  LOOP AT itab INTO wa.
    l_off = strlen( wa ).
    TRANSFER wa TO file_path LENGTH l_off.
  ENDLOOP.
  CLOSE DATASET file_path.
ELSE." Error that file_not_opened.
ENDIF.
Best regards,
Prashant

Similar Messages

  • Password required when placing file in Trash?

    Hello everyone!
    Since upgrading to Maverick, I am required to enter my password each time I want to place a file in the trash. Also, it automatically empties the trash, rather than just placing it in there for me to empty the trash manually. How can I fix this?
    I'm really NOT a computer geek, so please bear with me and keep it simple!
    Thanks!

    Mac asking for password when moving files to Trash
    Finder requires password for moving or..
    Password Needed to Move Items to Trash - How Do I Fix This?
    why is a password required for trash
    Admin password required when moving file from desktop to trash

  • Carriage Returns in XSLT output

    I need to output a text file with CRLF characters at the end of each line. I've explicitly put both characters into the XSLT file ( <xsl:text>
</xsl:text> ) but the default oracle.xml.parser.v2 in JDeveloper keeps converting the CR to LF. How can I force the parser to output the CR?

    This is incorrect. You can tell the processor to keep and output whitespace nodes if you use the character encodings (&amp;#xA; &amp;#xD; &amp;#x20; &amp;#x9;) and the output method is text. I am getting the correct output for space-only nodes (&amp;#x20;) and the linefeed character (&amp;#xA;). I am also getting a whitespace-only character for the carriage return (&amp;#xD;) node, it is just the <em>wrong</em> character - the parser is converting it to &amp;#xA;, so I am getting two linefeed characters where my stylesheet specifies &amp;#xD;&amp;#xA;.

  • Add a carriage return in a .csv file

    I running the following command which works but I would like to format the output in the CSV file. The "SecondaryAddresses" field is where my issue is. The field contains multiple addresses as such:
    {[email protected], [email protected], [email protected]}
    Current output in .csv file.
    Desired output in .csv file.
    I want to be able to add a return into the .csv file so the data is in one cell.
    Get-Mailbox jblake -DomainController "DC01" -ResultSize Unlimited | Select-Object DisplayName,alias,PrimarySmtpAddress, @{Name=“SecondaryAddresses”;Expression={$_.EmailAddresses | Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object
    {$_.SmtpAddress}}}
    Chris

    I think that is still not quite there, it is missing the filter on PrefixString.
    Get-Mailbox jblake -DomainController "DC01" -ResultSize Unlimited | Select-Object DisplayName,alias,PrimarySmtpAddress, @{Name=“SecondaryAddresses”;Expression={($_.EmailAddresses | Where-Object {$_.PrefixString -ceq "smtp"}).SmtpAddress -join "`n"}}
    Enclosing $_.EmailAddresses | Where-Object {$_.PrefixString -ceq "smtp"} in parenthesis lets us use the dot operator on the array that it returns. Accessing a property on an array that is actually a property on each of the objects in the array
    should return an array of those property values (an array of SmtpAddresses), which we can then -join with the newline character. Note that this feature of arrays was added in v3.0 so in case you're on an older version this wouldn't work.
    I also don't have the Exchange cmdlets, so I unfortunately I cannot test it either.

  • How do I add a carriage return to the output ?

    I have a listBox with 15 values. That list box is connected to a textBox. The text box prints only the selected items from the listBox (thanks try67 for the help getting that set up). Now what I would like to do is have each of the items that are selected to appear seperately in lieu of having one lone continuous line. I think what I need to do is add a carriage returne (or two) between each item selected. Here is the code I have for custom calculation script
    var v = this.getField("DiagnosisList").value;
    if (typeof v=="string") event.value = v;
    else event.value = v.join(", ");
    I triend adding  /r/n   but I keep geting syntax error. Thanks for any assistane.

    I appreciate you assistance, but this is not going to work. The narrative on the listBox for each item is so large, that it either gets chopped off or if I set the text size to auto it is too small. Is there a way to display the list items in a format that 'wraps'? If not then I will neet to set it up with check boxes now, but here is how the format should work:
    () item one
    () item two
    () item three
    then allow certain ones to be checked,
    (x) itme one
    () item two
    (x) item three
    and based on the ones checked, those are the only ones that print
    Item one.
    Item two.

  • Password required when deleting file

    I am a new mac user and transfered files from my PC. I tried to delete a file and a popup window requires a password. I type the password (it does not tell me it is wrong, unless it is) and I hear a sound, but the file is not deleted. Help!

    I think I did this right. Went to terminal; changed directory by typing
    cd documents/favorites/
    then typed ls and this is what I got:
    susan-bruces-macbook-pro:~ susanbruce$ s -ale /Users/susanbruce/Documents/Favorites/Mirtazapine\ A\ Newer\ Antidepressant\ -\ January\ 1,\ 1999\ -\ American\ Academy\ of\ Family\ Physicians.url
    -bash: s: command not found
    susan-bruces-macbook-pro:~ susanbruce$ cd documents/favorites/
    susan-bruces-macbook-pro:favorites susanbruce$ ls
    Accessories.URL
    Amazon.com Viatek's Dynabrite Tri LED Flashlight Health & Personal Care.url
    Andover, Massachusetts (01810) Conditions & Forecast Weather Underground.url
    Blockbuster.URL
    Club Pogo - Exclusive Games, No Ads, Bigger Prizes!.url
    CourierPress The Evansville Courier & Press - Evansville, Indiana.url
    Crosswords & Games - New York Times.url
    Desktop.ini
    Dictionary.com.url
    Douglas Johnston's Day Runner Kit DIY Planner.url
    EnterPogo Backdoors - Thousand Island Solitaire.url
    Extended Service.URL
    Fair Indigo.url
    Gilmore Girls (a Titles and Air Dates Guide).url
    HP Music.URL
    Home.URL
    Host Monster Review - Web Hosting Bluebook.url
    IMDb - Now Playing in the U.S..url
    Lima Post.url
    Links
    MSN.com.url
    Master Promissory Note - Complete a New MPN.url
    Microsoft Websites
    Mirtazapine A Newer Antidepressant - January 1, 1999 - American Academy of Family Physicians.url
    Mobile Favorites
    Movie Showtimes, Tickets and Reviews from Yahoo! Movies.url
    My Product Advisor.url
    OVGC - Tell City District Office.url
    Online Photos First 25 Free.URL
    Peru News.url
    Premium Crosswords - New York Times.url
    Radio Station Guide.url
    Routers with Trend Micro have admin, Internet problems or anti-virus errors.url
    Search.URL
    Shop.URL
    Sonic Solutions.URL
    Southern Hills Counseling Centers.url
    Spyware Protection.URL
    Street Name Signs - We sell D.O.T. approved real street name signs for outdoor or indoor use as fun gifts..url
    Symantec Security.URL
    The New York Times - Breaking News, World News & Multimedia.url
    Trying to Export the Success of a Maine Seabird Program.url
    Used Car Listings - MSN Autos.url
    VioSoftware.com - Buy Cheap Software Discount Sale Trend Micro PG.url
    YouTube - Broadcast Yourself..url
    casebolt construction.url
    eBay.URL
    eDirectSoftware.com -.url
    www.sneekin.com.url
    susan-bruces-macbook-pro:favorites susanbruce$

  • XSLT - New Line/Carriage Return not displaying when deployed

    Hello everyone,
    I have an XSL Style Sheet that is supposed to transform an XML into plain text using Oracle SOA 11g BPEL transformation. The plain text transformation is working fine, but whenever I try to add a new line or carriage return, the text output doesn't reflect that. I've tried several ways of adding the line break but none of them have worked. This is the XSLT I'm using for testing purposes:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="urn:oracle:b2b:X12/V4010/850" version="1.0">
    <xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
    <xsl:template match="/a:Transaction-850">
    <!-- New line -->
    <xsl:variable name='newline'><xsl:text>
    </xsl:text></xsl:variable>
    <xsl:value-of select="a:Internal-Properties/a:Data-Structure/a:Property[@Name='InterchangeUsageIndicator']" />
    <xsl:text>&#xd;</xsl:text>
    <xsl:value-of select="$newline" />
    <xsl:text>&#xA;</xsl:text>
    <xsl:text>&#13;</xsl:text>
    <xsl:text>&#10;</xsl:text>
    <xsl:text>2000ITITM</xsl:text>
    </xsl:template>
    </xsl:stylesheet>
    When I try it out in an online XSLT test tool, it gives the output as expected:
    P
    2000ITITM
    When I deploy the composite, I noticed that the XSLT in the MDS repository ignores the line breaks, *#xAs, etc. and just closes the <xsl:text/> tags:
    <?xml version='1.0' encoding='UTF-8'?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="urn:oracle:b2b:X12/V4010/850" version="1.0">
    <xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
    <xsl:template match="/a:Transaction-850">
    <xsl:variable name="newline">
    <xsl:text/>
    </xsl:variable>
    <xsl:value-of select="a:Internal-Properties/a:Data-Structure/a:Property[@Name='InterchangeUsageIndicator']"/>
    <xsl:text/>
    <xsl:value-of select="$newline"/>
    <xsl:text/>
    <xsl:text/>
    <xsl:text>2000ITITM</xsl:text>
    </xsl:template>
    </xsl:stylesheet>
    And so, because of that, it just gives me the following output:
    P2000ITITM
    I have no idea why it's ignoring the new line characters, so any guidance would be appreciated.
    Thank you all for your help and time!
    Edit: I tried concatenating as follows:
    <xsl:value-of select="concat('36','&#xA;')"/>
    <xsl:value-of select="concat('24','&#xD;')"/>
    ...which shows up as is when I look at it in the MDS repository, however the text output still shows no line breaks...
    Message was edited by: dany36

    Ah I'm such a newbie. I was able to get it displayed by doing the following:
    <xsl:variable name="newline" select="'&#xD;&#xA;'" />
    This would show up correctly in the MDS repository, too.

  • How to supress carriage return in File?

    Hi
    I am getting a file which is very large. When i am processing the large file, file adapter is picking but i dont see any message in SXMB_MONI. Each record in my file should be in same line, But some of the fields like "address2" in the records have carriage return so when ever this address2 has data this record splits into two lines.
    Ex:
    Name, ID, Address1, Address2, City, State, Country..
    Name, ID, Address1, Address2, City, State, Country..
    Name, ID, Address1, Address2, City, State, Country..
    Name, ID, Address1,Address2,
    City, Country....* like this....
    think because of this my file is not processing. Because I checked individually this type of records I am getting the errors.
    But if i am processing as whole file XI is picking up but its not showing anything in SXMB_MONI.
    How to remove the carriage return if i get the records like this.
    Thanks & Regards
    Sowmya...

    Hi,
    Even if you have any errors in the file data, it should not stop XI from picking up the file. In this case, the file should be processed and you should find errors in SXMB_MONI. When you said compressed what did you do? Did you make a shorter file out of the large one? In that case, check if the file name and directory are exactly configured (case sensitive). Check the adapter monitoring if you find any red light.
    Coming to the data problem, unless you file end character is different from carriage return, I do not think XI would be able to parse the file properly. You might want to request you file generating application to suppress the carriage return in any of the data fields or at least the record delimiter.
    VJ

  • Importing XML Text files with Indesign friendly 'Carriage Returns'

    Hi,
    I have a question wrt importing XML into Indesign.  I have my text stored in Excel (Fig A) and intend to export as an XML file where each line will represent each page.  However, my first attempt failed to treat the 'carriage returns' as I'd envisaged:
    The 'carriage returns' used within an Excel cell (ALT-ENTER) are maintained when transforming to a CSV file (Fig B).  However, when converting to an XML file, the conversion only takes place on a line by line basis and hence the XML file becomes incomplete (Fig C).
    So, it appears I need to make sure that the CSV file contains one line per entry, while also maintaining the actual carriage returns in my source spreadsheet and for Indesign to recognise them.  In order to do this, I'll need to substitute the 'carriage returns' in my excel column to be represented by a new set of characters.  My question is how can I let Indesign know to recognise this set of characters to be converted to a carriage return, when importing text.
    For example, if this set of characters was '%%%%%%', then my new csv file would look like Figure D and the XML would be produced correctly, like Figure E.  Then importing this XML file to InDesign, the carriage returns would automatically be reinstated, hopefully.
    I hope someone can help me as I am only starting out in Indesign and feel Im running before I can walk by venturing into the XML/Indesign arena too soon.
    Best Regards
    Luke

    Hi,
    Thanks for all the responses.
    With regard to XML, it could well be an issue has crept in because I am using another utility to convert my csv's to xml and maybe there are better options out there. I will take a look for other utilities and try that (Its not possible from Excel easily, even though there is an option to save as an XML file).
    Secondly, because the XML was readable by internet explorer, I assumed it had a satisfactory standard XML format which would be accepted by any program, including InDesign.  This proved true, since the XML file i generated was actually recognised by my Indesign document and populated the tags correctly, albeit without any carriage returns. 
    When I save my excel sheet as a csv, it does actually hold the carriage returns causing multiple lines per entry, hence why I need to substitute the actual carriage returns in my excel sheet to a alternative character set so that the entry remains on one line.
    Re: Double quotes on text fields.  Im sorry, I didnt realise I had commas in my sample csv example.
    I should have corrected it, but I intend on using semi-colons as my csv delimiter and don't intend on having semi-colons in my excel sheet itself, so I possibly won't need any double-quotes.
    So, it looks like this is what I need to do ;
    i)   Add a column in Excel which substitutes all the carriage returns with a line break identifier (^n).
    ii)  Convert Excel file to a semi-colon csv holding this new column,
    iii) Convert csv file to XML using a good CSV->XML utility,
    iv)  Add the respective XML tags to my INDD document,
    v)   Add a GREP rule which does a find/replace on all instances of ^n and replace with a line break,
    vi)  Import the XML file,
    vii) Apply the find/replace GREP rule on the whole document. Carriage returns on my text fields should be consistent with my original excel sheet.
    Thanks for all your help fellas.  Will report on how I get on once Im done.
    Best Regards
    L

  • Carriage Return Problem

    Hello,
    I have written some code which extracts data from a MySQL
    database and stores it in a CSV file using CFFILE.
    However, the database includes data inserted from an HTML
    textarea form element which is stored in a MySQL text field. The
    textarea data includes carriage returns which, when written to a
    CSV file, force a new line which makes the data messy.
    Is there a way of removing the carriage returns?
    Many thanks,
    Simon

    I recently had to deal with a similar situation. The
    differences are:
    1. My file is pipe delimited.
    2. My source data comes from a vendor application, not an
    html form.
    The following code worked for me.
    <cffile action="write" nameconflict="overwrite"
    addnewline="no" output=""
    file="d:\dw\dwweb\work\#CaseFileName#">
    <cfoutput query="casedata">
    <cffile action="append"
    file="d:\dw\dwweb\work\#CaseFileName#"
    output="#caseid#|strip a bunch of
    fields|#theatre_mcase#|#Replace(pre_op_diag, chr(10), ' ',
    'all')##chr(13)#">
    </cfoutput>

  • Carriage Return for text area

    Hello All,
    I have a text area that I am pre-populating from a column in a database and I need to do a carriage return. When inserting the information into the column I put 'chr( 10 )|| chr( 13 )||' after each place where I need to do a carriage return, for some reason it is not being saved in the database that way.
    The sql I used to insert the information into the column looks like:
    update 456.xyz
    set 123 = a || chr( 10 )|| chr( 13 )||
    b || chr( 10 )|| chr( 13 )||
    c || chr( 10 )|| chr( 13 )||
    where abc=def;
    I need the output in the text area to be:
    a
    b
    c
    But it populates as:
    abc
    Any help would greatly be appreciated!

    I just tested this code:
    select 'The date '||sysdate||chr(10)||'is a '||to_char(sysdate, 'DAY')||chr(10)||chr(13)||'Week :'||to_char(sysdate, 'WW') from dual;The output was:
    The date 03.06.2010
    is a TORSDAG
    Week :22I put this in the source of the textarea and set it to update and replace content ( source used always )
    Edited by: Olav Alexander Mjelde on Jun 3, 2010 1:17 PM

  • Carriage Return using XSL

    Hi,
    I have an RTF template that contains <xsl:text> &#10;</xsl:text> in one of the form fields because I want to force a Carriage return in the output.
    The form field looks something like:
    <?when?>
    Some text
    <xsl:text> &#10;</xsl:text>
    More text
    <?end when?>
    The resulting output is Some text &#10; More text. What am I doing wrong ?
    Thanks,
    Pat

    Hi Pat,
    Hmmm..looks like the XMLP processor is not preserving the carriage return while processing the document. In fact i tried giving certain hexadecimal characters for achieving the carriage returns in the resulting document, but to of no use. It doesnot work!!!
    I used the following in my RTF template:
    <xsl:text>Hello </xsl:text>
    <xsl:value-of select="ROWSET/ROW/ENAME"/>
    <xsl:text> &amp; Family,&#x0A;</xsl:text>
    <xsl:text>Your id is </xsl:text>
    <xsl:value-of select="ROWSET/ROW/EMPNO"/>
    XML
    <ROWSET>
    <ROW num="1">
    <EMPNO>7839</EMPNO>
    <ENAME>KING</ENAME>
    </ROW>
    <ROW num="2">
    <EMPNO>7788</EMPNO>
    <ENAME>SCOTT</ENAME>
    </ROW>
    </ROWSET>
    Desired output:
    Hello King & Family,
    Your id is 7839
    What is achieved using XMLP 5.5:
    Hello KING&amp; Family,&#x0A;Your id is 7839
    Which clearly shows that the XMLP processing is not preserving the carriage returns, special symbols etc.
    Tim,
    Do we have any solution to this issue in the upcoming releases of XMLP?
    or is there any other way to achieve the functionality?
    Please reply asap.
    Thx,
    Nitin

  • Dreamweaver moves my carriage returns?

    Dreamweaver seems to be moving my carriage returns.  When I put paragraph text inside a span, I usually put a carriage return (i.e. hit "Enter") before and after the span tags so that they are easy to see/find in the file, and are aligned.  If I open up the file in a text editor, it appears as I typed it, but in Dreamweaver the carriage return displays in a different place than where I put it.  And word wrap is not on.
    Example, as typed and saved:
    text text text text text text text text text text
    <span class="highlight">This is an example</span>
    text text text text text text text text text text
    As displayed in Dreamweaver the next time I open the file:
    text text text text text text text text text text <span class="highlight">This
    is an example</span>text text text text text text text text text text
    In DW I will go back in and "fix" everything, only to have to messed up again the next time I open the file.
    Can anyone help with this?  Thanks.

    Edit > Preferences > Code Format > Tag Editor.  See screenshot.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web.blogspot.com

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Embedded carriage return

    We have  an application with a textarea that is used for comments, free form text. It seems that if the user enters a line of text, then uses the enter key to go to the next line, it captures the carriage return. When the form is brought up for review, it is completely empty, yet all the data that was entered is in the table.
    If the textarea is entered without using the enter key, the data displays when the form is reviewed.
    I have never encountered this problem before and tried it and it does indeed do what is described above. I entered the textarea without using the enter key and the data displays. I went back to edit and added the enter key to the textarea and the form is completely blank.
    What is going on and how can I prevent this from happening ?

    The data is not missing. It is in table after submit. It is just not showing up when using html/form to review. Using <cfinput type="text" name="field" value="qryField">, etc..., when there is a carriage return used in the textarea.
    We took the textarea data, scrubbed out the carrirage return characters, and reinserted in the table, and then entire form displayed. When I went back to edit the form and added the carriage returns, nothing displayed.
    We have isolated the problem to the carriage return in the text area becuause that is the only thing we have touched so far.

Maybe you are looking for

  • OURPUT TYPE FOR A SALES ORDER TYPE

    Hi, When i create a new sales order for the type SO, the system don't affect the output type to my order. I have to do it manualy. What's missing? In custo, I define the same output type of CS to the order type SO but is still not working. It's work

  • Report Output Display Probem

    Hi Gurus, My Report output is having multiple pages, Here my problem is, there is a large gap between each page, how to reduce this gap?here sy-pagno is showing '1' even my output is having multiple pages.please advice me. Thanks & Regards, Vijaya.

  • Problems Installing iTunes 7

    Hey guys i recently bought a new iPod 5.5G but I've been using iTunes for a while and when i synched it up it said i need iTunes 7.0 or later so i downloaded the latest iTunes but when i tried to install it it came up with an error: "The installation

  • 4K Footage Clamped at 1364x767 in AE 5.5

    I am performing some compositing tests using 4K footage (3840x2160, Apple ProRes 422 HQ, from BM Prod. Camera 4K) in AE 5.5.  However, when I import the footage, the resolution is listed as being 1364x767.  Closer inspection reveals that the footage

  • Cant email photos from Organizer

    cant e-mail photo in photoshop Message title was edited by: Brett N