Escolar Documentos
Profissional Documentos
Cultura Documentos
ALV
ABAP List Viewer (ALV) is a simple, user friendly and better looking reporting tool as compared to the usage of write statements in a conventional / interactive report.
Advantages of ALV
Better Looking User friendly
-
Filtering / Sorting Layout Change / Save Summation, Download to excel, E-Mail Data can be open for input / change etc.
Better Event handling Width of more than 256 characters possible Programming overhead of mentioning exact positions in write statements not needed.
ALV Features
Heading
Row(s) Selection
ALV Features
Bar Charts
ALV Programming
Two Approaches
-
Conventional (Using Standard Function Modules) Object Oriented (Using Standard Classes and Methods)
Program: BALVSD02
|
Program: BALVSD02_GRID
Copyright IBM Corporation 2003
Both REUSE_ALV_LIST_DISPLAY and REUSE_ALV_GRID_DISPLAY have similar parameters Both Display the contents of an internal table passed by the parameter T_OUTTAB
I_CALLBACK_PROGRAM
The program that contains the subroutine for user command handling The program that will be the reference for user specific layout variants SY-CPROG in most cases
I_CALLBACK_PF_STATUS_SET
The subroutine name that will set the PF-STATUS (which in turn may contain user defined buttons)
I_CALLBACK_USER_COMMAND
The subroutine name in the calling program that will be triggered on any user command
I_STRUCTURE_NAME
The type of the internal table to be displayed
I_GRID_TITLE
The Heading / Title of the GRID
IS_LAYOUT
Defines the layout in which the internal table will be displayed Layout specific Features like Optimize Column Width, Window Title Bar, No Summing Up, colors etc. are defined here
IT_FIELDCAT
Defines the properties of individual fields (columns) of the internal table to be displayed Field specific features like Editable / Non Editable, Heading, Column Position, Left / Right Justification etc. are defined here
IT_EXCLUDING
The Buttons / Function codes that need to be disabled
I_SAVE
Whether Users should be able to save layout variants of their choice
IT_EVENTS
The various which need to be trapped and dealt with
Data: i_sflight type standard table of sflight initial size 0 with header line. Select * from sflight into table i_sflight. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING I_CALLBACK_PROGRAM = sy-cprog I_STRUCTURE_NAME = 'SFLIGHT' TABLES T_OUTTAB = i_sflight.
Result
Heading
data: i_fcat type slis_t_fieldcat_alv, wa_fcat type slis_fieldcat_alv. wa_fcat-tabname = 'I_SFLIGHT'. wa_fcat-col_pos = '1'. wa_fcat-fieldname = 'CARRID'. append wa_fcat to i_fcat. wa_fcat-col_pos = '2'. wa_fcat-fieldname = 'FLDATE'. append wa_fcat to i_fcat. wa_fcat-col_pos = '3'. wa_fcat-fieldname = 'CONNID'. append wa_fcat to i_fcat. wa_fcat-col_pos = '4'. wa_fcat-fieldname = 'PRICE'. append wa_fcat to i_fcat.
|
wa_fcat-fieldname = 'CURRENCY'. wa_fcat-no_out = 'X'. append wa_fcat to i_fcat. wa_fcat-fieldname = 'PLANETYPE'. wa_fcat-no_out = 'X'. append wa_fcat to i_fcat.
Result
Result
Result
PRICE (Editable)
Important Information
Use Programs Starting with BALV and BCALV Use Function Module Helps
Questions?