<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic READ_TEXT and trailing spaces in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-and-trailing-spaces/m-p/7948640#M1601502</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Disclaimer: I am not an ABAP programmer, I am a DataStage data migration developer, but I have been given an ABAP program to use to extract long text from SAP. I have a concern about the behaviour of the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It declares a text line in a structure:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA:   BEGIN OF EX OCCURS 0,
          MATNR(18)        TYPE C,
          TEXTTYPE(4)      TYPE C VALUE 'MATERIAL',
          SEQNO(4)         TYPE N,
          TEXT_TDFORMAT(2) TYPE C,
          TEXT_DETS(132)   TYPE C,
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It then calls READ_TEXT and copies the text into this structure one line at a time and then sends it over a CPI-C connection to DataStage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I receive the data, every line is padded to 132 characters with spaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My concern is, could the lines contain genuine spaces at the end, that are getting lost in among the padding?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Jul 2011 12:49:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-07-04T12:49:35Z</dc:date>
    <item>
      <title>READ_TEXT and trailing spaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-and-trailing-spaces/m-p/7948640#M1601502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Disclaimer: I am not an ABAP programmer, I am a DataStage data migration developer, but I have been given an ABAP program to use to extract long text from SAP. I have a concern about the behaviour of the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It declares a text line in a structure:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA:   BEGIN OF EX OCCURS 0,
          MATNR(18)        TYPE C,
          TEXTTYPE(4)      TYPE C VALUE 'MATERIAL',
          SEQNO(4)         TYPE N,
          TEXT_TDFORMAT(2) TYPE C,
          TEXT_DETS(132)   TYPE C,
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It then calls READ_TEXT and copies the text into this structure one line at a time and then sends it over a CPI-C connection to DataStage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I receive the data, every line is padded to 132 characters with spaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My concern is, could the lines contain genuine spaces at the end, that are getting lost in among the padding?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2011 12:49:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-and-trailing-spaces/m-p/7948640#M1601502</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-04T12:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: READ_TEXT and trailing spaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-and-trailing-spaces/m-p/7948641#M1601503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;spaces at the end of a line only matter if the paragraph format of the next line is a "=".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2011 12:56:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-and-trailing-spaces/m-p/7948641#M1601503</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-04T12:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: READ_TEXT and trailing spaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-and-trailing-spaces/m-p/7948642#M1601504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, some of the lines are continuation lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the weird thing. I did a search for lines that are exactly 131 characters long, and found a load of them. It looked to me like we had trimmed the trailing space, and that when we re-loaded the text, it would be wrong and the space would be dropped. Indeed, the text did look wrong when I loaded it in a development client. However, when I went back and looked at the original text in the source client, &lt;EM&gt;the spaces were missing there too&lt;/EM&gt;. It looks to me like whoever loaded the text in the first place made the same mistake that I thought we were making, as there are text lines in the source data that genuinely are 131 characters long but look like they ought to have a space at the end, because the next line (TDFORMAT '=') continues with what evidently should be a separate word but there is no space there in SAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my transformation code, I have ensured that I never write a line with a space at the end, if one or more spaces would naturally land at the end of a line then I wrap them onto the beginning of the next line instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;edit&lt;/STRONG&gt; I am still concerned that, although most of the continuation lines in the source appear to be already broken, if there are any in there that are not broken and do have a space at the end of a 132-character line that has a continuation line following it, then our extract will lose that space as being indistinguishable from a 131-character line that has already somehow lost its space in SAP. Is there anything that can be done in the ABAP program to check the length of the line that READ_TEXT populates? What is a TLINE?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Phil Hibbs on Jul 4, 2011 3:05 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2011 13:02:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-and-trailing-spaces/m-p/7948642#M1601504</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-04T13:02:45Z</dc:date>
    </item>
  </channel>
</rss>

