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

What is the difference between retroactive accounting period, earliest retroactive accounting period? : sap abap hr

544


What are the attributes of a field that can be activated or deactivated during runtime?

558


In sap script how to print bar code in vertical manner

3435


Explain the difference between a pool table and a transparent table and how they are stored at the database level?

547


Explain the difference between domain and data element? What are aggregate object?

553






Explain what is sap script?

642


what is the purpose of BAPI BAPI_CUSTMATINFO_GETLIST What is input and output of this BAPI.

2049


Explain different types of attributes of function module?

540


List some of the many different ways that the sap standard functionality can be changed by a customer?

545


What is a development class? : abap data dictionary

697


What is asap methodology? : sap abap hr

559


How is conversion of data types done between abap/4 & external level? : abap data dictionary

649


What is a table attribute? : abap data dictionary

560


How do you import pay scale data from non sap to sap? : sap abap hr

573


Explain get cursor field?

669