Skip to Content

custom push button in alv list display

Hi All,

I am having 4 custom push buttons Button1, Button2, Button3 and Button4 in my alv list display. When I display the alv list Button4 should be in disable mode. When I press any of the first 3 buttons then only Button4 should be in Enable mode. How to achieve this functionality. Please help me.

Thanks,

Haritha

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 09, 2015 at 01:32 PM

    Hi Haritha,

    Where you have added buttons in ALV? in rows or in tool bar?

    regards.

    Praveer.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Haritha P

      Hi

      I suppose you've developed the routine to active a your own ALV status, this routine should be triggered after pressing a button, so you can decide which button has to be active after pressing another one, try this sample:

      DATA: T_OUTPUT TYPE STANDARD TABLE OF T001.

      DATA: GT_REPID TYPE SY-REPID.

      DATA: ACT_1_OR_2(1) TYPE C.

      START-OF-SELECTION.

         SELECT * INTO TABLE T_OUTPUT

           FROM T001.

         GT_REPID = SY-REPID.

         ACT_1_OR_2 = '1'.

         CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

           EXPORTING

             I_CALLBACK_PROGRAM       = GT_REPID

             I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'

             I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'

             I_STRUCTURE_NAME         = 'T001'

           TABLES

             T_OUTTAB                 = T_OUTPUT.

      FORM USER_COMMAND USING R_UCOMM     LIKE SY-UCOMM

                               RS_SELFIELD TYPE SLIS_SELFIELD.

         CASE R_UCOMM.

           WHEN 'BUT1'. ACT_1_OR_2 = '2'.

           WHEN 'BUT2'. ACT_1_OR_2 = '1'.

         ENDCASE.

         RS_SELFIELD-REFRESH = 'X'.

      ENDFORM.         

      FORM SET_PF_STATUS  USING RT_EXTAB TYPE SLIS_T_EXTAB.

         DATA: T_EXTAB LIKE SY-UCOMM OCCURS 0 WITH HEADER LINE.

         CASE ACT_1_OR_2.

           WHEN '1'. T_EXTAB = 'BUT2'.

           WHEN '2'. T_EXTAB = 'BUT1'.

         ENDCASE.

         APPEND T_EXTAB.

         SET PF-STATUS 'MY_STATUS' EXCLUDING T_EXTAB.

      ENDFORM.

      Max