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: 

EVENT USER_COMMAND for CL_GUI_ALV_GRID

Former Member
0 Kudos

Hello All,

We have a program that uses the CL_GUI_ALV_GRID and the events user_command and context_menu_request. The program functions by selecting an option for the context menu on an ALV grid which will then take you to another screen with another ALV grid.

The issue is on the second screen where the user clicks the back button to return to the first ALV Grid. For some reason, the functionality of Method user_command is triggered twice preventing the user from returning to the initial screen. Once when the menu option is selected and again when the Back button on the second screen is selected. If the user clicks the Back button again it will return to the initial ALV grid. We need to have the program go to the initial ALV grid after the Back button is clicked the first time not the second.

Does anyone have any suggestions on how to correct this? Thanks in advance for your help.

John

4 REPLIES 4

Former Member
0 Kudos

In all probability, both the grids are using the same user_command routine.

0 Kudos

Hello Srinivas,

Thanks for the response. From what I can tell the user_command routine is only being called on the first ALV Grid screen. The second grid does not appear to use this method at all. Any other suggestions? Thanks.

John

Former Member
0 Kudos

Hi John,

maybe this will help you. I had a similar situation.

1.) When you initialize the grid-controls try to set a

unique identifier within the display-variant.

lf_variant TYPE disvariant.

lf_variant-report = ls_report (NOT SY_REPID!)

lf_variant-handle = 'HUGO'....

2.) After leaving the 2. screen clear all handles using

the method hndle->free, free, clear ...

In PAI you can easaly check <if hndle is initial>

or <if not ( hndle is initial )> ....

Hope this will help you

BR

Michael

Former Member
0 Kudos

Both ALV are using same Event.

1.Create seperate custom control and ALV Grid for both the ALV.

Assingn all the things like handler to the second also...

so that it will noty happen