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

How to loop at an int.table only last line..

I want to loop at an internal table ...with only the last line in that ..

loop at itab1.

move-corresponding itab1 to itab.

append itab.

loop at itab from ?????.

"Here i want only the last row of itab...

endloop.

endloop.

Hope u understood..

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jan 19, 2005 at 03:13 PM

    Hi,

    "loop at itab1.

    move-corresponding itab1 to itab.

    append itab.

    loop at itab from ?????.

    "Here i want only the last row of itab… "Why ??? you 've the last record of itab in the headline (workaerea) !

    endloop.

    endloop."

    Do you mean the last row before append itab or "after append itab" ?

    1) before append

    Append itab.

    Last_row = sy-tabix - 1.

    read table itab index Last_row.

    2) after append -> loop / read not necessary

    Regards Andreas

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 19, 2005 at 01:24 PM

    Hi Shankar:

    code:

    data : no_of_records type i.

    use describe to get no of records

    loop at itab.

    if no_of_records = sy-tabix.

    then take itab data.

    endif.

    endloop.

    Regards

    Suresh Babu Karanam

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 19, 2005 at 01:27 PM

    Hi Shankara,

    data:

    zz_lines type sytabix.

    loop at itab1.

    move-corresponding itab1 to itab.

    append itab.

    describe table itab lines zz_lines.

    loop at itab from zz_lines.

    endloop.

    endloop.

    Regards,

    John.

    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.