Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

OPEN DATASET in ECC6.0

Former Member
0 Likes
1,087

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

8 REPLIES 8
Read only

Former Member
0 Likes
994

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,

Read only

0 Likes
994

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

Read only

0 Likes
994

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

Read only

0 Likes
994

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

Read only

0 Likes
994

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.

Read only

Former Member
0 Likes
994

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

Read only

0 Likes
994

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

Read only

Former Member
0 Likes
994

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.