2013 Apr 16 6:23 AM
Hi,
Help me to add a button on the ALV tool bar using class cl_salv_table, I tried to add using add_function method but I got exception at the below statement,
gr_functions->add_function( NAME = 'display'
ICON = 'ICON_DETAIL'
TEXT = 'display'
TOOLTIP = 'display the list'
POSITION = if_salv_c_function_position=>right_of_salv_functions ).
Please help me to resolve this issue.
Thanks,
Venkat
2013 Apr 16 7:33 AM
HI venkat,
I think you will find plenty of information in thread Edit toolbar (GUI Status) for CL_SALV_TABLE and
You can also refer the standard report SALV_DEMO_TABLE_SELECTIONS.
Regards
Sravan
2013 Apr 16 7:33 AM
HI venkat,
I think you will find plenty of information in thread Edit toolbar (GUI Status) for CL_SALV_TABLE and
You can also refer the standard report SALV_DEMO_TABLE_SELECTIONS.
Regards
Sravan
2013 Apr 16 7:46 AM
What exception did you get? Without that fairly basic piece of information, it's not really possible to help you.
2013 Apr 16 8:03 AM
Hi Matthew,
I got below exception
An Exception (CX_SALV_METHOD_NOT_SUPPORTED).
Thanks,
2013 Apr 16 9:17 AM
2013 Apr 16 9:40 AM
2013 Apr 16 9:28 AM
Hi Venkat,
Use toolbar event of cl_gui_alv_grid class and under the implementation add the following code,
CLEAR: gd_toolbar. (DATA: gd_toolbar TYPE stb_button.)
MOVE 'BT_DISP' TO gd_toolbar-function.
MOVE 'Display' TO gd_toolbar-text.
MOVE 'Display' TO gd_toolbar-quickinfo.
MOVE icon_display TO gd_toolbar-icon.
APPEND gd_toolbar TO e_object->mt_toolbar.
Regards,
Tushar
2013 Apr 16 10:31 AM
2013 Apr 16 11:04 AM
Thanks for all,
My Problem solved.
I forgot to to set screen status.
After adding below piece of code my problem is solved.
call method gr_alv->set_screen_status
exporting
report = l_report
pfstatus = 'STANDARD'
set_functions = gr_alv->c_functions_all.
Thanks
venkat
2024 May 26 5:41 PM - edited 2024 May 26 5:41 PM
TRY.
CALL METHOD lo_function->add_function
EXPORTING
name = 'LOCK USER'
icon = 'ICON_LOCKED'
text = 'Lock'
tooltip = 'lOCK SELECTED USER'
position = if_salv_c_function_position=>right_of_salv_functions
.
CATCH cx_salv_existing.
CATCH cx_salv_wrong_call.
ENDTRY. I have declared lo_function TYPE REF TO cl_salv_functions, but getting runtime error Access using a 'ZERO' object reference is not possible.
2024 May 27 9:36 AM