Disable Icons in SAP ALV Toolbar

 

* Disable Icons in SAP ALV Toolbar.

* To hide filter option and sum option in alv.
* To find the f-code execute any report program.
* Execute /h for debugger on, click on button you want to hide i clicked on filter button and pass value sy-ucomm in right side tab and enter it gives &ILT.

Report program

   REPORT YRP_DISABLE_ICONS_ALV.
    tables: zst_det.
    types: begin of ty_stu,
                    zst_id type zst_det-ZST_ID,
                    zst_name type zst_det-ZST_NAME,
                    zst_dept type zst_det-ZST_DEPT,
                    zst_fee type zst_det-ZST_FEE,
              end of ty_stu.

    data: it_stu type table of ty_stu,
              wa_stu type ty_stu,
              it_fieldcat TYPE slis_t_fieldcat_alv,
              wa_fieldcat type slis_fieldcat_alv.
    DATA: it_excluding TYPE slis_t_extab,
                 wa_excluding TYPE slis_extab.

    SELECT-OPTIONS s_id for zst_det-ZST_ID.

    IF s_id is not INITIAL.
      select zst_id
                  zst_name
                  zst_dept
                  zst_fee
                  from zst_det
                  into table it_stu
                  WHERE zst_id in s_id.

    ENDIF.

          wa_fieldcat-fieldname  = 'ZST_ID'.
          wa_fieldcat-seltext_m  = 'STU ID'.
          APPEND wa_fieldcat TO it_fieldcat.
          CLEAR wa_fieldcat.

          wa_fieldcat-fieldname  = 'ZST_NAME'.
          wa_fieldcat-seltext_m  = 'STU NAME'.
          APPEND wa_fieldcat TO it_fieldcat.
          CLEAR wa_fieldcat.

          wa_fieldcat-fieldname  = 'ZST_DEPT'.
          wa_fieldcat-seltext_m  = 'STU DEPT'.
          APPEND wa_fieldcat TO it_fieldcat.
          CLEAR wa_fieldcat.

          wa_fieldcat-fieldname  = 'ZST_FEE'.
          wa_fieldcat-seltext_m  = 'STU FEE'.
          APPEND wa_fieldcat TO it_fieldcat.
          CLEAR wa_fieldcat.

          wa_excluding-FCODE = '&ILT'.             " f-code for filter
          append wa_excluding to it_excluding.

          wa_excluding-FCODE = '&UMC'.         " f-code for sum
          append wa_excluding to it_excluding.

          CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
               EXPORTING

                     IT_FIELDCAT                       = it_fieldcat
                     IT_EXCLUDING                      = it_excluding
             TABLES
                      T_OUTTAB                          = it_stu
               EXCEPTIONS
                     PROGRAM_ERROR                     = 1
                     OTHERS                            = 2.

Input
        






Output



Before Disable




Comments

Popular posts from this blog

Pf status and user command in factory method - OOPS ALV in ABAP

fetch the data from table and send an email in ABAP

Enhancements in abap