2007 Jun 14 2:04 AM
Hi,
In ECC 6.0 the following error is coming while reading data from Unix file.
<b>Runtime Errors CONVT_CODEPAGE
Except. CX_SY_CONVERSION_CODEPAGE
The termination is caused because exception "CX_SY_CONVERSION_CODEPAGE"
occurred in
procedure "GET_DATA_FROM_UXFILE" "(FORM)", but it was neither handled locally
nor declared
in the RAISING clause of its signature.</b>
The program logic for opening dataset and reading is as shown below, dump is coming while reading dataset.
OPEN DATASET INFILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.
DO.
READ DATASET INFILE INTO WA_workarea .
ENDDO.
Do we need to change the read command to avoid this dump in ECC 6.0?
Thanks,
Sreedevi
Hi,
In ECC 6.0 the following error is coming while reading data from Unix file.
<b>Runtime Errors CONVT_CODEPAGE
Except. CX_SY_CONVERSION_CODEPAGE
The termination is caused because exception "CX_SY_CONVERSION_CODEPAGE"
occurred in
procedure "GET_DATA_FROM_UXFILE" "(FORM)", but it was neither handled locally
nor declared
in the RAISING clause of its signature.</b>
The program logic for opening dataset and reading is as shown below, dump is coming while reading dataset.
OPEN DATASET INFILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.
DO.
READ DATASET INFILE INTO WA_workarea .
ENDDO.
Do we need to change the read command to avoid this dump in ECC 6.0?
Thanks,
Sreedevi
2007 Jun 14 2:19 AM
Code seems correct.
Can you check the format of the unix file and workarea are same ??
In ABAP docu it is mentioned that this error is due to some conversion.
<b>CX_SY_CONVERSION_CODEPAGE
Cause: Conversion is not possible. The data is read as far as possible; text data for which the conversion did not take place is undefined (see also note below)
Runtime Error: CONVT_CODEPAGE (catchable)</b>
2007 Jun 14 2:25 AM
I think file has special charcters and when you move the data from file to wa area ,program does not understand the special charcter
try to copy manually and see the results ( use CG3Y Transaction )
2007 Jun 14 2:37 AM
Unix file is declared as
data: infile LIKE rlgrap-filename DEFAULT 'C:\'.
<u>workarea</u> as
types: begin of ty_workarea,
char1(10) type c,
char2(30) type c,
char3(40) type c,
end of ty_workarea.
data: wa_workarea type ty_workarea.
2007 Jun 14 2:40 AM
Hi Sridevi,
There is something wrong with the defination.
Just change your code as below.
OPEN DATASET INFILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.
<b>if sy-subrc NE 0.
Message e000(su) 'Error in opening file'.
endif.</b>
DO.
READ DATASET INFILE INTO WA_workarea .
ENDDO.
Now see what the result is?
Reward points if useful.
Regards,
Atish
2007 Jun 14 2:44 AM
Hi Atish,
thanks for your reply. But I am coding in the same way what you mentioned.
2007 Jun 14 2:47 AM
Hi Sridevi,
Can you just paste your whole code.
And regarding checking the special characters, just ask your basis to download the file for you on presentation server and then look at the file.
Also check the length of each line in the file, it should be same as of your work area.
Reward points if useful.
Regards,
Atish
2007 Jun 14 2:35 AM
Hi Sreedevi,
there may be possibilities that the workarea you are using for reading the input file is of not same type.
Just check if the work area is long enough, or try to use work area of type string.
Also check if the file has special characters which may be causing the dump.
Reward points if useful.
Regards,
Atish
2007 Jun 14 2:39 AM
2007 Jun 14 3:00 AM
use AL11 Transaction or CG3Y trsanction here specify to and from
2007 Jun 14 3:11 AM
I think syntax Open dataset option ENCODING DEFAULT in unicode system expects a file in UTF-8 encoding.
It's dumping because read dataset failed to convert a character in the fil to UTF-16.
You need to convert to UTF-16 before transfer
try.
call method cl_abap_conv_in_ce=>create
exporting
encoding = gv_encoding
endian = gv_endian
replacement = '#'
receiving
conv = conv_obj.
call method conv_obj->convert
exporting
input = gv_xstr
n = -1
importing
data = gv_str.
catch cx_root.
message 'Error during conversion' type 'E'.
endtry.
aRs