cancel
Showing results for 
Search instead for 
Did you mean: 

Navigation Issue from a popup window

Former Member
0 Kudos


Hello SAP gurus,

I have an issue related to the navigation from a popup window.

I want to navigate from the button modify through a confirmation Popup to the view ICCMP_SURVEY/Survey, after the user has confimed the Navigation with OK.

So let'say that the user select ACE Fragenbogen Consulting and then it comes the following popup:

But then I get lost as I cannot navigate through the view ICCMP_SURVEY/Survey.

I have redefined the Event EH_ONSELECT on the view ICCMP_SURVEY/SurveyOverview in the following way:

data:

    LV_TITLE type STRING,

    LV_TEXT  type STRING.

  if ZCONFIRM_POPUP is not bound.

    LV_TITLE = 'Confirmation Popup'.

    LV_TEXT = 'Sie haben den Consulting Fragebogen ausgewählt!'.

    call method COMP_CONTROLLER->WINDOW_MANAGER->CREATE_POPUP_2_CONFIRM

      exporting

        IV_TITLE          = LV_TITLE

        IV_TEXT           = LV_TEXT

        IV_BTNCOMBINATION = IF_BSP_WD_WINDOW_MANAGER=>CO_BTNCOMB_OKCANCEL

*        IV_CUSTOMBUTTONS  =

      receiving

        RV_RESULT         = ZCONFIRM_POPUP
       .

    ZCONFIRM_POPUP->SET_ON_CLOSE_EVENT( IV_EVENT_NAME = 'CONFIRM_POPUP_CLOSED' IV_VIEW = ME )."#EC NOTEXT

  endif.

  ZCONFIRM_POPUP->OPEN( ).

Then I have define the event EH_ONCONFIRM_POPUP_CLOSED in the following way:

DATA: lv_answer TYPE string,

        lv_save_result TYPE abap_bool,

        lr_application TYPE REF TO cl_crm_bol_entity,

        lr_tx TYPE REF TO if_bol_transaction_context,



        lr_coco TYPE REF TO cl_crmcmp_g_bspwdcompone0_impl.

  INCLUDE: crm_object_types_con.



* Retrieve the answer

* this is where you can tell which button has been hold

  lv_answer = Zconfirm_popup->get_fired_outbound_plug( ).

  CASE lv_answer.

    WHEN cl_gs_ptc_bspwdcomponent_cn01=>co_event_yes.

*   view_manager->navigate( source_rep_view = rep_view

*

*                   outbound_plug = 'NAVIGATIONLINK' ).

*  CHECK lr_window IS BOUND.

*  lr_window->call_outbound_plug( 'Survey_Detail' ).

*      op_surveydetail( ).

    WHEN cl_gs_ptc_bspwdcomponent_cn01=>co_event_no.

    WHEN OTHERS.

  ENDCASE.
endmethod.

But  I still miss a very important point to define within the method 'CONFIRM_POPUP_CLOSED': the navigation.

In fact I do not know if I have to define a navigational link or I can call direct an OP via component Controller.

Sure that anybody has solved this issue. Any help is welcomed.

Regards,

Andrea

Accepted Solutions (0)

Answers (1)

Answers (1)

deepika_chandrasekar
Active Contributor
0 Kudos

HI,

You have to create navigation link TosurveyOV for your navigation with source view and target view.

Create outbound plug in your view and in mainwindow.

in View outbound plug call the main windiw outbound plug. then in mainwindow outbound plug call the navigation link

View outbound plug op_tosurveyov..

DATA: lr_wdw        TYPE REF TO cl_bsp_wd_window.

  lr_wdw = me->view_manager->get_window_controller( ).
  lr_wdw->call_outbound_plug( iv_outbound_plug = 'TOSURVEYOV'
                              iv_data_collection = iv_data_collection ).

you have to call this outbound plug in your close popup method

In mainwindow outbound plug op_tosurveyov

me->fire_outbound_plug( 'TOSURVEYOV' ).

Regards,

Deepika.

Former Member
0 Kudos

Hello Deepika,

just a question before proceeding. If I have to create a navigational link I Need as well an Inbound Plug. Why am I supposed to create two OP?

Regards,

Andrea

deepika_chandrasekar
Active Contributor
0 Kudos

Hi,

You have to create inbound plug in target view . in Source view that is where you have popup close event you have to create outbound plug and call the navigation link.

Check navigation guide document how you need to do this. you dont need to create two outbound plugs when navigation is in same component

You can see many such navigation link calls in standard components.

Regards,

Deepika.

Former Member
0 Kudos

Hi Deepika,

what sort of code am I supposed to call from my method 'CONFIRM_POPUP_CLOSED'?

A navigational link or an OP ?

Thanks a lot.

Andrea

Former Member
0 Kudos

Hi Deepika,

