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

delete selected row in table control

Former Member
0 Likes
469

Hi,

I want to delete a selected row after pressing delete button,i gave name 'sel' to selcolumn.i wrote code inside

MODULE ZTABCONTROL_MODIFY ON CHAIN-REQUEST module(pai).

if sel = 'X'.

if save_ok = 'DELETE'.

delete itab index ztabcontrol-current_line.

endif.

endif.

but this module is not getting excuted.

how to rectify this problem?

Regards,

Kavitha

4 REPLIES 4
Read only

Former Member
0 Likes
447

Hi,

refer teh thread

Read only

Former Member
0 Likes
447

Hi,

Please write the code as below.

PAI.

loop at tabel_control.

module delete_row .

endloop.

module delete_row.

if sel = 'X'.

if save_ok = 'DELETE'.

delete itab index ztabcontrol-current_line.

endif.

endif.

endmodule.

regards,

Santosh Thorat

Read only

Former Member
0 Likes
447

Have a look @ The Demo Program

RSDEMO02

Read only

Former Member
0 Likes
447

Hi

Select the row in table control and delete the selected row index from the internal table which is bound to table control. you can use CRIT_TABCNTRL-current_line to get the current line of the table control. CRIT_TABCNTRL is table control name.

Before deleting the row, check whether the row is selected or not. In screen-painter you have to assign one variable to the selected column of the table contol. Check this value for every row in LOOP...ENDLOOP of table control in PAI and delete only those entries which were having variable set to 'X'.

if sy-ucomm eq 'DELE'.
    if sel eq 'X'. "sel is variable which is bound to selected column
      delete table it_dmui_crit index crit_tabcntrl-current_line.
endif.

With Regards

Nikunj Shah