Ads

How to Disable Icons in SAP ALV Toolbar :SAP ABAP Language

How to Disable Icons in SAP ALV Toolbar :SAP ABAP Language

I have developed One SAP ALV Report in which i want to Disable Icons ,so How can you do that ,to learn ,follow the below steps.
Fetch data from database table.
Build field catalog and fill the excluding table with function codes of icons that you want to disable. &ILT& is the function code for Filter Icon.
Pass field catalog and excluding table to function module ‘REUSE_ALV_GRID_DISPLAY’.
TYPE-POOLS: slis.  " SLIS contains all the ALV data types
*&---------------------------------------------------------------------*
*& Data Declaration
*&---------------------------------------------------------------------*
DATA: it_sbook     TYPE TABLE OF sbook.
DATA: 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.
DATA: g_repid      TYPE sy-repid.
*&---------------------------------------------------------------------*
*& START-OF-SELECTION
*&---------------------------------------------------------------------*
START-OF-SELECTION.
  g_repid = sy-repid.
*Fetch data from the database
  SELECT * FROM sbook INTO TABLE it_sbook.

*Build field catalog
  wa_fieldcat-fieldname  = 'CARRID'.    " Fieldname in the data table
  wa_fieldcat-seltext_m  = 'Airline'.   " Column description in the output
  APPEND wa_fieldcat TO it_fieldcat.

  wa_fieldcat-fieldname  = 'CONNID'.
  wa_fieldcat-seltext_m  = 'Con. No.'.
  APPEND wa_fieldcat TO it_fieldcat.

  wa_fieldcat-fieldname  = 'FLDATE'.
  wa_fieldcat-seltext_m  = 'Date'.
  APPEND wa_fieldcat TO it_fieldcat.

  wa_fieldcat-fieldname  = 'BOOKID'.
  wa_fieldcat-seltext_m  = 'Book. ID'.
  APPEND wa_fieldcat TO it_fieldcat.

  wa_fieldcat-fieldname  = 'PASSNAME'.
  wa_fieldcat-seltext_m  = 'Passenger Name'.
  APPEND wa_fieldcat TO it_fieldcat.

*Build excluding table. Append the function codes of the icons to
*excluding table that you want to disable
  wa_excluding-fcode = '&ILT'.  " Function code for filter icon
  APPEND wa_excluding TO it_excluding.

*Pass data and field catalog to ALV function module to display ALV list
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program = g_repid
      it_fieldcat        = it_fieldcat
      it_excluding       = it_excluding
    TABLES
      t_outtab           = it_sbook
    EXCEPTIONS
      program_error      = 1
      OTHERS             = 2.

  What is Internal Table ?
  Events in Interactive Reports
  ALV Reports
  ALV Field Catalog in ABAP
  Simple ALV Report Example
  ABAP ALV Interactive Report
  ALV reports Interview Questions
  ABAP Debugger
 Creating Message Class Tutorial in SAP ABAP
 SAP and ABAP Memory Tutorial
 Creating Selection Screen Tutorial in SAP ABAP
 SAP ABAP Programming Example Tutorials for BeginnersSAP ABAP Tutorials
SAP ABAP Full Form

Comments

Popular posts from this blog

BADI Interview Questions in SAP ABAP

Sample SAP ABAP Programming Examples for Practice

Module Pool Programming Interview Questions and Answers in SAP ABAP

Step by Step tutorial on BDC Session Method Program in SAP ABAP

SAP ABAP Interview Questions and Answers for 10 Years Experienced