1 1 1 1 1 Rating 0% (0 Votes)
Tags: FALV
The latest version of each part of FALV can be found on github repository https://github.com/fidley/falv which you can use in abapGit for easier up to date handling. 
 
Second demo program shows how to use FALV when you want to use event handlers by your own. 
"All" events are handled so you just need to redefine proper method starting from evt_*
 

"! This is demo for FALV with redefinition of hotspot event handler
"! done by Lukasz Pegiel for http://abapblog.com
report zdemo_falv02.

datasflight 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=>createexporting  i_subclass cl_abap_classdescr=>describe_by_namep_name 'LCL_TEST' )
                              changing ct_table sflight    .

  "Add hotspot to column 'SEATSMAX'
  falv->column'SEATSMAX' )->set_hotspotabap_true ).
  "Add title variable
  falv->title_v1 'ZDEMO_FALV02'.
  "Display full screen grid
  falv->display).

Video with results of program: