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

difference between the read itab and read table itab

hi Friends,

what is the difference between the read itab and read table itab?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 05, 2008 at 08:30 AM

    there is no such statement like read table..

    but there is a command .....

    read table itab index 1.

    to read the particular record in the internal table suppose for..first record we use -


    index 1,

    second -


    index 2,

    third -


    index 3,

    fourth -


    index 4.....

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 05, 2008 at 08:50 AM

    read table is used to read single entry of internal table

    read table itab is for reading single entry on some condition which u mention in key

    but read itab ... this means nothing.. this is wrong syntax

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 05, 2008 at 09:05 AM

    Hi,

    To read a single line of any table, use the statement:

    READ TABLE <itab> <key> <result>.

    For the statement to be valid for any kind of table, you must specify the entry using the key and not the index. You specify the key in the <key> part of the statement. The <result> part can specify a further processing option for the line that is retrieved.

    If the system finds an entry, it sets SY-SUBRC to zero, if not, it takes the value 4, as long as it is not influenced by one of the possible additions. If the internal table is an index table, SY-TABIX is set to the index of the line retrieved. If the table has a non-unique key and there are duplicate entries, the first entry is read.

    Basically Read table itab used can be used fro any kind(Standard,Sorted,Hashed ) of internal table.

    But read itab is Used for Standard and Sorted Internal table.

    Regards,

    Sujit

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 05, 2008 at 09:06 AM

    Hi,

    In short we use TABLE prefix for statements applicable to all kinds of internal tables (standard, sorted and hashed).

    and for index internal tables we do not use TABLE prefix.

    Your example is one of the example of them.

    Reward if found helpful.

    Anirban Bhattacharjee

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 05, 2008 at 09:10 AM

    Can you tell me where exactly you found read itab.

    We do not have such command to my knowledge.

    Regards

    MNR

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 05, 2008 at 09:24 AM

    hi,

    Read Table itab... is used to read data from the internal table. It is used to read a single line at a time.

    There is no Statement as Read Itab... to the best of my knowledge.

    Regards

    Sumit Agarwal

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 05, 2008 at 09:45 AM

    hi....

    both thses statements are used to read a single entry from internal table.

    Tha major differenece between read table itab and read itab is that whenever you use read table itab you need to specify all the key fields of the table in the with key addition.If you dont mention the key fields of the table then it will give dump when you execute.

    so you need to specify all the key fields whereas when you read itab you donot need to specify all the key fields in the with key addition,

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 05, 2008 at 04:53 PM

    read table <table name> ..this statements reads entire internal table..

    i never come across of read < table name>..

    if it helpfule reward me..

    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.