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 error

Former Member
0 Likes
2,745

Hello All,

Because of Upgradation we did unicode for this program but in Read dataset I am getting error.Could you pls help me in this issue.

Before unicode I am getting

YAR:14:13:##

15::##

After unicode I am getting

YAR:14:13:##

15::#

  • START OF INSERTION BY RV21012009

OPEN DATASET up_name IN TEXT MODE ENCODING DEFAULT FOR INPUT.

  • END OF INSERTION BY RV21012009

  • OPEN DATASET up_name. "RV21012009D

IF sy-subrc NE 0.

result = 1.

EXIT.

ENDIF.

DO.

READ DATASET up_name INTO tab_temse LENGTH up_len1.

IF up_len1 NE 0.

APPEND tab_temse.

ADD up_len1 TO up_len2.

ENDIF.

IF sy-subrc NE 0.

CLOSE DATASET up_name.

EXIT.

ENDIF.

ENDDO.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,242

Hi,

There may be a conversion problem while reading file.

Try to use a "tab_temse" which contains TEXT type fields only.

Hope this will help.

Issa

4 REPLIES 4
Read only

Former Member
0 Likes
1,242

Hi,

In stead of using ENCODING DEFAULT please use ENCODING UTF-8.

exmp.

OPEN DATASET up_name IN TEXT MODE ENCODING DEFAULT FOR INPUT.

OPEN DATASET up_name IN TEXT MODE ENCODING UTF-8FOR INPUT.

Hope this will solve your problem.

Read only

Former Member
0 Likes
1,243

Hi,

There may be a conversion problem while reading file.

Try to use a "tab_temse" which contains TEXT type fields only.

Hope this will help.

Issa

Read only

Former Member
0 Likes
1,242

Hi Suman,

I had also faced the same problem..


* to acheve this..

Genrally user put the files from desktop or ftp using unix command..

while they are copying file from desktop or ftp they paste in Binary mode..Ask them to Copy in TEXT MODE ...

if they copy in Binary mode # will appear in after every line ending...

See at the end of each line if # appears ask the end user to copy file in text mode..

'


OPEN DATASET up_name IN TEXT MODE ENCODING DEFAULT FOR INPUT.  "Use Binary mode and test

Regards,

Prabhudas

Read only

umashankar_sahu
Active Participant
0 Likes
1,242

hi Suman

in case of open dataset and read dataset, read dataset depends on on which mode file is opened .

in non unicode system no need to specify additional mode buy

in unicode system its must.

there is various way to write open dataset statement

OPEN DATASET file FOR OUTPUT IN TEXT MODE (UTF8, default, non-unicode).

or you can open in

IN BINARY MODE

IN LEGACY TEXT MODE

IN LEGACY BINARY MODE

points to be taken care

1. If the file was opened as a text file or as a legacy text file, the data is normally read from the current position of the file pointer to the next end-of-line marking, and the file pointer is positioned after the end-of-line marking. If the data object dobj is too short for the number of read characters, the superfluous characters and bytes are cut off. If it is longer, it will be filled with blanks to the right.

2. If the file was opened as a binary file or as a legacy-binary file, as much data is read that fits into the data object dobj. If the data object dobj is longer than the number of exported characters, it is filled with hexadecimal 0 on the right.

and also check the type of Up_name and tab_temse and check in transaction AL11 in which format its taking.