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 PROBLEM

Former Member
0 Likes
609

Hi all,

Using the code to read file data

DATA : Len type i,

str_name type string.

READ DATASET name INTO str_name LENGTH len .

but it only reads first 155 characters i.e. length is always 155 not more that that but as per requirement wants to read more that 155 charcters.

Any suggestions welcome,

Regards,

5 REPLIES 5
Read only

Former Member
0 Likes
584

hi,

Check out if it works by removing LENGTH.

i.e,


READ DATASET name INTO str_name .

Regards,

Santosh

Read only

0 Likes
584

Still problem exist.....

1) Checked after removing len

2) Make it TYPE char512

Read only

former_member156446
Active Contributor
0 Likes
584

DO.

READ DATASET p_ufile INTO in_file.

IF sy-subrc <> 0.

EXIT.

ENDIF.

APPEND in_file.

CLEAR in_file.

ENDDO.

Read only

Former Member
0 Likes
584

Hi Navdeep,

use the following declarations:

data:

str_name type char512,

name type sxpgcolist-parameters.

This should solve the problem..

Thanks

Vijay

PLZ reward points if helpful

Read only

Former Member
0 Likes
584

READ for Files

Reads a file.

Syntax

READ DATASET <dsn> INTO <f>

[MAXIMUM LENGTH <maxlen>]

[ACTUAL LENGTH <len>].

Reads the contents of the file <dsn> on the application server to the variable <f>. The amount of data can be specified using MAXIMUM LENGTH. The number of bytes transferred can be written to <len> using ACTUAL LENGTH.

Regards,

Priya.