Skip to Content
author's profile photo
Former Member

Dynamic Navigation not working correctly

Hi All,

In the Interaction Record screen of IC_AUTO busioness role, my requirement is to dynamically navigate to the Sales complaint/ Service Complaint/ Service Request screen when I click on the followup button.

My problem is when i write code for dynamic navigation in the event method, instead of the respective create page, it takes me to the search page. My code is:

CALL METHOD cl_crm_ui_descriptor_obj_srv=>create_ui_object_based

EXPORTING

iv_ui_object_type = 'BT120_CPL' " For creating Sales Complaint page, value taken from Generic O/p Mapping

iv_ui_object_action = 'D' option in the navigation bar profile. Action 'D' is for create

RECEIVING

rr_result = lr_nav_descr.

CHECK lr_nav_descr IS BOUND.

lr_navigation = cl_crm_ui_navigation_service=>get_instance( ).

CHECK lr_navigation IS BOUND.

" Check whether navigation is supported

IF lr_navigation->is_dynamic_nav_supported( lr_nav_descr ) NE abap_true.

return.

ELSE.

CREATE OBJECT lr_coll.

lr_coll->if_bol_bo_col~add( iv_entity = lr_nav_descr ).

lr_coll->if_bol_bo_col~add( iv_entity = lr_ui_entity ).

lr_coll->if_bol_bo_col~add( iv_entity = lr_partnerset ).

  • create_new( EXPORTING iv_proc_type = <ref>-PROCESS_TYPE ).

lr_navigation->navigate_dynamically( lr_coll ).

endif.

Please suggest any solution.

Regards,

Litty Joseph

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Mar 14, 2012 at 07:36 AM

    Hello Litty.

    I would suggest to debug IP_CREATE method in BT120M_CPL/MainWindow. There you will find an info which you should pass through collection in order to create Complain. It seems that you're passing not correct info to collection.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello together,

      I have two ideas:

      - You have to be sure that the lr_nav_descr is at the first position at the collection.

      - Check the customizing for your navigation profile. You're target have to be defined at the generic op mapping

      - Here is an example with a dynamic navigation to business partner

      METHOD eh_ontoaccount.

      " Deklaration

      CONSTANTS:

      lc_action_show TYPE crmt_ui_actions VALUE 'B'.

      DATA:

      lr_searchcriteria TYPE REF TO if_bol_bo_property_access,

      lr_nav_descr TYPE REF TO if_bol_bo_property_access,

      lr_partner_search TYPE REF TO cl_crm_bol_query_service,

      lr_partner_col TYPE REF TO if_bol_entity_col,

      lr_partner_entity TYPE REF TO cl_crm_bol_entity,

      lr_bol_core TYPE REF TO cl_crm_bol_core,

      lr_nav_service TYPE REF TO if_crm_ui_navigation_service,

      lv_partner TYPE bu_partner.

      " Starte Komponenten Set für Geschäftspartner,

      " damit die Suche nach diesen ausgeführt werden kann.

      lr_bol_core = cl_crm_bol_core=>get_instance( ).

      IF lr_bol_core IS NOT BOUND.

      RETURN. " TODO: Nachrichtenausgabe

      ENDIF.

      lr_bol_core->load_component_set( iv_component_set_name = 'BP_APPL' ).

      " Holte den Wertknoten für die Suchkriterien und

      " ermittlet die Partnernummer

      lr_searchcriteria ?= me->typed_context->searchcriteria->collection_wrapper->get_current( ).

      IF lr_searchcriteria IS NOT BOUND.

      RETURN. " TODO: Nachrichtenausgabe

      ENDIF.

      lr_searchcriteria->get_property_as_value( EXPORTING iv_attr_name = 'PARTNER' "#EC_NOTEXT

      IMPORTING ev_result = lv_partner ).

      IF lv_partner IS INITIAL.

      RETURN. " TODO: Nachrichtenausgabe

      ENDIF.

      " Geschäftspartnersuchobjekt holen

      lr_partner_search = cl_crm_bol_query_service=>get_instance( iv_query_name = 'BuilHeaderSearch' ).

      IF lr_partner_search IS NOT BOUND.

      RETURN. " TODO: Nachrichtenausgabe

      ENDIF.

      " Suchparameter befüllen

      lr_partner_search->set_property( iv_attr_name = 'PARTNER'

      iv_value = lv_partner ).

      " Suche ausführen

      lr_partner_col = lr_partner_search->get_query_result( ).

      IF lr_partner_col IS NOT BOUND.

      RETURN. " TODO: Nachrichtenausgabe

      ENDIF.

      " Ermittle den gefundenen Partner (Es kann nur einer sein)

      lr_partner_entity = lr_partner_col->get_first( ).

      IF lr_partner_entity IS NOT BOUND.

      RETURN. " TODO: Nachrichtenausgabe

      ENDIF.

      " Erstelle eine dynamisches Navigationsobjekt anhand der Partner Entität

      CALL METHOD cl_crm_ui_descriptor_obj_srv=>create_entity_based

      EXPORTING

      ir_entity = lr_partner_entity

      iv_ui_object_action = lc_action_show

      RECEIVING

      rr_result = lr_nav_descr.

      IF lr_nav_descr IS NOT BOUND.

      RETURN. " TODO: Nachrichtenausgabe

      ENDIF.

      " Füge das Navigationsobjekt an ERSTER stelle in die Ergebniscollection ein.

      lr_partner_col->if_bol_bo_col~insert( iv_bo = lr_nav_descr

      iv_index = 1 ).

      " Registriere die aktuelle Seite, damit auf diese zurücknavigiert werden kann

      RAISE EVENT history_trigger.

      " Führe die Navigation aus.

      lr_nav_service = cl_crm_ui_navigation_service=>get_instance( ).

      lr_nav_service->navigate_dynamically( iv_data_collection = lr_partner_col ).

      ENDMETHOD.

      METHOD eh_ontoorder.

      " Deklaration

      CONSTANTS:

      lc_action_show TYPE crmt_ui_actions VALUE 'B'.

      DATA:

      lr_searchcriteria TYPE REF TO if_bol_bo_property_access,

      lr_nav_descr TYPE REF TO if_bol_bo_property_access,

      lr_order_search TYPE REF TO cl_crm_bol_query_service,

      lr_order_col TYPE REF TO if_bol_entity_col,

      lr_order_entity TYPE REF TO cl_crm_bol_entity,

      lr_bol_core TYPE REF TO cl_crm_bol_core,

      lr_nav_service TYPE REF TO if_crm_ui_navigation_service,

      lv_orderid TYPE crmt_order_id.

      " Starte Komponenten Set für Geschäftspartner,

      " damit die Suche nach diesen ausgeführt werden kann.

      lr_bol_core = cl_crm_bol_core=>get_instance( ).

      IF lr_bol_core IS NOT BOUND.

      RETURN. " TODO: Nachrichtenausgabe

      ENDIF.

      lr_bol_core->load_component_set( iv_component_set_name = 'BT' ).

      " Holte den Wertknoten für die Suchkriterien und

      " ermittlet die Partnernummer

      lr_searchcriteria ?= me->typed_context->searchcriteria->collection_wrapper->get_current( ).

      IF lr_searchcriteria IS NOT BOUND.

      RETURN. " TODO: Nachrichtenausgabe

      ENDIF.

      lr_searchcriteria->get_property_as_value( EXPORTING iv_attr_name = 'ORDERID' "#EC_NOTEXT

      IMPORTING ev_result = lv_orderid ).

      IF lv_orderid IS INITIAL.

      RETURN. " TODO: Nachrichtenausgabe

      ENDIF.

      " Geschäftspartnersuchobjekt holen

      lr_order_search = cl_crm_bol_query_service=>get_instance( iv_query_name = 'BTQuery1O' ).

      IF lr_order_search IS NOT BOUND.

      RETURN. " TODO: Nachrichtenausgabe

      ENDIF.

      " Suchparameter befüllen

      lr_order_search->set_property( iv_attr_name = 'OBJECT_ID'

      iv_value = lv_orderid ).

      " Suche ausführen

      lr_order_col = lr_order_search->get_query_result( ).

      IF lr_order_col IS NOT BOUND.

      RETURN. " TODO: Nachrichtenausgabe

      ENDIF.

      " Ermittle den gefundenen Partner (Es kann nur einer sein)

      lr_order_entity = lr_order_col->get_first( ).

      IF lr_order_entity IS NOT BOUND.

      RETURN. " TODO: Nachrichtenausgabe

      ENDIF.

      " Erstelle eine dynamisches Navigationsobjekt anhand der Partner Entität

      CALL METHOD cl_crm_ui_descriptor_obj_srv=>create_entity_based

      EXPORTING

      ir_entity = lr_order_entity

      iv_ui_object_action = lc_action_show

      RECEIVING

      rr_result = lr_nav_descr.

      IF lr_nav_descr IS NOT BOUND.

      RETURN. " TODO: Nachrichtenausgabe

      ENDIF.

      " Füge das Navigationsobjekt an ERSTER stelle in die Ergebniscollection ein.

      lr_order_col->if_bol_bo_col~insert( iv_bo = lr_nav_descr

      iv_index = 1 ).

      " Registriere die aktuelle Seite, damit auf diese zurücknavigiert werden kann

      RAISE EVENT history_trigger.

      " Führe die Navigation aus.

      lr_nav_service = cl_crm_ui_navigation_service=>get_instance( ).

      lr_nav_service->navigate_dynamically( iv_data_collection = lr_order_col ).

      ENDMETHOD.

  • Mar 14, 2012 at 09:03 AM

    Hi Litty,

    I've done something similar to navigate dinamically to Service tickets and Service Requests, at Interaction Record.

    At view ICCMP_BT_FOUP/CreateFollowUp, at EH_ONCREATEFOLLOWUP I use something like this after calling super method:

    *- Data dictionary
    DATA lr_cuco TYPE REF TO cl_iccmp_bt_bspwdcompone4_impl.
    DATA lr_successor TYPE REF TO cl_crm_bol_entity.
    DATA lr_col TYPE REF TO if_bol_bo_col
    DATA lr_nav TYPE REF TO if_crm_ui_navigation_service.

    *- Get Sucessor entity
    lr_cuco ?= me->comp_controller.
    lr_successor ?= lr_cuco->typed_context->successor->collection_wrapper->get_current( ).

    *- Prepare and navigate
    CREATE OBJECT lr_col TYPE cl_crm_bol_bo_col.
    lr_col->add( iv_entity = lr_successor iv_set_focus = abap_true ).

    CALL METHOD cl_crm_uiu_bt_navigate=>prepare_col_for_navigate
    EXPORTING
    ir_collection = lr_col
    iv_ui_action = 'C'
    EXCEPTIONS
    no_nav_descriptor_inserted = 1
    OTHERS = 2.

    lr_nav = cl_crm_ui_navigation_service=>get_instance( ).
    lr_nav->navigate_dynamically( lr_col ).


    Check if it helps you a little more.

    Kind regards,
    Garcia


    Add comment
    10|10000 characters needed characters exceeded