Handling conversion errors

by Sarveswararao Sombhatla, Yash Technologies

If a file on the application server contains special characters like © or ®. (as shown below)

The above screenshot contains special characters Ç and Ã.

If I use OPEN DATASET keyword to read a file from application server and move this to a database table , there are chances these might not get converted perfectly.

Below screen shot is an example how this might get read.

To avoid this kind of errors use the extension IGNORING CONVERSION ERRORS to the OPEN DATASET statement.

Example:

DATA g_filename TYPE string VALUE 'D:/test.txt'.

OPEN DATASET g_filename FOR INPUT IN TEXT MODE ENCODING DEFAULT IGNORING CONVERSION ERRORS.

READ DATASET g_filename INTO g_chr.
IF sy-subrc EQ 0.
  CLOSE DATASET g_filename.
ENDIF.

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image