2008 Dec 16 11:03 AM
Hi All,
I am using the following method to hide the standard buttons of my ALV display.
My requirement is such that of the data displayed in the AL layout i have to select some rows and those will be going as a mail output.
How to capture those selected rows in the ALV.
lwa_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
APPEND lwa_exclude TO it_exclude.
lwa_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
APPEND lwa_exclude TO it_exclude.
lwa_exclude = cl_gui_alv_grid=>mc_fc_loc_cut.
APPEND lwa_exclude TO it_exclude.
lwa_exclude = cl_gui_alv_grid=>mc_fc_loc_copy.
APPEND lwa_exclude TO it_exclude.
lwa_exclude = cl_gui_alv_grid=>mc_fc_loc_paste.
APPEND lwa_exclude TO it_exclude.
lwa_exclude = cl_gui_alv_grid=>mc_fc_loc_paste_new_row.
APPEND lwa_exclude TO it_exclude.
wa_is_layout-SEL_MODE = 'D'.
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
it_toolbar_excluding = it_exclude
is_layout = wa_is_layout
CHANGING
it_outtab = it_final
it_fieldcatalog = it_fieldcat.
Edited by: Vivek Agarwal on Dec 16, 2008 12:03 PM
Hi All,
I am using the following method to hide the standard buttons of my ALV display.
My requirement is such that of the data displayed in the AL layout i have to select some rows and those will be going as a mail output.
How to capture those selected rows in the ALV.
lwa_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
APPEND lwa_exclude TO it_exclude.
lwa_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
APPEND lwa_exclude TO it_exclude.
lwa_exclude = cl_gui_alv_grid=>mc_fc_loc_cut.
APPEND lwa_exclude TO it_exclude.
lwa_exclude = cl_gui_alv_grid=>mc_fc_loc_copy.
APPEND lwa_exclude TO it_exclude.
lwa_exclude = cl_gui_alv_grid=>mc_fc_loc_paste.
APPEND lwa_exclude TO it_exclude.
lwa_exclude = cl_gui_alv_grid=>mc_fc_loc_paste_new_row.
APPEND lwa_exclude TO it_exclude.
wa_is_layout-SEL_MODE = 'D'.
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
it_toolbar_excluding = it_exclude
is_layout = wa_is_layout
CHANGING
it_outtab = it_final
it_fieldcatalog = it_fieldcat.
Edited by: Vivek Agarwal on Dec 16, 2008 12:03 PM
2008 Dec 16 11:12 AM
2008 Dec 16 3:10 PM
Hi Vivek,
Say for example you want to send mail after clicking a push button with fcode 'MAIL' .
You use the following logic:
Declare data to capture selcted fields:
DATA:
* Internal table for indexes of selected rows
gi_index_rows TYPE lvc_t_row,
* Information about 1 row
g_selected_row LIKE lvc_s_row.Handle user command when clicked on the push button for mail:
METHOD handle_user_command.
* Handle own functions defined in the toolbar
CASE e_ucomm.
WHEN 'MAIL'.
PERFORM send_mail.
ENDCASE.
ENDMETHOD.
FORM send_mail.
* Read index of selected rows
CALL METHOD go_grid->get_selected_rows
IMPORTING
et_index_rows = gi_index_rows.
"Move the selected contents to another internal table it_final1
LOOP AT gi_index_rows INTO g_selected_row.
READ TABLE it_final INDEX g_selected_row-index INTO
wa_final.
APPEND wa_final TO it_final1
ENDLOOP.
"Now it_final1 contains only the selected rows.
"Write your logic to send mail using 'it_final1'
ENDFORM.Hope this will help you.
Regards,
Manoj Kumar P
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |