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

ABAP dump CONVT_CODEPAGE in ECC 6.0

Former Member
0 Likes
6,138

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

10 REPLIES 10
Read only

Former Member
0 Likes
2,713

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>

Read only

Former Member
0 Likes
2,713

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 )

Read only

0 Likes
2,713

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.

Read only

0 Likes
2,713

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

Read only

0 Likes
2,713

Hi Atish,

thanks for your reply. But I am coding in the same way what you mentioned.

Read only

0 Likes
2,713

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

Read only

Former Member
0 Likes
2,713

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

Read only

0 Likes
2,713

how to check whether file has special characters?

Read only

0 Likes
2,713

use AL11 Transaction or CG3Y trsanction here specify to and from

Read only

former_member194669
Active Contributor
0 Likes
2,713

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