*$*$*.....CODE_ADD_1 - Begin..................................1..*$*$*
*
* In this section we will define the private methods which can
* be implemented to set the properties of the ALV and can be
* called in the
*
PRIVATE SECTION.
* Set the various column properties
METHODS:
set_hotspot_vbeln
CHANGING
co_alv TYPE REF TO cl_salv_table
co_report TYPE REF TO lcl_report.
*
* Event Handler for HOTSPOT event
METHODS:
on_link_click
FOR EVENT link_click OF cl_salv_events_table
IMPORTING
row
column .
*$*$*.....CODE_ADD_1 - End....................................1..*$*$*
*
*
*$*$*.....CODE_ADD_2 - Begin..................................2..*$*$*
*
* In this area we will call the methods which will set the
* different properties to the ALV
*
* Set Up the Hotspot & Event Handler
CALL METHOD set_hotspot_vbeln
CHANGING
co_alv = o_alv
co_report = lo_report.
*$*$*.....CODE_ADD_2 - End....................................2..*$*$*
*
*
*$*$*.....CODE_ADD_3 - Begin..................................3..*$*$*
*
* In this area we will implement the methods which are defined in
* the class definition
*
METHOD set_hotspot_vbeln.
*
*...HotSpot
DATA: lo_cols_tab TYPE REF TO cl_salv_columns_table,
lo_col_tab TYPE REF TO cl_salv_column_table.
*
* get Columns object
lo_cols_tab = co_alv->get_columns( ).
*
* Get VBELN column
TRY.
lo_col_tab ?= lo_cols_tab->get_column( 'VBELN' ).
CATCH cx_salv_not_found.
ENDTRY.
*
* Set the HotSpot for VBELN Column
TRY.
CALL METHOD lo_col_tab->set_cell_type
EXPORTING
value = if_salv_c_cell_type=>hotspot.
.
CATCH cx_salv_data_error .
ENDTRY.
*
*...Events
DATA: lo_events TYPE REF TO cl_salv_events_table.
*
* all events
lo_events = o_alv->get_event( ).
*
* event handler
SET HANDLER co_report->on_link_click FOR lo_events.
*
ENDMETHOD. "set_hotspot_vbeln
*
* Handles the UI on the VBELN (HotSpot)
METHOD on_link_click.
*
DATA: la_vbak TYPE ty_vbak.
*
* Get the Sales Order number from the table
READ TABLE lo_report->t_vbak INTO la_vbak INDEX row.
IF la_vbak-vbeln IS NOT INITIAL.
MESSAGE i398(00) WITH 'You have selected' la_vbak-vbeln.
ENDIF.
*
ENDMETHOD. "on_link_click
Serkan AKKAVAK
Computer Engineer
ABAP Developer & SAP MM SD Consultant
Contact : serkurumsal@yandex.com
Social Plugin