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 Delete issue

kabil_g
Active Participant
0 Likes
690

Hi Frds,

In my table control i have given the conditions for row selected .

CASE OK_CODE.

     WHEN 'DELETE'.

       GV_COUNT = GV_COUNT + 1.

       IF GW_COST-MARK = 'X'.

         MODIFY GT_COST INDEX GV_COUNT FROM GW_COST TRANSPORTING MARK.

       ENDIF.



Outside the loop.


IF SY-UCOMM = 'DELETE'.

     CLEAR:GV_COUNT. "Clearing Variable that assign Flag for selected row

     LOOP AT GT_COST INTO GW_COST WHERE MARK = 'X'.

       GV_COUNT = GV_COUNT + 1.

       DELETE GT_COST .

      

     ENDLOOP.

   ENDIF.




Randomly deleting not working for particular row . Please help me out.




Kabil.



1 ACCEPTED SOLUTION
Read only

arivazhagan_sivasamy
Active Contributor
0 Likes
665

Hi Kabil,

      You can write a code like below.

      DELETE GT_COST WHERE MARK = 'X'  .

Arivazhagan S

3 REPLIES 3
Read only

arivazhagan_sivasamy
Active Contributor
0 Likes
666

Hi Kabil,

      You can write a code like below.

      DELETE GT_COST WHERE MARK = 'X'  .

Arivazhagan S

Read only

0 Likes
665

Thanks ......for immediate answer.

Read only

Former Member
0 Likes
665

Hi,

IF SY-UCOMM = 'DELETE'.

     CLEAR:GV_COUNT. "Clearing Variable that assign Flag for selected row

     LOOP AT GT_COST INTO GW_COST WHERE MARK = 'X'.

       GV_COUNT = GV_COUNT + 1.

       DELETE GT_COST .   --------------> here give sy-tabix or sy-index or give where condition for Delete stmt.

     

     ENDLOOP.

   ENDIF.