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

Modify statement

Hi Guru's,

Pleae can anybody expalins me what is the difference between sy-tabix and sy-index(Loop Index) ?

because in one case i am Modifyimg the internal table inside the do loop by giving sy-index ((Index of Internal Tables)(MODIFY scarr_tab INDEX sy-index FROM scarr_wa

TRANSPORTING currcode. ) in the syntax

and in other case inside loop statement i am modifyng same record by giving sy-tabix MODIFY scarr_tab INDEX sy-tabix FROM scarr_wa

TRANSPORTING currcode.) in the syntax.

in both case its working fine but i am not getting which one i have to use where to modify the internal table?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2007 at 11:31 AM

    Hi,

    Sy-tabix maintain effected row in internal table.

    sy-index maintain index of DO loop.

    L.Velu

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 30, 2007 at 11:31 AM

    Hi,

    generaly in DO loops we use sy-index and when we LOOP the internal tables then we use sy-tabix..

    check the below link also

    what-is-diff-bw-sy-index-and-sy-tabix

    Regards,

    Nagaraj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2007 at 11:36 AM

    Hi Priya,

    sy-tabix --->

    Current line in an internal table. With the following statements SY-TABIX is set for index tables. With hashed tables, SY-TABIX is not filled or it is set to 0.

    · APPEND sets SY-TABIX to the index of the last table row, that is the total number of entries in the target table.

    · COLLECT sets SY-TABIX to the index of the existing or appended table row. With hashed tables, SY-TABIX is set to 0.

    · LOOP AT sets SY-TABIX to the index of the current table row at the beginning of every loop pass. After leaving a loop, SY-TABIX is set to the value it had before entering the loop. With hashed tables, SY-TABIX is set to 0.

    · READ TABLE sets SY-TABIX to the index of the table row read. If no row is found with binary search while reading, SY-TABIX contains the index of the next-highest row or the total number of rows +1. If no row is found with linear search while reading, SY-TABIX is undefined.

    · SEARCH

    Sy-index Contains the number of loop passes in DO and WHILE loops, including the current loop pass.

    that is if 1 st time loop processing it is 1 if second time it is 2 etc...

    Plz reward if help,

    Mahi.

    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.