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: 

Problem with READ DATASET

Former Member
0 Kudos

Hi,

I am reading a file in text mode and each line has around 500char.My target object is 100ochar field but READ DATSET is reading only 256 bytes and missing some data from the line.

How to read a line which has 1000 char using read dataset.

My code is :

DATA:wa_fdata type BDI_LINE.

DATA: ifloc TYPE BDI_LINE-LINE "this is 1000char

READ DATASET i_floc INTO wa_fdata LENGTH len.

Thanks,

RP

13 REPLIES 13

Former Member
0 Kudos

TYPES: BEGIN OF gty_texts_file,

line(1000) TYPE c,

END OF gty_texts_file,

DATA: gt_text_file TYPE TABLE OF gty_texts_file,

0 Kudos

Hi Kesav,

Still I am getting only 256 char into target fieild.

Thanks.

Former Member
0 Kudos

Please search the forum. This (non) problem has been described many times.

Rob

0 Kudos

Hi Rob,

I searched forum for last two days and tried all the options like EDID2-SDATA and others.btw I work on 4.6c so some of the ALV related data elements doesn't exist in my system.finally I got this BDI_LINE.

Still READ data set is populating only 256 char into target field.

Thanks,

RP

0 Kudos

Hmmm... the search functionality doesn't seem to be working too well. I found nothing either.

Anyway, it's probably not a problem. READ DATASET works with records longer than 256 characters, but the debugger only shows the first characters. In the debugger, display:

your_field+256

This should be OK.

Rob

0 Kudos

Hi,

I knew That debugger shows only output length 0-255.After reading dataset I am splitting record and move to another set of fileds.the field data (i.e after 255th char) is showing incomplete data and rest of the fields after this field are blank.

Thanks for your time.

0 Kudos

Well, I still don't think it's a problem with READ DATASET. But it's hard to tell what the problem is without seeing your code.

Rob

0 Kudos

Hi Rob,

Could you clear a doubt for me..

If more than 255 characters get read from Dataset then why at the time of creating PDFs we split the data into chunks of 255 characters? Without doing this i have experienced that if u download the same data and save as pdf then it wont open..

0 Kudos

If it's a PDF file, you should be uploading and downloading in BINARY MODE.

Rob

0 Kudos

Hi Rob,

My code is :

DATA:wa_fdata type BDI_LINE.

DATA: i_floc TYPE BDI_LINE-LINE "this is 1000char

data:temp_var(10) TYPE c.

READ DATASET i_floc INTO wa_fdata LENGTH len.

Move w_fdata+250(10) TO temp_var.

In the file 250(10) is having 12456.8765.In debugger,temp_var and W_fdata+250(10) are showing only '12456.'.

Thanks,

RP

0 Kudos

Hi Rob,

I forgor one more point here.the field len in the above code is showing only 256 after reading dataset.

Thanks,

RP

0 Kudos

Hi RP,

If you are uploading the file as well then could you try to split the data in chuks of 255 characters and have a new_line indicator appended wherever ur line ends to recreate the same data at the time of download.

Also i will request you once to download a file from App server using CG3y and check the results..

Also if u have access then upload a file as such and see the result from App server.. u cud ask Basis to copy it for u..to see if the records are getting properly uploaded or not..

And yes Rob i uploaded PDF in Binary mode but still had to split the data.

Former Member
0 Kudos

Hi Rob,

Solved.

The problem was in file format.when I moved this file to appln server,format has been changed and ended with unexpected end of line.

No problem with read dataset.

Thanks for your time.