2023 Nov 02 11:24 AM
Hello,
I am not able to get the SAVE button enabled in my report. Can someone help me with the code.
Attaching my code below. What else do i need to add to make it enabled.
DATA: lo_gr_alv TYPE REF TO cl_salv_table,
lo_gr_functions TYPE REF TO cl_salv_functions_list.
DATA: lo_selections TYPE REF TO cl_salv_selections,
lo_columns TYPE REF TO cl_salv_columns,
lo_column TYPE REF TO cl_salv_column_table.
DATA: lo_header TYPE REF TO cl_salv_form_layout_grid,
lo_h_label TYPE REF TO cl_salv_form_label,
lv_text TYPE char100.
*Create alv object.
TRY.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = lo_gr_alv
CHANGING
t_table = gt_sel.
CATCH cx_salv_msg.
ENDTRY.
lo_gr_alv->set_screen_status( pfstatus = 'STANDARD_FULLSCREEN'
report = 'SAPLSLVC_FULLSCREEN'
set_functions = lo_gr_alv->c_functions_all
).
* DATA: lr_selections TYPE REF TO cl_salv_selections,
* gt_rows type salv_t_row.
* lr_selections = lo_gr_alv->get_selections( ).
* lr_selections->set_selection_mode( if_salv_c_selection_mode=>row_column ).
* Show all alv functions.
lo_gr_functions = lo_gr_alv->get_functions( ).
lo_gr_functions->set_all( abap_true ).
* lo_gr_functions->set_aggregation_average( abap_true ).
* lo_gr_functions->set_abc_analysis( abap_true ).
lo_gr_functions->set_export_wordprocessor( abap_true ).
* Fit the columns
lo_columns = lo_gr_alv->get_columns( ).
lo_columns->set_optimize( abap_true ).
* Display alv
lo_gr_alv->display( ).
2023 Nov 02 12:54 PM
If you want the button to be in the Application Toolbar (your screenshot), you must create a custom GUI Status (copy SALV_TABLE_STANDARD of SAPLSLVC_FULLSCREEN and edit the GUI status to add your custom button). After that you need to implement the event handler for custom buttons. Look for the solutions in the forum.