ZDEMO_FALV02 - Full screen with redefinitions
"! This is demo for FALV with redefinition of hotspot event handler
"! done by Lukasz Pegiel for http://abapblog.com
report zdemo_falv02.
data: sflight type standard table of sflight.
class lcl_test definition inheriting from zcl_falv.
public section.
protected section.
"redefinition of event handler
methods evt_hotspot_click redefinition.
private section.
endclass.
class lcl_test implementation.
method evt_hotspot_click.
case e_column_id-fieldname.
when 'SEATSMAX'.
call function 'POPUP_DISPLAY_MESSAGE'
exporting
titel = 'Hotspot is working' " Title
msgid = '00'
msgty = 'I'
msgno = '001'
msgv1 = 'Yupi!'.
endcase.
endmethod.
endclass.
start-of-selection.
select * up to 100 rows
into corresponding fields of table @sflight
from sflight.
"creation of falv with local redefinition
data falv type ref to lcl_test.
falv ?= lcl_test=>create( exporting i_subclass = cl_abap_classdescr=>describe_by_name( p_name = 'LCL_TEST' )
changing ct_table = sflight ) .
"Add hotspot to column 'SEATSMAX'
falv->column( 'SEATSMAX' )->set_hotspot( abap_true ).
"Add title variable
falv->title_v1 = 'ZDEMO_FALV02'.
"Display full screen grid
falv->display( ).