天天看点

SAP ABAP Webdynpro ALV的link to action的实现方法

SAP ABAP Webdynpro ALV的link to action的实现方法

(2) Double click the INTERFACECONTROLLER_USAGE,add your own component for ALVcomponent usage. The reason for this is you need to map the context node of your own component to ALV component, so that it can know which data from your application should display.

SAP ABAP Webdynpro ALV的link to action的实现方法
SAP ABAP Webdynpro ALV的link to action的实现方法
SAP ABAP Webdynpro ALV的link to action的实现方法
method RENDER_HYPERLINK .
  DATA:
    lr_alv_usage       TYPE REF TO if_wd_component_usage,
    lr_if_controller   TYPE REF TO iwci_salv_wd_table,
    lr_config          TYPE REF TO cl_salv_wd_config_table,
    lr_column_settings TYPE REF TO if_salv_wd_column_settings,
    lt_columns         TYPE        salv_wd_t_column_ref,
    lr_link            TYPE REF TO cl_salv_wd_uie_link_to_action.
   lr_alv_usage = wd_this->wd_cpuse_salv_wd_table( ).
   IF lr_alv_usage->has_active_component( ) IS INITIAL.
     lr_alv_usage->create_component( ).
   ENDIF.
   lr_if_controller = wd_this->wd_cpifc_salv_wd_table( ).
   lr_config        = lr_if_controller->get_model( ).
   lr_config->if_salv_wd_table_settings~set_cell_action_event_enabled( abap_false ).
   lr_column_settings ?= lr_config.
   lt_columns = lr_column_settings->get_columns( ).
   LOOP AT lt_columns ASSIGNING FIELD-SYMBOL(<column>).
      CASE <column>-id.
        WHEN 'INTERNAL_ID'.
          CREATE OBJECT lr_link.
          lr_link->set_text_fieldname( <column>-id ).
         <column>-r_column->set_cell_editor( lr_link ).
        WHEN OTHERS.
      ENDCASE.
   ENDLOOP.
endmethod.
      
SAP ABAP Webdynpro ALV的link to action的实现方法

继续阅读