01-07-2008 6:45 PM
I am trying to get the sy-tabix of a record in an internal table.
The key I am using is a field in the internal table that will be unique.
I get sy-sub = 4, so I assume I am not defining the key in full.
The code is:
CONCATENATE g_dimen i_bunit INTO l_nodename.
READ TABLE lt_e_t_rsnodes_lnk WITH KEY nodename =
l_nodename
BINARY SEARCH TRANSPORTING NO FIELDS.
Any suggestions? Thank-You.
01-07-2008 6:49 PM
Did you sort your Internal table lt_e_t_rsnodes_lnk before reading?
VInodh Balakrishnan
01-07-2008 6:49 PM
Did you sort your Internal table lt_e_t_rsnodes_lnk before reading?
VInodh Balakrishnan
01-07-2008 6:49 PM
If you use binary search, you need to sort the internal table first.
before read to the internal table you need to sort your internal table. lt_e_t_rsnodes_lnk
Reward if helpful
01-07-2008 6:50 PM
01-07-2008 6:51 PM
Try without binary search and see if it works.
Also check if concatenate statement is populating the string same as in your internal table. Sometimes spaces may lead to different values.
-Cheers
01-07-2008 6:51 PM
Can you please check the values for the following
g_dimen
i_bunit
l_nodename.
may be try to use
CONCATENATE g_dimen i_bunit INTO l_nodename.
condense l_nodename no-gaps.
and also make sure your table lt_e_t_rsnodes_lnk will be sort properly
a®
01-07-2008 6:53 PM
Hi Tom
I am asuusming that table lt_e_t_rsnodes_lnk have the value similar to that formed by concatenating g_dimen i_bunit.
if you are doing a binary search you need to sort the table for sure..
sort lt_e_t_rsnodes_lnk by nodename.
-
try the above if not...
becoz ur sy-subrc eq 4. looks like the table doesnt have a value similar to that formed by concatenating that fields. check ur data in the table.