<?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 Re: Creating a Fixed Length File in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-fixed-length-file/m-p/3242312#M773861</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ABAP statement TRANSFER has an addition LENGTH that can be used to specify the width of the line.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Jan 2008 19:26:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-15T19:26:45Z</dc:date>
    <item>
      <title>Creating a Fixed Length File</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-fixed-length-file/m-p/3242308#M773857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;I'm creating an application that need to create a fixed length file on a UNIX system and need help. I have an internal table(s) which contain structures with fields of different lengths (type c) and so I have a routine that concatenates these fields into a single record to be sent to a file using the open dataset. This process is squeezing out all my spaces and so my fixed length file is lost. Can someone assist in creating a fixed length file from an internal table without using delimiters?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2008 15:48:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-fixed-length-file/m-p/3242308#M773857</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-15T15:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Fixed Length File</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-fixed-length-file/m-p/3242309#M773858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joseph,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please read the online help on CONCATENATE statement and you will find that it is designed to remove spaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your internal table structure contains only text fields, then just don't concatenate individual fields. Just output the entire record to the file like below. Then you will get a file of fixed width.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRANSFER itab_header TO dataset.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2008 16:02:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-fixed-length-file/m-p/3242309#M773858</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-15T16:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Fixed Length File</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-fixed-length-file/m-p/3242310#M773859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Data : begin of itab.
        Field1(1) type c,
        Field2(2) type c.,
        Field3(3) type c,
        Field4(4) type c.
Data : end of itab.

Data : begin of itab1 occurs 0.
        Field(20) type c.
Data : end of itab1.

Loop at itab.
     Move itab to itab1.
     Append itab1.
Endloop.

Open dataset  ........

Loop at itab1.
   Transfer itab1 TO dataset.
Endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2008 16:11:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-fixed-length-file/m-p/3242310#M773859</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2008-01-15T16:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Fixed Length File</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-fixed-length-file/m-p/3242311#M773860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This seems work only if my table record has a value of some kind in the last field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So to use your example if Field1 and Field4 has data my fixed lengths are preserved however if only Field1 has data and 2,3,4 are empty then record ends right after Field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2008 19:12:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-fixed-length-file/m-p/3242311#M773860</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-15T19:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Fixed Length File</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-fixed-length-file/m-p/3242312#M773861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ABAP statement TRANSFER has an addition LENGTH that can be used to specify the width of the line.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2008 19:26:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-fixed-length-file/m-p/3242312#M773861</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-15T19:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Fixed Length File</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-fixed-length-file/m-p/3242313#M773862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
" May be placing a carriage return end of each records 
" will solve your problem

class cl_abap_char_utilities definition load.
data : begin of itab,
        field1(1) type c,
        field2(2) type c,
        field3(3) type c,
        field4(4) type c,
crlf(2) type c value cl_abap_char_utilities=&amp;gt;cr_lf. "&amp;lt;&amp;lt;&amp;lt;See this line&amp;lt;&amp;lt;&amp;lt;
data : end of itab.

Data : begin of itab1 occurs 0.
        Field(20) type c.
Data : end of itab1.

Loop at itab.
     Move itab to itab1.
     Append itab1.
Endloop.

Open dataset  ........

Loop at itab1.
   Transfer itab1 TO dataset.
Endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2008 19:50:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-fixed-length-file/m-p/3242313#M773862</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2008-01-15T19:50:28Z</dc:date>
    </item>
  </channel>
</rss>

