Hi Experts,
we to get the index on which position a table line should be inserted into an internal table.
For example have a look on the code snippet. We want to get the line number (here: sy-tabix) in which the new ls_but line
is inserted in table lt_but_sort.
Do you know an easy way to do this? And is it possible to get this information without actually inserting the line
into the internal table?
Thanks and best regards
Axel
data: lt_but TYPE TABLE OF but000,
lt_but_sort TYPE SORTED TABLE OF but000 with UNIQUE KEY partner,
ls_but TYPE but000,
lv_int TYPE i.
SELECT *
from but000
into CORRESPONDING FIELDS OF TABLE lt_but.
READ TABLE lt_but
into ls_but
INDEX 5000.
ls_but-NAME_LAST = 'test'.
ls_but-partner = '0000003047'.
lt_but_sort = lt_but.
insert ls_but into TABLE lt_but_sort.
READ TABLE lt_but_sort
into ls_but
with key partner = ls_but-partner.
write sy-tabix.