‎2008 Jul 18 10:01 AM
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
‎2008 Jul 18 10:03 AM
‎2008 Jul 18 10:04 AM
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
‎2008 Jul 18 10:04 AM
‎2008 Jul 18 10:08 AM
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