Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8572

Re: Disable a button on click in alv report

$
0
0

hi samuel,

 

try these steps to achieve your requirement.

 

1) Define one public variable in public section

       DATA: CHK TYPE N.

 

2) In the handle_toolbar method

    If go_event_handler->CHK = 1.
       ty_toolbar-butn_type = 0.
       ty_toolbar-text = 'New Entries'.
       ty_toolbar-function = 'NEW_ENTRIES'.
       ty_toolbar-disabled = 'X'.
       APPEND  ty_toolbar TO e_object->mt_toolbar.
       clear ty_toolbar.
     else.
       ty_toolbar-butn_type = 0.
       ty_toolbar-text = 'New Entries'.
       ty_toolbar-function = 'NEW_ENTRIES'.
       APPEND  ty_toolbar TO e_object->mt_toolbar.
       clear ty_toolbar.
     ENDIF.


3)  in the user command you have call again method handle_toolbar()


   FORM user_command.

        CALL METHOD cl_gui_cfw=>dispatch.
        CASE ok_code.

        ..................................
        WHEN 'NEW_ENTRIES'.
           go_event_handler->CHK = 1.          
           go_grid->set_toolbar_interactive( ). " raises event TOOLBAR
          CALL SCREEN 3002.
          go_event_handler->CHK = ''.    "After screen I am restoring chk value to that it enable again.
    ENDCASE.

    CLEAR ok_code.
  ENDFORM.

Do hope that you get what you are looking for.....


Viewing all articles
Browse latest Browse all 8572

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>