一区二区三区日韩精品-日韩经典一区二区三区-五月激情综合丁香婷婷-欧美精品中文字幕专区

分享

SAP ABAP Webdynpro ALV的link to action的實(shí)現(xiàn)方法

 汪子熙 2020-08-28

If you include the standard webdynpro ALV component SALV_WD_TABLE into your own component, you could not directly change the ALV table column as usual. In ABAP Webdynpro an example of link to action element used in ALV looks like below. Once the column “Social Media Post ID” is clicked, it is expected our application could catch the event and implement our own event handling logic.

You could follow the steps below:

(1) Define the component usage to ALV component by double clicking your webdynpro component in SE80 and maintain the component usage in tab “Used Web Dynpro Components”

(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.

After that it is ready for mapping the context node of your component to the context node DATA of ALV component. You can achieve it via drag and drop or right click on DATA node, and choose “Define External Mapping” from context menu. After mapping is done, you could see the mapping path displayed below.

(3) double click on your view, and insert a new element “ViewContainerUIElement”, which acts as the container for ALV interface view to be embedded.

then double click on window, right click the ViewContainerUIElement and choose “Embed View”, include the ALV interface view from drop down list.

The final settings looks like below. Now you should already see the ALV in your application UI.

Create a new method in view controller and implement the code below:

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.

And call it in wddomodifyview of view controller:

METHOD wddomodifyview .
  CHECK first_time = abap_true.
  render_hyperlink( ).ENDMETHOD.

Note: according to sap help, the event ON_CLICK is only triggered if the method IF_SALV_WD_TABLE_SETTINGS~SET_CELL_ACTION_EVENT_ENABLED is set to FALSE Otherwise, the event ON_CELL_ACTION is triggered. (4) Create a event handler in view controller Methods tab. Choose the event name ON_CLICK from drop down list.

In the runtime, the selected item index and item value could be found in importing parameter R_PARAM:

    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類(lèi)似文章

    国产自拍欧美日韩在线观看| 欧美日韩一区二区综合| 黄色国产精品一区二区三区| 粉嫩国产一区二区三区在线| 免费在线观看激情小视频| 香蕉尹人视频在线精品| 成人精品一区二区三区在线| 亚洲一区二区精品福利| 天堂热东京热男人天堂| 日本午夜免费观看视频| 99国产一区在线播放| 国产成人午夜在线视频| 国产一级性生活录像片| 在线观看日韩欧美综合黄片| 欧美三级不卡在线观线看| 国产91麻豆精品成人区| 麻豆亚州无矿码专区视频| 欧美日韩国产黑人一区| 久久99青青精品免费观看| 好吊日成人免费视频公开| 内射精子视频欧美一区二区| 在线播放欧美精品一区| 亚洲午夜福利视频在线| 不卡在线播放一区二区三区| 国产日韩精品欧美综合区| 日韩一区二区三区在线日| 午夜精品国产一区在线观看| 日韩一区欧美二区国产| 日韩熟妇人妻一区二区三区| 日韩欧美国产亚洲一区| 麻豆国产精品一区二区三区| 草草草草在线观看视频| 五月天六月激情联盟网| 伊人久久青草地综合婷婷| 国产精品欧美一区二区三区| 成人免费视频免费观看| 精品偷拍一区二区三区| 丁香七月啪啪激情综合| 国产情侣激情在线对白| 国产高清视频一区不卡| 精品丝袜一区二区三区性色|