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: 

add bottuns in ALV

Former Member
0 Kudos

i use REUSE_ALV_POPUP_TO_SELECT

and i have field called CHECK ('X')

i want to add a bottun that remark all the check and another that clean all the 'X'

like in sm30 any idea PLS

1 REPLY 1

Former Member
0 Kudos

How are you calling the function module? If I use this program below, I get those buttons you are asking for(select all and deselect all).

TYPE-POOLS: slis.
DATA: BEGIN OF i_matnrs OCCURS 0,
        matnr LIKE mara-matnr,
        check TYPE c.
DATA: END OF i_matnrs.

DATA: i_fieldcat TYPE slis_t_fieldcat_alv.
DATA: s_fieldcat TYPE slis_fieldcat_alv.

START-OF-SELECTION.

  SELECT matnr FROM mara INTO TABLE i_matnrs.
  s_fieldcat-reptext_ddic    = 'Material Number '.
  s_fieldcat-fieldname  = 'MATNR'.
  s_fieldcat-tabname   = 'I_MATNRS'.
  APPEND s_fieldcat TO i_fieldcat.

  CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
    EXPORTING
*     I_TITLE                       =
*     I_SELECTION                   = 'X'
*     I_ALLOW_NO_SELECTION          =
*     I_ZEBRA                       = ' '
*     I_SCREEN_START_COLUMN         = 0
*     I_SCREEN_START_LINE           = 0
*     I_SCREEN_END_COLUMN           = 0
*     I_SCREEN_END_LINE             = 0
      i_checkbox_fieldname          = 'CHECK'
*     I_LINEMARK_FIELDNAME          =
*     I_SCROLL_TO_SEL_LINE          = 'X'
      i_tabname                     = 'I_MATNRS'
*     I_STRUCTURE_NAME              =
      it_fieldcat                   = i_fieldcat
*     IT_EXCLUDING                  =
*     I_CALLBACK_PROGRAM            =
*     I_CALLBACK_USER_COMMAND       =
*     IS_PRIVATE                    =
*   IMPORTING
*     ES_SELFIELD                   =
*     E_EXIT                        =
    TABLES
      t_outtab                      = i_matnrs
    EXCEPTIONS
      program_error                 = 1
      OTHERS                        = 2.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

  LOOP AT i_matnrs WHERE check = 'X'.
    WRITE:/ i_matnrs-matnr.
  ENDLOOP.