Skip to Content

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

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Feb 13, 2014 at 01:18 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi @nabheet madan

      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

  • author's profile photo Former Member
    Former Member
    Posted on Feb 13, 2014 at 02:09 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 13, 2014 at 02:30 PM

    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 !


    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 13, 2014 at 03:19 PM


    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.