I have followed your piece of advice. I have created the following:

- OP "OP_XTOSURVEY" within the view ICCMP_SURVEY/SurveyOverview with the following code:

  DATA: lr_wdw        TYPE REF TO cl_bsp_wd_window.
  lr_wdw = me->view_manager->get_window_controller( ).
  lr_wdw->call_outbound_plug( iv_outbound_plug = 'TOSURVEYOV'
                              iv_data_collection = iv_data_collection ).

- OP "OP_TOSURVEYOV" within the window ICCMP_SURVEY/MainWindow with the following code:

  me->fire_outbound_plug( 'TOSURVEYOV' ).

-  IP "IP_TODETAILS" within the view ICCMP_SURVEY/Survey. There is no code here.

- Navigational link TosurveyOV between ICCMP_SURVEY/MainWindow - "OP_TOSURVEYOV" (source) and ICCMP_SURVEY/Survey - "IP_TODETAILS" (Target)

- Updated of the event EH_ONCONFIRM_POPUP_CLOSED. The code is below:

DATA: lv_answer TYPE string,

        lv_save_result TYPE abap_bool,

        lr_application TYPE REF TO cl_crm_bol_entity,

        lr_tx TYPE REF TO if_bol_transaction_context,

        lr_coco TYPE REF TO cl_crmcmp_g_bspwdcompone0_impl.

  INCLUDE: crm_object_types_con.

* Retrieve the answer

  lv_answer = Zconfirm_popup->get_fired_outbound_plug( ).


  CASE lv_answer.

    WHEN cl_gs_ptc_bspwdcomponent_cn01=>co_event_yes.

   view_manager->navigate( source_rep_view = rep_view

                   outbound_plug = 'TosurveyOV' ).


    WHEN cl_gs_ptc_bspwdcomponent_cn01=>co_event_no.

But I still miss something, since I am not able to navigate.

Regards,

Andrea

deepika_chandrasekar
Active Contributor
0 Kudos

Hi,

Try the below code and check.

in close event put this code

DATA: lv_answer TYPE string,

        lv_save_result TYPE abap_bool,

        lr_application TYPE REF TO cl_crm_bol_entity,

        lr_tx TYPE REF TO if_bol_transaction_context,

        lr_coco TYPE REF TO cl_crmcmp_g_bspwdcompone0_impl.

  INCLUDE: crm_object_types_con.

* Retrieve the answer

  lv_answer = Zconfirm_popup->get_fired_outbound_plug( ).


  CASE lv_answer.

    WHEN cl_gs_ptc_bspwdcomponent_cn01=>co_event_yes.

   op_tosurveyov( ).


    WHEN cl_gs_ptc_bspwdcomponent_cn01=>co_event_no.

Then in op_tosurveyov outbound plug put the below code

view_manager->navigate(

          source_rep_view = rep_view

          outbound_plug   = 'TosurveyOV' )."navigation link call

No need to code in window outbound plug.

Regards,

Deepika.


Former Member
0 Kudos

  DATA : lr_view  TYPE REF TO  ZL_ICCMP_SU_SURVEY_IMPL.
   TRY.
      lr_view ?= get_subcontroller_by_viewname( 'ICCMP_SURVEY/Survey' ).
    CATCH cx_sy_move_cast_error.
  ENDTRY.
  CHECK lr_view IS NOT INITIAL.
  lr_view->IP_TODETAILS( ).

 

- Navigational link TosurveyOV between ICCMP_SURVEY/MainWindow - "OP_TOSURVEYOV" (source) and ICCMP_SURVEY/Survey - "IP_TODETAILS" (Target) is created.

- The event EH_ONCONFIRM_POPUP_CLOSED shows the following code:

DATA: lv_answer TYPE string,
        lv_save_result TYPE abap_bool,
        lr_application TYPE REF TO cl_crm_bol_entity,
        lr_tx TYPE REF TO if_bol_transaction_context,
        lr_coco TYPE REF TO cl_crmcmp_g_bspwdcompone0_impl.

  INCLUDE: crm_object_types_con.
DATA: lr_wdw        TYPE REF TO cl_bsp_wd_window.

* Retrieve the answer

* this is where you can tell which button has been hold

  lv_answer = Zconfirm_popup->get_fired_outbound_plug( ).

  CASE lv_answer.

WHEN 'OK'.
OP_XTOSURVEY( ).

But now I am getting the following dump when I try to navigate:

I think there is something missing within the Runtime repository.

Regards,

Andrea

deepika_chandrasekar
Active Contributor
0 Kudos

Hi,

In runtime repository under SurveyOverviewWindow view Survey is not included.

You have follow different way to navigate

In event handler put this code

