read之前一定要排序,按照read的KEY字段进行排序,否则就可能取不到。 READ 不加BINARY SEARCH的取数逻辑, 其实是取第一笔数据
ABAP READ TABLE使用BINARY SEARCH如题,read table使用binary search,with key有多个字段的时候,寻找数据的内部逻辑是怎样的比如有内表(按A,B已排好序)T_DATAA B C1 1 11 2 22 1 32 2 42 3 53 1 63 2 73 3 8现在用如下语句查找READ TABLE T_DATA INTO W_DATA WITH KEY A='2' B = '3' BINA...
在做二分查找之前,需要先对内表以查找的字段顺序进行升序排序,也就是说,在你的例子中用二分查找之前要对内表按A、B的顺序进行排序,即 SORT T_DATA[] BY A B ASCENDING.否则不一定能查找到正确的确结果
2Likesy-subrcequals 0. Distinguishes cases that use the additionCOMPARINGinresult. 4The row was not found. If the entry was determined using a binary search,sy-tabixis set to the table index of the entry before which it would be inserted usingINSERT ... INDEX ..., to preserve the sort...
1.for standard table, it must be sorted by search key.2.for sorted table , binary search is used automatically when searching with/include table key.N
SAP Managed Tags: ABAP Development Hi, I have the following issue: From a table, I am picking up 5 fields into an internal table (in the correct sequence): A B C D E. Now, I am sorting the above internal table as follows: sort itab by A B C descnding. Now, I am writing ...
The method READ_BINARY_SEARCH_CHECK of the classCL_ABAP_ITAB_UTILITIEScan be used to verify whether the required sort exists for the additionBINARY SEARCH. When the additionBINARY SEARCHis used, if there are multiple hits (due to an incomplete search key or duplicate entries in the table),...
(Binary Search) reward if useful Reply Former Member 2007 Oct 29 6:19 AM 0 Kudos 215 SAP Managed Tags: ABAP Development Hi 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 sys...
ABAP Development, SAP NetWeaver Application Server, FIN (Finance), SAP Business Workflow Hello, I have a requirement to read the same table twice in the same loop with different keys. Here i am using the binary search, But how should be my sort statement - in which order. Please help ...
Solved: Hi all, I have been reading through the ABAP 740 read table statements. Questions: I have a ztable with field1 to field10 with only field1 as primary key. 1) I