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

How do you backup Sapscript layout sets? Can you download and upload? How?

639


Name some data dictionary objects?

553


What are the dynapro keywords?

667


What are the different types of views in sap? : abap data dictionary

609


What are the different types of luws. What are they?

629






Why do we declare a method of a class final? What can be the purpose? Give a scenario.

892


What are local objects?

620


What are the page headers for secondary lists?

607


HOW TO TRANSFER VENDOR MASTER DATA FROM LEGACY SYSTEM TO SAP SYSTEM THRU LSMW (IN LSMW, USING DIRECT INPUT PROGRAM:RFBIKR00)

3288


How to call other programs?

620


1. If I send 5 entries of table from one system to another system, if the only 4 entries there in the target system what I have to do? 2. If I send the customer master IDOC from one SAP system to another system, if one field is missing in target table what is the steps? 3. If I want to access the 4th row 3rd column in the hashed table how to do it? 4. Whether there is any other statement than MODIFY statement to modify the content of internal table?

1413


How does the interface between the dynpro and the abap/4 modules take place?

555


Hi every one ! You people are doing a great job here , Im going to attend Tata Technologies interivew on this sunday,Can anyone who has already attended this company interivew or other companies interivews in abap pls share ur experience with me and help me to get into job my id ushareddyabap@gmail.com. Thankyou verymcuh

1508


How can we use multiple transactions by using bdc_insert? : abap bdc

644


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

744