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 statement

Former Member
0 Likes
1,518

Hi,

I encountered sy-subrc 8 in READ statement.

Can anybody please tell me how to correct it?

Thank you..

12 REPLIES 12
Read only

SimoneMilesi
Active Contributor
0 Likes
1,233

Read what?

A File? An internal table?

Read only

0 Likes
1,233

Internal table

Read only

0 Likes
1,233

hi,

if your read statement for an internal table is setting the value of sy-subrc as 8 it means that the READ was not successful.

May be you have used BINARY SEARCH addition but your internal table is not sorted properly by the fields as specfied in the binary search.

There can be other reasons too.

Can you share your READ statement?

Regards,

Ankur Parab

Read only

Former Member
0 Likes
1,233

Hi ,

Before read statement you have to first sort the internal table and after sorting only you need to use read ststement with binary search.

Please let me know if you still need any help.

Thanks and regards,

Rajeshwar.

Read only

Former Member
0 Likes
1,233

Hi,

Sy-subrc = 8 means that no data was read.. Please check that you have specified the correct keys and if you are using the addition BINARY SEARCH.. You are sorting with the same field as mentioned in the read statment...

Read only

0 Likes
1,233

But my internal table has 1157 records,1013records are read properly but after that it is giving me sy-subrc value 8.

Read only

0 Likes
1,233

Hi,

may be the data does not satisfy your read criteria.. But, sy-subrc = 8 is returned if you ahve used BINARY SEARCH in the read statment and have sorted teh table with different key or have not sorted it at all..

Please do these changes and test again..

Read only

0 Likes
1,233

Hi,

If you have used some key fields in the read statement then they are not matching.

Can you show your READ statement.

Regards,

Ankur Parab

Read only

Former Member
0 Likes
1,233

You sort your internal fields on key fields and then read with following syntax -

READ table with KEY ..BINARY SEARCH.

Read only

Former Member
0 Likes
1,233
Read only

Former Member
Read only

Former Member
0 Likes
1,233

Thank you all!!