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

Former Member
0 Likes
621

Hi Friends,

I have a simple question, I have read the documents but couldn't find documentation.

While I am reading dataset using

DATA WA_DATASET(1).
OPEN DATASET D1 FOR INPUT.
OPEN DATASET D2 FOR OUTPUT. 
DO.
   READ DATASET D1 INTO WA_DATASET.
   TRANSFER WA_DATASET TO D2.
   IF SY-SUBRC <> 0.
     EXIT.
   ENDIF.
ENDDO.
CLOSE DATASET D1.
CLOSE DATASET D2.

As seen above I am copying file. And my WA_DATASET length is 1. If I change this length to 1000, dataset D2 is not desired format. I mean that d2 is not true file. So, I am using the lentgth 1. In documentation legth is defined as 80. Is there a specific reason for 80? Or, what is the maximum size this lentgth to supply real copying operation.

Thanks.

4 REPLIES 4
Read only

Former Member
0 Likes
548

Hi,

The max. length is 255 characters. Please change from 1000 to 255 & it should work.

Best regards,

Prashant

Read only

former_member404244
Active Contributor
0 Likes
548

Hi,

max length is 255 characters.

Regards,

Nagaraj

Read only

0 Likes
548

Hi again,

What is the logic of 255? And why there is error in my file when length is 1000?

I want to learn the logic of READ DATASET and TRANSFER.

When it is reading 1000, it is writing 255?

Thanks.

Read only

0 Likes
548

I mean that, why I am getting when th length is 1000? How can I believe in this length should be smaller than 255? If length is 1000 'sometimes' my file is bad, but sometimes it is true. When length is 1000, where is the error? Can you explain the logic of read and transfer based on length.

Thanks.