Professional Documents
Culture Documents
Dec-2008
Objectives
The participants will be able to :
Describe the features and advantages of ALV.
Describe the different function modules that should be used to properly produce a report
output in ALV.
Create simple ALV reports.
Format the layout of the ALV reports.
Dec-2008
Dec-2008
Advantages of ALV
Looks better.
User friendly
Filtering / Sorting
Layout Change / Save
Summation, Download to excel, E-Mail
Data can be open for input / change etc.
Dec-2008
ALV Features
Email
Change
Layout
Download to
Excel
Filtering
Sorting
Column
Heading
Row(s)
Selection
Dec-2008
Fields
Open For
Input
Dec-2008
ALV Programming
Three Approaches
Conventional (Using SAP Standard Function Modules).
Object Oriented (Using SAP Standard Classes and Methods).
Object model ( Using CL_SALV* classes ).
Dec-2008
Dec-2008
Dec-2008
Step 8 : Prepare the final internal table that needs to be passed to the ALV
function module and display report output, using the following ALV functions
modules:
REUSE_ALV_LIST_DISPLAY
Or
REUSE_ALV_GRID_DISPLAY
10
Dec-2008
Internal tables to be used in the program declared based on the above table
types:
DATA:
11
Dec-2008
CHANGING
cs_variant
( and the
* EXCEPTIONS
* WRONG_INPUT
=1
* NOT_FOUND
=2
* PROGRAM_ERROR
=3
* OTHERS
= 4.
12
Dec-2008
* I_TABNAME_HEADER
* I_TABNAME_ITEM
* IT_DEFAULT_FIELDCAT
* I_SAVE
=''
* I_DISPLAY_VIA_GRID
=''
* IMPORTING
* E_EXIT
* ES_VARIANT
* EXCEPTIONS
* NOT_FOUND
=1
* PROGRAM_ERROR
=2
* OTHERS
= 3.
13
Dec-2008
=''
CHANGING
cs_variant
* EXCEPTIONS
* WRONG_INPUT
* NOT_FOUND
=1
=2
* PROGRAM_ERROR
* OTHERS
14
=3
= 4.
Dec-2008
Step 3 continued .
15
Dec-2008
16
Dec-2008
17
Dec-2008
18
Dec-2008
19
Dec-2008
20
Dec-2008
21
Dec-2008
22
Dec-2008
23
Dec-2008
24
Dec-2008
25
Dec-2008
26
Dec-2008
27
Dec-2008
E_EXIT_CAUSED_BY_CALLER
I_CALLBACK_USER_COMMAND
ES_EXIT_CAUSED_BY_USER
I_STRUCTURE_NAME
IS_LAYOUT
IT_FIELDCAT
IT_EXCLUDING
IT_SPECIAL_GROUPS
IT_SORT
IT_FILTER
IS_SEL_HIDE
I_DEFAULT
REUSE_ALV_GRID_DISPLAY
EXPORTING
REUSE_ALV_LIST_DISPLAY
IMPORTING
TABLES
T_OUTTAB
I_SAVE
IS_VARIANT
IS_PRINT
28
Dec-2008
= 'SFLIGHT'
TABLES
T_OUTTAB
29
= I_SFLIGHT.
Dec-2008
Result: REUSE_ALV_LIST_DISPLAY
30
Dec-2008
Demonstration
Creation of a simple ALV list report using the function module
REUSE_ALV_LIST_DISPLAY.
31
Dec-2008
Practice
Creation of a simple ALV list report using the function module
REUSE_ALV_LIST_DISPLAY.
32
Dec-2008
= 'SFLIGHT'
TABLES
T_OUTTAB
33
= I_SFLIGHT.
Dec-2008
Result : REUSE_ALV_GRID_DISPLAY
34
Dec-2008
Demonstration
Create a simple ALV grid report using the function module
REUSE_ALV_GRID_DISPLAY
35
Dec-2008
Practice
Create a simple ALV grid report using the function module
REUSE_ALV_GRID_DISPLAY
36
Dec-2008
Title
37
Dec-2008
wa_fcat-fieldname = 'CURRENCY'.
wa_fcat-no_out = 'X'.
wa_fcat-cfieldname = CURRENCY.
Wa_fcat-ctabname = SFLIGHT.
APPEND wa_fcat TO i_fcat.
wa_fcat-fieldname = 'PLANETYPE'.
wa_fcat-no_out = 'X'.
APPEND wa_fcat TO i_fcat.
wa_fcat-col_pos = '4'.
wa_fcat-fieldname = 'PRICE'.
APPEND wa_fcat TO i_fcat.
38
Dec-2008
Result :
PRICE
CONNID
FLDATE
CARRID
39
Dec-2008
Demonstration
Creating a simple ALV report by populating the field catalog table, using the
function module REUSE_ALV_GRID_DISPLAY.
40
Dec-2008
Practice
Creating a simple ALV report by populating the field catalog table, using the
function module REUSE_ALV_GRID_DISPLAY.
41
Dec-2008
42
" set_pf_status
Dec-2008
43
Dec-2008
= 'SFLIGHT'
I_CALLBACK_PROGRAM
= 'Y_DEMO_ALV_GRID'
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
IT_FIELDCAT = i_fcat
I_GRID_TITLE
= 'Flight Information'
TABLES
T_OUTTAB
44
= I_SFLIGHT.
Dec-2008
Custom Button
for adding extra
functionality
45
Dec-2008
Demonstration
Creating a simple ALV report by changing the default status bar, using the
function module REUSE_ALV_GRID_DISPLAY.
46
Dec-2008
Practice
Creating a simple ALV report by changing the default status bar, using the
function module REUSE_ALV_GRID_DISPLAY.
47
Dec-2008
48
Dec-2008
To make PRICE
field editable
49
Dec-2008
50
Dec-2008
Demonstration
Creating a simple ALV report by making one of its column editable, using the
function module REUSE_ALV_GRID_DISPLAY.
51
Dec-2008
Practice
Creating a simple ALV report by making one of its column editable, using the
function module REUSE_ALV_GRID_DISPLAY.
52
Dec-2008
Summary
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.
ALV report has several inbuilt User Friendly properties as:
Filtering / Sorting
Layout Change / Save
Summation, Download to excel, E-Mail
Data can be open for input / change etc.
Status STANDARD of the main program SAPLKKBL is copied and then changed
to create a new customized GUI status for any ALV report.
53
Dec-2008
Questions
What is ALV ?
What are the main differences between an ALV report and a classical report?
What are the main function modules used to create an ALV List?
What are the main differences between ALV list and ALV grid?
What are the different ways to populate the FIELD CATALOG table?
How can we change the default status bar of an ALV List?
How can we handle custom function code in ALV ?
How can we make a certain columns of an ALV list editable?
54
Dec-2008