Post on 09-Apr-2018
transcript
8/8/2019 ALV General Presentation
http://slidepdf.com/reader/full/alv-general-presentation 1/22
March 20th, 2001
ALV Grid ControlBenefits
How does it work
- grid list- interactive functions
How to create ALV Grid
Controls in 30 minutes
Step by Step
about Controls
ALV tree
8/8/2019 ALV General Presentation
http://slidepdf.com/reader/full/alv-general-presentation 2/22
March 20th, 2001
BenefitsALV Grid Control provides a set of generic functions (e.g. sorting,
filtering) for handling tabular data.
It provides a user interface which
takes advantage of control
technology enabling more
operations by mouse and
interaction with other controls.
(e.g. drag and drop)
The user is able to create variants
of list output by himself.
8/8/2019 ALV General Presentation
http://slidepdf.com/reader/full/alv-general-presentation 3/22
March 20th, 2001
Grid ListData: gt_outtab like ZFI_PAYMENTS occurs 0
with header line.
Select * into corresponding fields of table gt_outtab
from «.
Join ...
CALL METHOD
GRID1->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = ¶ ZFI_PAYMENTS '
CHANGING
IT_OUTTAB = GT_OUTTAB.
Data Definition
8/8/2019 ALV General Presentation
http://slidepdf.com/reader/full/alv-general-presentation 4/22
March 20th, 2001
Interactive functionality
Filtering
sorting
variants management
calculations: (sub-)totals, ABC analysis
download in various formats like Excel (incl.
pivot table), Word
The functionality is
built in and needs to be
activated via events
(toolbar, menu-button,
context menu, user-
command)
8/8/2019 ALV General Presentation
http://slidepdf.com/reader/full/alv-general-presentation 5/22
March 20th, 2001
Detail
8/8/2019 ALV General Presentation
http://slidepdf.com/reader/full/alv-general-presentation 6/22
March 20th, 2001
Filter
8/8/2019 ALV General Presentation
http://slidepdf.com/reader/full/alv-general-presentation 7/22
March 20th, 2001
Sort
8/8/2019 ALV General Presentation
http://slidepdf.com/reader/full/alv-general-presentation 8/22
March 20th, 2001
Variants
8/8/2019 ALV General Presentation
http://slidepdf.com/reader/full/alv-general-presentation 9/22
March 20th, 2001
Variant Management
8/8/2019 ALV General Presentation
http://slidepdf.com/reader/full/alv-general-presentation 10/22
March 20th, 2001
Totals
Select column which should be totalized. Click Icon.
8/8/2019 ALV General Presentation
http://slidepdf.com/reader/full/alv-general-presentation 11/22
March 20th, 2001
Sub totalSelect column
on which you
want sub-totals
and click thesub-total icon.
8/8/2019 ALV General Presentation
http://slidepdf.com/reader/full/alv-general-presentation 12/22
March 20th, 2001
8/8/2019 ALV General Presentation
http://slidepdf.com/reader/full/alv-general-presentation 13/22
March 20th, 2001
Download
8/8/2019 ALV General Presentation
http://slidepdf.com/reader/full/alv-general-presentation 14/22
8/8/2019 ALV General Presentation
http://slidepdf.com/reader/full/alv-general-presentation 15/22
March 20th, 2001
Spreadsheet
8/8/2019 ALV General Presentation
http://slidepdf.com/reader/full/alv-general-presentation 16/22
March 20th, 2001
How to create an ALV in 30
minutesThere are sample programs which
are good templates for new
programs. Prefix BCALV
For lists use
BCALV_FULLSCREEN_DEMO
which encapsulates ABAP-Objects
in a function module.
For controls within dynpros use the
other templates.
In R/3 4.0 - 4.5 there are ALV
templates using call-back
technique without controls.
Prefix BALV
8/8/2019 ALV General Presentation
http://slidepdf.com/reader/full/alv-general-presentation 17/22
March 20th, 2001
Step by stepCopy sample program (incl. User
Interface and Screens)
Create data structure in data-
dictionary
change sample structure to new
structure name
select_data needs to fill the
internal table gt_outtab
done
improve program by manipulating
gs_layout and gt_events
DATA: BEGIN OF gt_outtab OCCURS 0.
INCLUDE STRUCTURE zfi_payments.
DATA: END OF gt_outtab,
perform select_data.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTINGi_callback_program = g_repid
i_structure_name = 'zfi_payments'
is_layout = gs_layout
i_save = g_save
is_variant = gs_variant
it_events = gt_events[]
TABLES
t_outtab = gt_outtab
EXCEPTIONS
program_error = 1
OTHERS = 2.
8/8/2019 ALV General Presentation
http://slidepdf.com/reader/full/alv-general-presentation 18/22
March 20th, 2001
Typical enhancementsFieldcatalogue:
set Header,
dynamic (calculated) fields
set Toolbar, context-menu, «
Variants:
default variant
Events:
TOP_OF_PAGE: show title, parameters,..
BEFORE_LINE_OUTPUT: calculate dynamic
fields,set icons
click/double-click: get detail screens
new Functionality:
depending on application
Get a list of all methods and attributes of the
CL_GUI_ALV_GRID class in the class builder SE24
8/8/2019 ALV General Presentation
http://slidepdf.com/reader/full/alv-general-presentation 19/22
March 20th, 2001
Example add top-of-page event* sample from ZFI_PAYMENT_LIST
FORM comment_build USING lt_top_of_page TYPEslis_t_listheader.
DATA: ls_line TYPE slis_listheader.*
* LIST HEADING LINE: TYPE HCLEAR ls_line.
ls_line-typ = 'H'.* LS_LINE-KEY: NOT USED FOR THIS TYPE
ls_line-info = 'Payments'(100). APPEND ls_line TO lt_top_of_page.
ENDFORM
FORM top_of_page.CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTINGi_logo = 'ENJOYSAP_LOGO'
it_list_commentary = gt_list_top_of_page.
ENDFORM.
FORM eventtab_build USING rt_events TYPE slis_t_event.*"Registration of events to happen during list display
DATA: ls_event TYPE slis_alv_event.*
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'EXPORTING
i_list_type = 0IMPORTING
et_events = rt_events.
READ TABLE rt_events WITH KEY name = slis_ev_top_of_pageINTO ls_event.
IF sy-subrc = 0.
MOVE g_top_of_page TO ls_event-form. APPEND ls_event TO rt_events.
ENDIF.
ENDFORM.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'EXPORTING
i_callback_program = g_repidi_structure_name = 'zfi_payments'
is_layout = gs_layoutit_events = gt_events[]
8/8/2019 ALV General Presentation
http://slidepdf.com/reader/full/alv-general-presentation 20/22
8/8/2019 ALV General Presentation
http://slidepdf.com/reader/full/alv-general-presentation 21/22
March 20th, 2001
ALV Tree controlThe ALV tree provides a
similar program interface
like ALV Grid.
Sample ALV-Trees:
Transaction VTRK SEU navigation which is
docked to other Controls.
8/8/2019 ALV General Presentation
http://slidepdf.com/reader/full/alv-general-presentation 22/22
March 20th, 2001
ResourcesSAP Professional Journal November/December 2000 page 29: Developer¶s Guide to the new Grid Control
Sample Reports:
BCALV*
Transactions/programs using ALV:
VT01N ALV_TREE add deliveries to shipments via Drag and Drop
VTRK ALV_TREE changes context_menu depending on cursor position
VL02N holds the same control (header/parcel tracking)
VTRC ALV_GRID changes data-basis
Redefining the data-dictionary structure:
ALV caches the field-catalogue so it needs to be reset, when you change the data-dictionary structure.
Run BCALV_BUFFER_DELETE to do so.
Attention:
There is a note for the µreset buffer¶ program. It does not work for multiple application servers.
Workaround: When you cannot delete the buffer, rename the data-dictionary structure.