Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9164

Re: updating internal table in loop

$
0
0

You may try the following code:

 

FIELD-SYMBOLS <l_fs_data> LIKE LINE OF it_data.

  

DATA:

       l_index TYPE i,

       l_uid   LIKE it_data-uid,

       l_grp   LIKE it_data-grp1.

  

SORT it_data BY uid grp1.

 

LOOP AT it_data ASSIGNING <l_fs_data>.

   IF l_uid IS INITIAL OR l_grp IS INITIAL

     OR l_uid NE <l_fs_data>-uid OR l_grp NE <l_fs_data>-grp1.

     l_index = 1.

   ELSE.

     ADD 1 TO l_index.

   ENDIF.

  

   l_uid = <l_fs_data>-uid.

   l_grp = <l_fs_data>-grp1.

  

   <l_fs_data>-upd1 = l_index.

ENDLOOP.


Viewing all articles
Browse latest Browse all 9164

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>