Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

table control

Former Member
0 Kudos

when i delete a row from table conrol the serial numbers attached to it ishould also be accordingly changed..but it is not happening..

ex : i have 3 rows in my table control and i deleted 2 row..then the serial numbers should be 1 & 2..but i'm getting the ser num as 1 & 3. How to decrement the serialnums.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

try like this...

delete itab where mark eq 'X'.
        tc-lines = tc-lines - 1.
        num = 1.
        loop at itab into wa.
          wa-slno = num.
          modify itab from wa transporting slno.
          num = num + 1.
        endloop.
        clear num.

Regards,

Sathish Reddy.

3 REPLIES 3

Former Member
0 Kudos

When you delete a record, loop the intenal table and modify the serial number

Regards

MD

Former Member
0 Kudos

Hi,

try like this...

delete itab where mark eq 'X'.
        tc-lines = tc-lines - 1.
        num = 1.
        loop at itab into wa.
          wa-slno = num.
          modify itab from wa transporting slno.
          num = num + 1.
        endloop.
        clear num.

Regards,

Sathish Reddy.

GauthamV
Active Contributor
0 Kudos

hi,

check this program.

DEMO_DYNPRO_TABCONT_LOOP_AT.