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: 

SALV and CONTEXT MENU

dmi
Participant
0 Kudos

Hello

I have to create a context menu on a cell in ALV. I use CL_SALV_TABLE.

On right mouse click, there is a standard context menu, but I need my own functions in this context menu.

Is this possible? I've searched a long time in the community, but I can't find the solution.

Many thanks in advance

Daniel

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor

This is not possible natively in SALV, but you may retrieve the CL_GUI_ALV_GRID instance, and operate on it. For instance, see SCN blog posts Power of ABAP Objects: Overcome the Restrictions of SALV Model, by Naimesh Patel, on 2008/11/24, and SALV and PEPPER : Editing individual columns in the SALV, by Paul Hardy, on 2015/08/07.

5 REPLIES 5

Sandra_Rossi
Active Contributor

This is not possible natively in SALV, but you may retrieve the CL_GUI_ALV_GRID instance, and operate on it. For instance, see SCN blog posts Power of ABAP Objects: Overcome the Restrictions of SALV Model, by Naimesh Patel, on 2008/11/24, and SALV and PEPPER : Editing individual columns in the SALV, by Paul Hardy, on 2015/08/07.

0 Kudos

Hello Sandra

Thanks for the interesting links, but I can't see, how I can solve my problem? Or is my thinking to short?

Thanks Daniel

0 Kudos

SALV is based on CL_GUI_ALV_GRID. The context menu is available in CL_GUI_ALV_GRID, but it's not exposed by SALV. There are the same limitations for making an ALV editable, drop down cells, scroll to a given row, ...

The two blog posts are about making an ALV editable, but you can just adapt their code to make available the context menu + have a look at the demo program BCALV_GRID_06 for the context menu.

Former Member
0 Kudos

Hi,

Check this link

https://archive.sap.com/discussions/thread/3513260

By context menu you mean F4?

You have some methods in column class, you can check if u have what you want..

For example: column->has_f4( abap_true ).

Best Regards,

Filipe Sardinha

0 Kudos

Hello Filipe

Thanks for your link

By context menu I mean "right mouse click"

Best regards

Daniel