In ALV, i have to display list in which some records has to
display. starting of each record it should display checkox.
and we have to display push button delete. when user select
chekc box and press delete button, that entry should
delete. please tell me how to do it?

Answer Posted / kubera naidu

Hi, you can do this by..am droping here only the relevant
code for the selected records. i.e for the check box selected,

1) Build fieldcatalog along with the checkbox
2) Create one method for getting the selected records into
internal table.
* Registering Edit Event
CALL METHOD g_grid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.

g_grid->check_changed_data( ).

REFRESH: it_final.

LOOP AT it_final1 INTO wa_final1.
IF wa_final1-checkbox EQ 'X'.
APPEND wa_final1 TO it_final.
CLEAR wa_final1.
ENDIF.
ENDLOOP.
3) And for deleting, create a push button on the screen
and in PAI,
case ok_code.
when 'DELETE'.
CALL METHOD g_grid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.

g_grid->check_changed_data( ).

delete it_final where checkbox = 'X'.

endcase.

Hope somehow it will help..
Regards,
Kubera Naidu.

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a constructor be redefined?

922


What is occurs in internal table?

600


What is the difference between bdc_open_group and bdc_open_dataset. : abap bdc

616


Is main window mandatory in smartforms?

725


Explain the uses of the simple maintenance interface? : sap abap hr

584






Difference between open sql and native sql? : abap data dictionary

612


Name some data dictionary objects?

563


8)when u create sales report what u can see in that report ? what rthose field names or data element names? 9)when u create purchase order details report what u can see in that report ?what rthose fieldnames or dataelements? 10)when u create material stock report in material master grouped by material type and plant what u can see in report ?what rthose field names or dataelement ? 11)when u create shipping forecast report what u can see in that report ?what rthose data elements or field names?

1616


What are the differences between sap memory and abap memory?

581


What will happen when we use single buffered selected?

624


What are the attributes of the data in data dictionary? : abap data dictionary

608


What are clustered tables?

619


out bound process code for quotation?

1570


A field containing quantity amounts (data type quan) must be assigned to a reference table and a reference field. Explain? : abap data dictionary

679


Difference between sap script and report?

750