DATA: lv_answer TYPE string,

        lv_save_result TYPE abap_bool,

        lr_application TYPE REF TO cl_crm_bol_entity,

        lr_tx TYPE REF TO if_bol_transaction_context,

        lr_coco TYPE REF TO cl_crmcmp_g_bspwdcompone0_impl.

  INCLUDE: crm_object_types_con.

* Retrieve the answer

  lv_answer = Zconfirm_popup->get_fired_outbound_plug( ).


  CASE lv_answer.

    WHEN cl_gs_ptc_bspwdcomponent_cn01=>co_event_yes.

   op_xtosurvey( ).


    WHEN cl_gs_ptc_bspwdcomponent_cn01=>co_event_no.

View outbound plug op_xtosurvey

DATA: lr_wdw        TYPE REF TO cl_bsp_wd_window.

  lr_wdw = me->view_manager->get_window_controller( ).
  lr_wdw->call_outbound_plug( iv_outbound_plug = 'TOSURVEY'
                              iv_data_collection = iv_data_collection ).

Create one more OP in MainWindow

OP "OP_TOSURVEY" within the window ICCMP_SURVEY/MainWindow with the following code:

fire_outbound_plug( 'TosurveyOV' )


One more thing is for navigation between SurveyOverview and Survey you have to cretae navigation link with Source View  ICCMP_SURVEY/SurveyOverview and target view   ICCMP_SURVEY/Survey.

Check whether this works or not.

Regards,

Deepika.

Former Member
0 Kudos

Hallo Deepika,

I finally solved my issue. I have configured the methods and events in the following way:

View ICCMP_SURVEY/SurveyOverview. Here I have coded the following:

method OP_XTOSURVEY.

DATA lr_window TYPE REF TO cl_bsp_wd_window.
  lr_window ?= me->view_manager->get_window_controller( ).
  CHECK lr_window IS BOUND.
  lr_window->call_outbound_plug( 'Survey_Detail' ).

Event EH_ONSELECT

data:

      LV_TITLE type STRING,

      LV_TEXT  type STRING,

    current TYPE REF TO if_bol_bo_property_access,

   lcl_entity  TYPE REF TO if_bol_bo_property_access,

   lv_frageid TYPE CRM_SVY_DB_SID.

*  me->typed_context->SURVEYUI->collection_wrapper->SET_COLLECTION.

  lcl_entity = typed_context->SURVEYUI->collection_wrapper->get_current( ).

  current ?= lcl_entity.

  current->get_property_as_value( EXPORTING iv_attr_name = 'SURVEYID' IMPORTING ev_result = lv_frageid ).

  if ZCONFIRM_POPUP is not bound.

    LV_TITLE = 'Confirmation Popup'.
    LV_TEXT = 'Sie haben den Outsourcing Fragebogen ausgewählt!'.
    CALL METHOD COMP_CONTROLLER->WINDOW_MANAGER->CREATE_POPUP_2_CONFIRM
      EXPORTING
        IV_TITLE          = LV_TITLE
        IV_TEXT           = LV_TEXT
        IV_BTNCOMBINATION = IF_BSP_WD_WINDOW_MANAGER=>CO_BTNCOMB_OKCANCEL
      RECEIVING
        RV_RESULT         = ZCONFIRM_POPUP.


    ZCONFIRM_POPUP->SET_ON_CLOSE_EVENT( IV_EVENT_NAME = 'CONFIRM_POPUP_CLOSED' IV_VIEW = ME ). "#EC NOTEXT

  endif.

  ZCONFIRM_POPUP->OPEN( ).

Event EH_ONCONFIRM_POPUP_CLOSED.

method EH_ONCONFIRM_POPUP_CLOSED.

* Added by wizard: Handler for event 'CONFIRM_POPUP_CLOSED'



  DATA: lv_answer TYPE string,
          lv_save_result TYPE abap_bool,
          lr_application TYPE REF TO cl_crm_bol_entity,
          lr_tx TYPE REF TO if_bol_transaction_context,
          lr_coco TYPE REF TO cl_crmcmp_g_bspwdcompone0_impl.
  INCLUDE: crm_object_types_con.
  DATA: lr_wdw        TYPE REF TO cl_bsp_wd_window.
  lv_answer = Zconfirm_popup->get_fired_outbound_plug( ).
  CASE lv_answer.
    WHEN 'OK'.
      OP_XTOSURVEY( ).
    WHEN 'CANCEL'.
    WHEN OTHERS.
  ENDCASE.
endmethod.

Method OP_SURVEYOVERVIEW within the view ICCMP_SURVEY/SurveyDetailSet.

DATA lr_window TYPE REF TO cl_bsp_wd_window.
  lr_window ?= me->view_manager->get_window_controller( ).
  CHECK lr_window IS BOUND.
  lr_window->call_outbound_plug( 'Survey_Overview' ).

No navigational link and no other code is required.

Many thanks and regards,

Andrea