Application Development and Automation 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: 
Read only

table control

Former Member
0 Likes
408

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
Read only

Former Member
0 Likes
376

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
Read only

Former Member
0 Likes
376

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

Regards

MD

Read only

Former Member
0 Likes
377

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.

Read only

GauthamV
Active Contributor
0 Likes
376

hi,

check this program.

DEMO_DYNPRO_TABCONT_LOOP_AT.