Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to add custom button into SALV table toolbar?

Former Member
0 Kudos
6,207

Hi, if someone knows how to add button at the salv table toolbar. I found 2 variants how to do it,but neither of them is works.
1. So first variant how to do it is cl_salv_functions_list->add_function( ) but it ends with dumb "

Class CL_SALV_FUNCTIONS, method ENABLE_FUNCTION not supported"

2) And 2 variant is to add an container in cl_salv_table=>factory( ). After i do it , alv doesnt show, it just stays on selection-screen. I found that i need to defind it at pbo of the selection-screen but it doesn't work, cause type of mine output table depends of the selection-screen values.
If there other ways to add a button?

1 ACCEPTED SOLUTION

Tomas_Buryanek
Active Contributor
5,763

You can set your own toolbar / status (GUI status) using method:

SET_SCREEN_STATUS (of class CL_SALV_TABLE)

But add_function( ) should work too. You have probably some mistake in your code?

-- Tomas --
4 REPLIES 4

Tomas_Buryanek
Active Contributor
5,764

You can set your own toolbar / status (GUI status) using method:

SET_SCREEN_STATUS (of class CL_SALV_TABLE)

But add_function( ) should work too. You have probably some mistake in your code?

-- Tomas --

raymond_giuseppi
Active Contributor
0 Kudos
5,763

Look at this answer to adapt your code: Method add_function does not display icon in toolbar

Sandra_Rossi
Active Contributor
0 Kudos
5,763

1)

ADD_FUNCTION normally dumps when you instantiate a full screen ALV instead of a container ALV (the way how you instantiate via CL_SALV_TABLE=>FACTORY). ADD_FUNCTION can work only with a container ALV. For full screen ALV you must use GUI Status and SET_SCREEN_STATUS.

Is it clear to you what are the differences between full screen ALV and container ALV?

2)

Please share your code (as minimal reproducible code), we'll tell you what your error is.

Bohdan
Active Contributor
0 Kudos
5,763

Hi shiz0frenik,

Please check-out this blog post on zevolving.com. I think it might answer your question.

Regards,

Bohdan