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?
Answers were Sorted based on User's Feedback
Answer / sivaramakrishna
hi mr zubera try it in the way
create userdefined type
types : begin of mara
check type c
matnr type mara-matnr...take neceassery fields.
create itab ,wa.
In manual field catalog declaration:
wa_fcat-Checkbox = 'X'.
now display using grid display or list display
using set pfstatus create one custom button on list screen.
and use below in that
if sy-ucomm = 'deleate' "fct code of deleate button
deleate it_fcat where checkbox = 'x'.
now all the checked records will be deleated.
now display the it_fcat using loopat which will display
only unchecked records
Is This Answer Correct ? | 6 Yes | 1 No |
Answer / 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 |
After finding enhancements of a perticular transaction using SMOD, how can you opt one enhancement from all displayed enhacements?
What are the types of internal tables?
You are given functional specs for a BDC program and you need to decide whether to write a method call transaction or a session. How u will decide?
Suppose we are transfer data through BDC from legacy to SAP and their is some duplicate data in legacy system but we don’t want this in SAP system .So how can we check that this data is already exist ?
What is the significance of technical settings (specified while creating a table in the data dictionary) ?
How to specify a client for database table processing?
Can we use flow logic control key words in abap/4 and vice-verse?
Explain the properties of selection screen?
What does hide statement do?
Which and How will you use function module for ALV Interactive report?
In a transaction there are 5 screens (say) but while recording you could see only 3 screens.what will u do to avoid such situation?will u save it like that?
What is the difference between scrolling a table horizontally and vertically?