<?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: File transfer using Code page in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-transfer-using-code-page/m-p/1104941#M104476</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In general you can make something like the following(extend SAP-help):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data:
  begin of STRUC2,
    F1 type c,
    F2(20) type c,
  end of STRUC2.

* Put data into text format
move-corresponding STRUC to STRUC2.

* Write data to file
open dataset DSN in text mode for output encoding utf-8.
transfer STRUC2 to DSN.
close dataset DSN.

* Read data from file
clear STRUC.
open dataset DSN in text mode for input encoding utf-8.
read dataset DSN into STRUC2.
close dataset DSN.
move-corresponding STRUC2 to STRUC.
write: / STRUC-F1, STRUC-F2.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;The textual storage in UTF-8 format ensures that the created files are platform-independent. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case 2: Old non-Unicode format must be retained&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
* Write data to file
open dataset DSN in legacy text mode for output.
transfer STRUC to DSN.
close dataset DSN.

* read from file
clear STRUC.
open dataset DSN in legacy text mode for input.
read dataset DSN into STRUC.
close dataset DSN.
write: / STRUC-F1, STRUC-F2.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the LEGACY TEXT MODE ensures that the data is stored and read in the old non-Unicode format. In this mode, it is also possible to read or write non-character-type structures. However, be aware that data loss and conversion errors can occur in Unicode systems if there are characters in the structure that cannot be represented in the non-Unicode codepage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of legacy text mode you can define a specific codepage. Have a look in table TCP00 for available codepages in SAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Oct 2005 16:42:55 GMT</pubDate>
    <dc:creator>christian_wohlfahrt</dc:creator>
    <dc:date>2005-10-25T16:42:55Z</dc:date>
    <item>
      <title>File transfer using Code page</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-transfer-using-code-page/m-p/1104940#M104475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please provide me some sample program how to use "code page" statement in "READ OPENDATASET" command to create/modify the application server files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Thayalan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Oct 2005 14:34:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-transfer-using-code-page/m-p/1104940#M104475</guid>
      <dc:creator>former_member280027</dc:creator>
      <dc:date>2005-10-25T14:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: File transfer using Code page</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-transfer-using-code-page/m-p/1104941#M104476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In general you can make something like the following(extend SAP-help):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data:
  begin of STRUC2,
    F1 type c,
    F2(20) type c,
  end of STRUC2.

* Put data into text format
move-corresponding STRUC to STRUC2.

* Write data to file
open dataset DSN in text mode for output encoding utf-8.
transfer STRUC2 to DSN.
close dataset DSN.

* Read data from file
clear STRUC.
open dataset DSN in text mode for input encoding utf-8.
read dataset DSN into STRUC2.
close dataset DSN.
move-corresponding STRUC2 to STRUC.
write: / STRUC-F1, STRUC-F2.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;The textual storage in UTF-8 format ensures that the created files are platform-independent. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case 2: Old non-Unicode format must be retained&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
* Write data to file
open dataset DSN in legacy text mode for output.
transfer STRUC to DSN.
close dataset DSN.

* read from file
clear STRUC.
open dataset DSN in legacy text mode for input.
read dataset DSN into STRUC.
close dataset DSN.
write: / STRUC-F1, STRUC-F2.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the LEGACY TEXT MODE ensures that the data is stored and read in the old non-Unicode format. In this mode, it is also possible to read or write non-character-type structures. However, be aware that data loss and conversion errors can occur in Unicode systems if there are characters in the structure that cannot be represented in the non-Unicode codepage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of legacy text mode you can define a specific codepage. Have a look in table TCP00 for available codepages in SAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Oct 2005 16:42:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-transfer-using-code-page/m-p/1104941#M104476</guid>
      <dc:creator>christian_wohlfahrt</dc:creator>
      <dc:date>2005-10-25T16:42:55Z</dc:date>
    </item>
  </channel>
</rss>

