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: 

Divert standard logic in GUI_STATUS, change a parameter and call it back

deiamolina
Active Participant
0 Kudos

Hi all,

I want to divert the gui status standard logic when I click in any button on the ALV screen and CALL THE DEFAULT LOGIC BACK to keep the logic flow.

The real situation is that we have the save layout button and I want to control the access for it. So I want the logic to pass trough my code before goes to the default logic to check if the user has authorization to change the global layout. If it have authorization to save so the default logic would be called.

Is it possible?

Note: The sap gui were copied from STANDARD_FULLSCREEN in Function group SLVC_FULLSCREEN

Thanks,

Andrea

6 REPLIES 6

nabheetscn
Active Contributor
0 Kudos

Hi Andrea

Can you do it like before displaying the ALV check your logic if its their then button is displayed else not. If it suits you can exclude the ok code for the layout in your set pf status command

Nabheet

0 Kudos

Hi

It need to be dinamic. In some cases it need to allow saving and some cases not allow depending on data changed after REUSE_ALV logic.

In this case only to Global layout. So remove the button is not a option because the user can save user specific layout.

If I create a new OK code I will divert it, all logic. I just need to divert to check if it's a global layout and then, if not, keep the standard logic.

Thanks,

Andrea

Former Member
0 Kudos

Hi,

pass parameter

i_callback_user_command  = 'USER_COMMAND_USER' into FM REUSE_ALV*

and write down form  and put breakpoint in it :

form user_command_user using r_ucomm like sy-ucomm
                  rs_selfield type slis_selfield.
  case r_ucomm.
    when 'XXX.
   endcase.
endform.   

may be it will be helpful

0 Kudos

HI

Thanks for your answer. I know that but it will divert all logic. I want to call the default logic again. Do you kow a way to call the default logic after the user_command?

Former Member
0 Kudos

Andrea, if it will help, I recomend you to use object ALV with class cl_salv_table

Look at example program SALV_TEST_FUNCTIONS

event handle class

CLASS lcl_handle_events DEFINITION.
  PUBLIC SECTION.
    METHODS:
      on_user_command FOR EVENT added_function OF cl_salv_events
        IMPORTING e_salv_function,
      on_before_user_command FOR EVENT before_salv_function OF cl_salv_events
        IMPORTING e_salv_function,
      on_after_user_command FOR EVENT after_salv_function OF cl_salv_events
        IMPORTING e_salv_function.
ENDCLASS.                    "lcl_handle_events DEFINITION

I think  - event before_salv_function will help you !


Former Member
0 Kudos


Hi,

I feel, you need to change the design of the program. Before displaying ALV, you should do the authorization check and display only the  button for user-specific layout or both. We can add dropdown buttons in the toolbar for layout and then add function to it based on the authorization.

Regards,

DPM