Application Development 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: 

Open Dataset non-unicode & default

Former Member
0 Kudos

Currently i am using the open dataset with default then it hit a codepage error. I found out that the file contained characters that is not UTF-8 so when i changed the open dataset to non-unicode the codepage error goes away. I am wondering if there is any effect of changing from default to non-unicode.

Moderator Message: Please continue your discussion in your previous thread instead of creating a new one each time or please close your previous threads.

Message was edited by: Kesavadas Thekkillath

1 REPLY 1

Former Member
0 Kudos

Hi,

Non-unicode will read the data from file without any conversion. However if you use the non-unicode extension and file contain characters which is unicode then the problem would arise.

Hence my suggestion is check whether the file has encoded using UTF8 before opening the dataset in non-unicode mode. This will ensure the future enhancements not going wrong.

First step, use method check_utf8 of class cl_abap_file_utilities to check whether the file in question is encoded using UTF-8, if not, then go for non-unicode extension, else go for default code page reading. Also note that if file is encoded using UTF-16, then you can only read file in byte order.

Also you can think of getting the code page used for file generation and use the code page extension in open dataset instruction. For this you might be needing Basis help for checking the code pages available in TCP00.

Note: It is always advisable to have encoding extension for open dataset in text mode instruction in uni-code system. If you don't know the non-unicode code page execute GET_CURRENT_NONUNI_CODEPAGE method of cl_abap_file_utilities.

Hope this helps.

Regards,

Manjesh.