2008 Mar 16 7:21 PM
Hi Guys,
We are upgrading from 4.6c to ECC 6.0 and a lot of our programs are giving unicode compliance error on the OPEN DATASET statement. Even though we are moving to a unicode system, the systems we talk to are not unicode compliant yet so we donot want to read/write files in unicode format yet. After a lot of research I am still consfused between the following 2 statements. Which one should we use?
OPEN DATASET O_DSN FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE
OR
OPEN DATASET O_DSN FOR OUTPUT IN LEGACY TEXT MODE.
Does anyone know if they are any different or both serve the same purpose?
We basically want to retain the same functionality as was in 4.6c when it comes to read/write files...
Please suggest
Thanks,
Sanket
Hi Guys,
We are upgrading from 4.6c to ECC 6.0 and a lot of our programs are giving unicode compliance error on the OPEN DATASET statement. Even though we are moving to a unicode system, the systems we talk to are not unicode compliant yet so we donot want to read/write files in unicode format yet. After a lot of research I am still consfused between the following 2 statements. Which one should we use?
OPEN DATASET O_DSN FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE
OR
OPEN DATASET O_DSN FOR OUTPUT IN LEGACY TEXT MODE.
Does anyone know if they are any different or both serve the same purpose?
We basically want to retain the same functionality as was in 4.6c when it comes to read/write files...
Please suggest
Thanks,
Sanket
2008 Mar 17 1:27 AM
You should be using ,
LEGACY BINARY MODE , if file you create is binary
or
LEGACY TEXT MODE, if you want to create a text file.
Thanks,
2008 Mar 17 3:46 AM
Hi Vaibhav,
Thanks for the prompt reply...Can you tell me what the difference between the 2 is and how you reached this conclusion?
Thanks,
Sanket
2008 Mar 17 4:00 AM
IN LEGACY BINARY MODE [CODE PAGE cp]
Data is read or written in a form which is compatible to BINARY MODE in Releases <= 4.6. This addition is primarily used to convert a file into the code page format specified already when it is opened. At runtime, the system uses the format of the system code page of the application server. The system saves the file then again in the code page specified. This procedure is important if data is exchanged between systems using different code pages.
IN LEGACY TEXT MODE [CODE PAGE cp]
Data is read or written in a form which is compatible to BINARY MODE in Releases <= 4.6. This addition is primarily used to convert a file into the code page format specified already when it is opened. At runtime, the system uses the format of the system code page of the application server. The system saves the file then again in the code page specified. This procedure is important if data is exchanged between systems using different code pages.
For more information, check the below link.
[http://www.s001.org/ABAP-Hlp/abapopen_dataset.htm|http://www.s001.org/ABAP-Hlp/abapopen_dataset.htm]
Hope this helps.
Thanks,
Balaji
2008 Mar 17 4:54 AM
HI Balaji,
I have read the documentation from SAP which you have sent me but am not able to decide the difference if any between the 2 statements and which one to choose for my purpose...
Please let me know if you have any other documentation..
Thanks,
Sanket
2008 Mar 25 11:58 PM
Binary Mode creates Binary file and Text Mode creates Text file . Text file is a file which you can read easily in notepad. Most of the time Text File is used .
I hope this answers the question.
*Reward Points.
2008 Mar 17 4:56 AM
hi ,
After opening the dataset, specify the encoding format. There are three types of Encoding
format.
on ENCODING (DEFAULT|UTF-8|NON-UNICODE)
This addition specifies the character representation in the file:
DEFAULT
Corresponds to UTF-8 in Unicode systems and to NON-UNICODE in non-Unicode systems.
UTF-8
Characters are represented in the file in the format UTF-8.
NON-UNICODE
Characters are represented in the file in the code page defined by the text environment current at the
time a READ or TRANSFER command is executed
Thanks,
VV
2008 Mar 17 4:59 AM
Hi Vaishnavi,
I have read the SAP documentation but am a little confused on if there is any difference between the 2 statements. Please let me know if you are aware of any differences between the 2 statements or if you are confident that they are the same...
Thanks,
Sanket
2008 Mar 17 5:45 AM
Hi,
Use below statement:
OPEN DATASET <filename> FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
> we are also using the same statement for upgradation(4.6> ECC 6.0) and it will work without any error and also do not effect the existing functionality.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |