Skip to Content
author's profile photo
Former Member

AT END OF F1/F2 on same itab; LOOP AT <itab1/itab2> INTO wa

Hi All,

1)

I need to get the itab dynamically.

LOOP AT itab_dyn INTO wa.

ENDLOOP.

Here, itab_dyn can be itab1 or itab2 (based on a condition) and both of which have same fields only change in order of table fields. ex: table1 - F1, F2 ; table2- F2, F1

Can we have field symbols for that? Please tell any other possible solutions.

2)

But my basic requirement is to use AT END OF F1/F2 inside a single LOOP.

But even if we give SORT itab BY F1 F2 and F2 F1 based on condition, AT END OF won't work in both cases (ex: struct-F1 F2, SORT F2 F1. it will consider change of F1, when you write AT END OF F2) because I think the field should be first one while defining structure

Thanks in advance,

Nunu Vengal.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • author's profile photo
    Former Member
    Posted on Aug 22, 2007 at 11:06 AM

    Hi Nunu,

    I think the ideal scenario is to use the field symbol if you want to use the itab dynamically.

    You can use at end of when you use field symbol also.

    Award points if this helps.

    Regards,

    Ravi G

    Add comment
    10|10000 characters needed characters exceeded