2008 Aug 29 12:40 PM
The code is:
READ TABLE gt_findpartners WITH KEY
z3isptrxtyp = wa_z3isp_inv_conv-z3isptrxtyp
z3ispordno = wa_z3isp_inv_conv-z3ispordno
BINARY SEARCH TRANSPORTING NO FIELDS.
Odd because at one time I believe the code was working fine, not sure vwhat I could have changed to stop this from working. But the rec is definitely in the tab it is reading and I get a sy-sub = 4.
Thank-You
2008 Aug 29 12:45 PM
Hi,
Remove the Binary Search.....
It will work...
Regards,
Kunjal
Hi,
Remove the Binary Search.....
It will work...
Regards,
Kunjal
2008 Aug 29 12:41 PM
When using binary search you need to sort the table on the fields you are using as a key.
2008 Aug 29 12:41 PM
check whether you have sorted gt_findpartners by z3isptrxtyp and
z3ispordno
if not sort it before reading it using binary search.
2008 Aug 29 12:42 PM
The table is not sorted. Binary search is failing because of that.
2008 Aug 29 12:42 PM
Hello,
To use the binary search you need to have a sorted table by the keys that you want to search.
Regards.
2008 Aug 29 12:42 PM
Ignore, if you already used the SORT on the key fields.
It is always must to sort the table before binary search.
SORT gt_findpartners by z3isptrxtyp z3ispordn.
READ TABLE gt_findpartners WITH KEY
z3isptrxtyp = wa_z3isp_inv_conv-z3isptrxtyp
z3ispordno = wa_z3isp_inv_conv-z3ispordno
BINARY SEARCH TRANSPORTING NO FIELDS.
2008 Aug 29 12:45 PM
Hi,
Remove the Binary Search.....
It will work...
Regards,
Kunjal
2008 Aug 29 12:53 PM
I hope your would have sorted the internal table if not sort it by the key fields.
If the addition TRANSPORTING NO FIELDS is used, the statement READ TABLE only checks whether the line that is being searched for exists, and fills the system field sy-subrc and sy-tabix. The system can then no longer access the content of the found fields.
So if you get sy-subrc eq 4 that record is not available in the internal table.
they record in the itab might have a prefix zero's or the value you r passing might have so it would result sy-subrc eq 4.
Thanks,
Karthik
2008 Aug 29 12:55 PM
Hi,
READ TABLE gt_findpartners WITH KEY
z3isptrxtyp = wa_z3isp_inv_conv-z3isptrxtyp
z3ispordno = wa_z3isp_inv_conv-z3ispordno
BINARY SEARCH TRANSPORTING NO FIELDS.Once remove binary search and check the sy-subrc value,
if sy-subrc value is 0 then sort the table before read as all said.
Regards
Adil
2008 Aug 29 1:07 PM
Hi,
Binary Search can be used only once the sorting is performed in the internal table . sort the internal table or remove the binary search while reading.
Regards
Nanda Kishore
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |