SAP WebClient UI One Hit Navigation的實現方法

i042416發表於2020-08-28

One hit navigation means if only one result found during search, the detail page of that search result entity will be opened automatically without user manual action.

See example below: after search button is clicked, the detail page of 201300024454 will be opened automatically.


SAP WebClient UI One Hit Navigation的實現方法 SAP WebClient UI One Hit Navigation的實現方法


You could follow the below steps to achieve:

(1) You must enable one hit navigation behavior for your business role.


SAP WebClient UI One Hit Navigation的實現方法


double click “Parameter Assignment”:


SAP WebClient UI One Hit Navigation的實現方法


add a new parameter ONE_HIT_DIRECT_DISPLAY with value TRUE


SAP WebClient UI One Hit Navigation的實現方法


(2) Implement your search button event handler as below.

Usenavigate_if_result_is_unique to trigger the potential navigation.

method EH_ONSEARCH.
    DATA: lv_result            TYPE REF TO if_bol_entity_col,
          lr_comp              TYPE REF TO CL_ZONEHITN_BSPWDCOMPONEN_IMPL,
          lv_onehit_navigation TYPE abap_bool.
    lr_comp ?= me->comp_controller.
    lv_result = zcl_jerry_tool=>get_query_results( me->typed_context->search->collection_wrapper ).
    IF cl_crm_uiu_one_hit_direct_nav=>navigate_if_result_is_unique( iv_value_help_mode = abap_false
                                                                    ir_result_col      = lv_result ) = abap_false.
       lr_comp->typed_context->searchresult->collection_wrapper->set_collection( lv_result ).
    ENDIF.
  endmethod.

You should put the detail page of search result into a separate UI component and include it into search component via component usage. Expose its main window as interface view and inbound plug, so that one search result is unique, the detail page of that component could be chose and navigated via UI framework.


SAP WebClient UI One Hit Navigation的實現方法


(3) Create an entry for the detail component in “Define Work Area Component Repository“:


SAP WebClient UI One Hit Navigation的實現方法 SAP WebClient UI One Hit Navigation的實現方法


(4) Define Navigation Bar Profile:


SAP WebClient UI One Hit Navigation的實現方法


choose Navigation bar profile TPM-PRO, double click on “Define Generic Outbound Plug Mappings”:


SAP WebClient UI One Hit Navigation的實現方法


Configure the target ID defined in step3 here


SAP WebClient UI One Hit Navigation的實現方法


Now you could test in UI.

要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":

SAP WebClient UI One Hit Navigation的實現方法


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2715429/,如需轉載,請註明出處,否則將追究法律責任。

相關文章