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: 

CX_SY_CONVERSION_CODEPAGE - Error when reading from file in unix directory

Former Member
0 Kudos

Hi

We have a custom report which reads data from a file put in the unix directory. This report has been running for good 3 years now without any code changes.

For a few days the report is dumping with the following error

CX_SY_CONVERSION_CODEPAGE

Short text

Character set conversion is not possible.

What happened?

When converting a text from code page '4110' to code page '4102',

the system either

- encountered a character which cannot be represented in one of

the two code pages; or

- found that this type of conversion is not supported.

The code where the dump occurs is:

  • load the file from the given path

OPEN DATASET p_p_lfdata FOR INPUT IN TEXT MODE ENCODING DEFAULT WITH SMART LINEFEED.

IF sy-subrc EQ 0.

DO.

>>>>>>>> READ DATASET p_p_lfdata INTO l_rec. " Dump occurs here

IF sy-subrc = 0.

I understand this error is thrown in the OPEN DATASET statements in case of non-unicode compliance, but this statement does not throw an error while the READ DATASET statement does..... Any particular reason why the READ statement is failing even though OPEN is successful???

1 ACCEPTED SOLUTION

nils_buerckel
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

you open the according file in DEFAULT mode. I assume you do this on a Unicode system.

Then the program assumes that the file is encoded in UTF-8 (SAP number 4110).

Now it seems that the file contains some characters, which are not encoded in UTF-8.

I would propose to investigate the code page, on which the file is created.

Ideally this should be UTF-8. If this is not the case, try to change it.

If this is not possible, then adapt the ABAP program (e.g. use Non-Unicode mode).

Best regards,

Nils Buerckel

3 REPLIES 3

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Vik,

A couple of questions:

1. Who/what is the source of this file? Can you check with the source if something has changed at their end?

2. Is this exception generated for all the files read or for a specific file?

Br,

Suhas

Former Member
0 Kudos

Hi Suhas

the files are generated by a datastage teeam and xcommed to the UNIX directory. We are certain that there is no change in process from there end.

This is happening for files read by this program only. Could be due to some special characters unneccessarily added in the file?

nils_buerckel
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

you open the according file in DEFAULT mode. I assume you do this on a Unicode system.

Then the program assumes that the file is encoded in UTF-8 (SAP number 4110).

Now it seems that the file contains some characters, which are not encoded in UTF-8.

I would propose to investigate the code page, on which the file is created.

Ideally this should be UTF-8. If this is not the case, try to change it.

If this is not possible, then adapt the ABAP program (e.g. use Non-Unicode mode).

Best regards,

Nils Buerckel