04-02-2015 7:20 AM
select the record with the help of checkbok and delete the record from sm30.
how to write code for tmg event delete
04-02-2015 7:44 AM
04-02-2015 7:58 AM
03-Before deleting the data displayed
This event gets triggered whenever user delete a data i.e. select a record and click on ‘delete’.
Let us add first event i.e. before deleting the data displayed. Give the name of the event in ‘FORM routine’ and click on ‘Editor’.
The following screen would appear. We can use an already existing include or a new include also
After selecting the ‘Include’, write the code inside the ‘include’ of function group of the event and
activate the ‘include’. Write the following code in the FORM routine.
Please note that FORM and ENDFORM statements have to be added on our own because
these statements would appear automatically.
If the user clicks on ‘No’ in step 4.3.2, the record would not get deleted
Hope you understand
Regards,
Sandeep
04-02-2015 8:18 AM
04-02-2015 10:02 AM
Select the record with the help of checkbox and delete the record
04-02-2015 9:20 PM
Hi,
Sap provide each a unique field(VIM_MARKED) in each SM30 for selecting rows.
i think you use sap provided field for selecting records.If you need your own field as check box then
you have add a field in table control in screen flow logic and drag and drop check box from tool to table control map with newly added field.
then use tmg event 03
and code to identify check is initial or not then delete their only as you dont select sap field so sap may not identify which record will be delete from Table control.
form delete_before
data lwa_row type <your z table name>.
loop at total.
clear lwa_row.
if <vim_total_struc> is assigned.
move-corresponding <vim_total_struc> to lwa_row.
endif.
if <action> ne 'D' and <action> is not initial and <action> ne 'X'.
if lwa_row-<chenck box field > ne 'X'.
*put logic for delete entry from table control*
endif.
endif.
endloop.