Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2823

LINE_INDEX with SORTED table returns value > 0, but SY-TABIX = 0

$
0
0

Hello everybody,

 

I'm using table function LINE_INDEX to find a specific row within an internal table of type sorted with non-unique key (table type LE_T_DLV_HD_ADR).

The problem is, that the function returns a value greater than 0 (in the following example 2), but SY-TABIX is set to 0.

 

This is my test example:

DATA ls_delnote TYPE ledlv_delnote.
DATA lv_index TYPE i.
ls_delnote-hd_adr = VALUE #( ( deliv_numb = '0000000001'                                                           partn_role = 'AG' )                                                         ( deliv_numb = '0000000001'                                                            partn_role = 'WE' ) ).
CLEAR sy-tabix.
lv_index = line_index( ls_delnote-hd_adr[ deliv_numb = '0000000001'                                                                            partn_role = 'WE' ] ).
IF line_index( ls_delnote-hd_adr[ deliv_numb = '0000000001'                                                             partn_role = 'WE' ] ) > 0.  WRITE: / 'LV_INDEX:', lv_index.  WRITE: / 'SY-TABIX:', sy-tabix.
ENDIF.

 

The result is:

LV_INDEX:         2

SY-TABIX:          0

 

Why SY-TABIX is set to 0? We are using release 7.40 EHP7.

 

Thanks

Daniel


Viewing all articles
Browse latest Browse all 2823

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>