Skip to Content
1
Jun 16, 2022 at 08:07 AM

SY-SUBRC EQ '8' for a SORTED Internal Table even though the record is READ - Table Expressions.

296 Views Last edit Jun 16, 2022 at 11:20 AM 2 rev

Hello ABAP Gurus,

My query is regarding the below snapshot from help.sap.com for READ Table and the SY-SUBRC.

capture.png

With the information for SY-SUBRC EQ '8' , I could conclude that even if the record is found and it was determined because of Binary Search then also SY-SUBRC could be set to '8'. Then why it's mentioned here 'Like sy-subrc equals 4' ? SY-SUBRC '4' is for Row not found and how we can relate these two in such cases. Please correct if I am wrong here.

Now I will highlight my below case, even though am not making use of SY_SUBRC for handling my case and using cx_sy_itab_line_not_found instead for safer side.

I have an SORTED Internal Table 'T_PROXYID_NR' with Key VBELN

capture-01.png

Now for the below READ query, Data is present in the above Internal Table and it is successfully hit as well, then why it's SY-SUBRC '8' is my question. <LFS_FILE_DATA>-VBELN is 8000256664 here.

capture-02.png

Does this mean that SY-SUBRC '8' is for denoting that for cases of SORTED Internal Table Binary Search was applied implicitly and the Record has been successfully retrieved(just like SY-SUBRC 0)?

I searched for this and the information many have mentioned is SY-SUBRC 8 means Binary Search failed because of wrong search criteria. But here everything is fine.

Helpful comments much appreciated.

Thanks,

Sijin

Attachments

capture.png (283.8 kB)
capture-01.png (67.8 kB)
capture-02.png (190.0 kB)