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

sy-subrc = 8 when looping through a table...

Former Member
0 Likes
24,570

i am looping one table and reading other.

now sy-subr = 8,it is showing what can be the reason.

Thanks in advance.

Edited by: Julius Bussche on Feb 24, 2009 10:50 AM

Subject title improved

9 REPLIES 9
Read only

Former Member
0 Likes
8,254

hi abhishek ,

sy-subrc = 8 means your criteria is wrong

thanks

Sachin

Read only

0 Likes
8,254

sorry,

my q was incomplete.

record is there ,i have written logic for sy-subrc = 0 as well as for 4 also.

but for 8 i have not written any logic becz i dint expect this situation,as i am using binary search may this is the problem.if y give me the reason.

Read only

Former Member
0 Likes
8,254

Hello

SY-SUBRC = 8:

No entry was read.

This return code only occurs with a SORTED TABLE or a STANDARD TABLE with the BINARY SEARCH addition. SY-TABIX is set to the number of all entries plus 1.

Read only

Former Member
0 Likes
8,254

why dont you put ur conditions for like.

if sy-subrc is initial.

and

if sy-subrc is not initial.

This way all the situations will b handeled. as table will be read only in case sy-subrc is inital.

regards

Palak

Read only

Former Member
0 Likes
8,254

Hi,

Check this,

SY-SUBRC = 0 At least one line was read.

SY_SUBRC = 4 No lines were read.

SY-SUBRC = 8 The search key was not fully qualified.

Read only

Former Member
8,254

If you are using binary search, make sure that the table is sorted.

Read only

Former Member
0 Likes
8,254

Hi

please check the search creteria you are using.is it valid on the given table.

sy-subrc =8 implies search criteria is not valid

Read only

Former Member
0 Likes
8,254

Hi Abhishek,

If the entry was determined with a binary search, and the end of the table was reached, then sy-tabix is set to the number of rows + 1.

Read only

keerthy_k
Product and Topic Expert
Product and Topic Expert
0 Likes
8,254

Hi,

If

sy-subrc = 4 No lines were read.

sy-subrc = 8 The search key was not fully qualified.

So u can add the logic for sy-subrc = 8 or u can change the logic as

if sy-subrc is initial.

....

else.

...

endif.

Keerthi.