Skip to Content
author's profile photo Former Member
Former Member

READ Table With Key

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2008 at 06:49 PM

    Did you sort your Internal table lt_e_t_rsnodes_lnk before reading?

    VInodh Balakrishnan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2008 at 06: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 07, 2008 at 06: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 07, 2008 at 06: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 07, 2008 at 06: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2008 at 06:50 PM

    Is the table sorted by nodename?

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.