getting ABAP dump CONVT_CODEPAGE in ECC 6.0
While reading data from Unix file it is giving dump
I feel while transfering into Unix the data should be converted
how to convert the data?
The pseudo code is as shown below,
OPEN DATASET OUTFILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
CHECK SY-SUBRC = 0.
loop at internale table.
transfer <internal table values> to outfile.
endloop.
CLOSE DATASET OUTFILE.
OPEN DATASET infile FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc <> 0.
WRITE: / 'Could not open input file ', infile.
STOP.
ENDIF.
do.
READ DATASET infile INTO <workarea>.
enddo.
CLOSE DATASET infile.
Hello Sreedevi
Using static methods
CHECK_FOR_BOM CHECK_UTF8
of class <b>CL_ABAP_FILE_UTILITIES</b> you should be able to find out the encoding of your Unix file (UTF16, little endian / big endian).
If the problem is indeed that the file is UTF16 whereas the OPEN DATASET expects UTF-8 you probably have to use class <b>CL_ABAP_CONV_IN_CE</b> (<i>Codepage & Endian conversion; External -> system format</i>).
I would assume that you need to read the file IN BINARY MODE and then use the method of the converter class to retrieve the appropriate encoding.
Finally, have a look at the blog
<a href="/people/ulrich.brink/blog/2005/08/18/unicode-file-handling-in-abap File Handling in ABAP</a>
Perhaps you will find another solution there.
Regards
Uwe
Add a comment