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

READ DATASET failure

Former Member
0 Likes
2,678

Hello all,

I have some problem with the below statements. Please help me.

PARAMETERS: P_FILE(100) TYPE C LOWER CASE. "input file ( this is of text file .txt)

DATA: LV_FILE(200) TYPE C.

DATA: LV_STRING(2055) TYPE C.

LV_FILE = P_FILE. "Input File

OPEN DATASET LV_FILE FOR INPUT IN TEXT MODE MESSAGE LV_DS_MSG ENCODING DEFAULT WITH SMART LINEFEED.

READ DATASET LV_FILE INTO LV_STRING.

After, READ DATASET statement program is going for short dump. saying some character conversion issue.

Please help me.

Regards,

Venkat

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,804

Hi ,

try changing the ENCODING to NON-UNICODE and check.

Some character in your file has some problem with the UNICODE conversion, either you can change the READ dataset statement as below.

OPEN DATASET LV_FILE FOR INPUT IN TEXT MODE MESSAGE LV_DS_MSG ENCODING NON-UNICODE WITH SMART LINEFEED.

This will not convert the characters to UNICODE format

OR

OPEN DATASET LV_FILE FOR INPUT IN TEXT MODE ENCODING DEFAULT IGNORING CONVERSION ERRORS WITH SMART LINEFEED.

This will make sure it is in UNICODE format but will ignore the conversion errors.

Hope this helps.

Regards,

Praveenkumar T.

5 REPLIES 5
Read only

Former Member
0 Likes
1,805

Hi ,

try changing the ENCODING to NON-UNICODE and check.

Some character in your file has some problem with the UNICODE conversion, either you can change the READ dataset statement as below.

OPEN DATASET LV_FILE FOR INPUT IN TEXT MODE MESSAGE LV_DS_MSG ENCODING NON-UNICODE WITH SMART LINEFEED.

This will not convert the characters to UNICODE format

OR

OPEN DATASET LV_FILE FOR INPUT IN TEXT MODE ENCODING DEFAULT IGNORING CONVERSION ERRORS WITH SMART LINEFEED.

This will make sure it is in UNICODE format but will ignore the conversion errors.

Hope this helps.

Regards,

Praveenkumar T.

Read only

0 Likes
1,804

Hi all,

Thanks for giving valuable input . it's working fine now.

Regards,

Venkat

Read only

Former Member
0 Likes
1,804

Hi,

I don't think there is nothing wrong with your statement. Just check the input file content.

If you want to by pass this error use IGNORING CONVERSION ERRORS to your OPEN DATASET statement.

Regards,

Aravind.

Read only

0 Likes
1,804

Hi

I think you are facing special char issue.

check this link to deal with this

http://forums.sdn.sap.com/thread.jspa?threadID=1679354

Read only

Former Member
0 Likes
1,804

What is Encoding?

<< Moderator message - Cut and paste response from a blocked site removed and points unassigned. Plagiarism is not allowed in SCN >>

Edited by: Rob Burbank on Feb 22, 2012 1:08 PM