Skip to Content
0

String truncates when reading the dataset into a variable of type string

Nov 22, 2016 at 06:27 AM

103

avatar image

Hi All,

I'm facing an issue when reading a file from the Application Server.

When reading the dataset into a variable, the values gets truncated after it crosses the length of 255 characters. I have put my code into Do -End do Loop where it reading the file correctly but misses out the values after the length reaches 255 characters.

Also Ive tried increasing the length of the variable to 1024 and beyond but still its not taking the missing values.

Please help. Thanks in Advance!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Christian Drumm
Nov 22, 2016 at 07:39 AM
0

Hi Swati,

have you tried searching for an answer to this question? It has been discussed already a number of times on the SCN.

http://lmgtfy.com/?q=abap+read+dataset+length+255

Best

Christian

Show 4 Share
10 |10000 characters needed characters left characters exceeded

Hi Christian,

I've tried searching and I see many similar posts but none of them have been answered.

Many of them saying that: "It reads the full record. You just can't see it all in debugging."

But its not the case, because when i display it as list output ,it shows truncated lines.

Would be great, If you can help me out on this..

Thanks

0

Hi Swati,

can you post the code or an except?

Christian

0

capture.pngHi Christian,

Attached is the piece of code.

The file contains the data but while reading the data in a variable of type string, since for the lines that contains length more than 255 characters, it is getting truncated.

So the variable lv_string captures the truncated values in line 95.

Looking for a response..

capture.png (12.5 kB)
0

Hi Swati,

take a look at this thread: https://archive.sap.com/discussions/thread/1194927

I would suspect that in your case it's also a problem with the encoding.

Christian

0