Skip to Content
author's profile photo
Former Member

How to do a loop condition on a table and retrieve the column name and row

To do a loop on all data in a table, given total row count of 5 for example.

Want to do a loop on all the fields.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 03:04 AM

    I think that you need to use field symbols to loop the table and into each row you should use assign component of structure

    <wa> should have the structure of your table.

    <fs> type any

    loop table asinging <wa>

    do.

    assign component sy-index of structure <wa> into <fs>.

    if not <fs> is assigned.

    exit.

    else.

    YOUR CODE HERE

    unassign <fs>.

    endif.

    enddo.

    endloop.

    Regards

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 03:38 AM

    Sorry i'm new to abap. I dun really understand how the code works.

    Any full sample code?

    Add comment
    10|10000 characters needed characters exceeded