Quantcast
Channel: SCN : All Content - Web Dynpro ABAP
Viewing all articles
Browse latest Browse all 3667

Howto replace an embedded FPM-Instance within a Web DynPro Application?

$
0
0

Hi,

 

I have to build a Web DynPro application that displays an Navigation menu on the left side. On the right side within a UIViewContainer an embedded FPM Instance should be displayed depending on which entry I pressed on the Navigation menu. (Similiar to the Cockpit)

 

For Test purposes I have 2 buttons in the navigation menu. One to add the fpm and one to remove the fpm.

 

When I start the WD Application I first hit the addfpm button. And a new FPM Application is displayed within the UIViewElementContainer. When I hit the delfpm button the FPM will disappear. When I will the addfpm button again I get

a dump[1]

 

I have absolutely no idea why I get this dump.

 

Do I have to reset the FPM application remove removing it? Or is it possible to load a new FPM configuration in the FPM without removing it first?

 

Here are the Methods that I use to remove/add the FPM-Instance:

 

method ONACTIONADDFPM .

 

  DATA: L_VIEW_CONTROLLER_API TYPE REF TO IF_WD_VIEW_CONTROLLER.

  DATA: L_COMPONENT_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.

  DATA: lf_conf_key TYPE WDY_CONFIG_KEY.

 

  L_VIEW_CONTROLLER_API = wd_this->WD_GET_API( ).

 

  "Wenn die Komponente-Usage noch nicht vorhanden ist dann erstelle Sie:

  L_COMPONENT_USAGE = wd_this->WD_CPUSE_FPM( ).

  IF L_COMPONENT_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.

    lf_conf_key-CONFIG_ID = '/PLMU/WDC_MAT_OIF_CFG'.

    L_COMPONENT_USAGE->CREATE_COMPONENT( EXPORTING COMPONENT_NAME = 'FPM_OIF_COMPONENT'

                                                   CONFIGURATION_ID = lf_conf_key ).

 

    "Komponente mit der View verknüpfen:

    L_VIEW_CONTROLLER_API->PREPARE_DYNAMIC_NAVIGATION(

      SOURCE_WINDOW_NAME = 'WINDOW'

      SOURCE_VUSAGE_NAME = 'MAIN_USAGE_0' "MAIN_USAGE1/UIVIEW_VCA_1'

      SOURCE_PLUG_NAME   = 'TO_FPM'

      TARGET_COMPONENT_NAME = 'FPM_OIF_COMPONENT'

      TARGET_COMPONENT_USAGE = 'FPM'

      TARGET_VIEW_NAME = 'FPM_WINDOW'

      TARGET_PLUG_NAME = 'DEFAULT'

      TARGET_EMBEDDING_POSITION = 'MAIN/FPMVIEW' "'MAIN_USAGE_0/UIVIEW_VCA_1'

      ).

 

    WD_THIS->FIRE_TO_FPM_PLG( ).

 

  ENDIF.

endmethod.

 

And then remove the FPM using this button action:

 

method ONACTIONDELFPM .

  DATA: L_VIEW_CONTROLLER_API TYPE REF TO IF_WD_VIEW_CONTROLLER.

  DATA: L_COMPONENT_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.

 

  L_VIEW_CONTROLLER_API = wd_this->WD_GET_API( ).

 

  "Wenn die Komponente-Usage vorhanden ist dann lösche sie:

  L_COMPONENT_USAGE = wd_this->WD_CPUSE_FPM( ).

 

  "

  DATA: lo_event TYPE REF TO cl_fpm_event.

  lo_event = cl_fpm_event=>create_by_id( iv_event_id   = cl_fpm_event=>GC_EVENT_CLOSE  ).

 

  DATA: iwci_fpm TYPE REF TO IWCI_FPM_OIF_COMPONENT.

  iwci_fpm = wd_this->WD_CPIFC_FPM( ).

 

  CALL METHOD IWCI_FPM->CLOSE_DIALOG

    EXPORTING

      IO_EVENT        =  lo_event

      IV_EVENT_FAILED =  ABAP_FALSE

      .

 

  IF L_COMPONENT_USAGE->HAS_ACTIVE_COMPONENT( ) IS NOT INITIAL.

    L_COMPONENT_USAGE->DELETE_COMPONENT( ).

 

    "FPM Ref holen und Exit-Event schicken:

    DATA: lo_fpm TYPE REF TO IF_FPM.

    lo_fpm = cl_fpm_factory=>get_instance( ).

 

  •    CHECK NOT lo_fpm IS INITIAL.

  •    DATA: lf_event        TYPE FPM_EVENT_ID.

  •    lf_event = cl_fpm_event=>GC_EVENT_CLOSE.

  •    lo_fpm->RAISE_EVENT_BY_ID( lf_event ).

 

  ENDIF.

 

endmethod.

 

 

The dump  says:

 

Access via 'NULL' object reference not possible.

 

The ABAP call hierarchy was:

Method: /PLMU/IWCI_WDI_FRW_OIF~OVERRIDE_EVENT of program /1BCWDY/0O2TST5VUWTCOBML1BE7==CP

Method: /PLMU/IF_FRW_CALLBACK_PROXY~OVERRIDE_EVENT of program /PLMU/CL_FRW_F_CALLBACK_PROXY=CP

Method: OVERRIDE_EVENT of program /PLMU/CL_FRW_CALLBACK_PROXY===CP

Method: OVERRIDE_EVENT_OIF of program /PLMU/CL_FRW_APPL_CNTRL_ASSISTCP

Method: OVERRIDE_EVENT_OIF of program /1BCWDY/0O2TST5VUWTCNOS8226Y==CP

Method: IWCI_IF_FPM_OIF_CONF_EXIT~OVERRIDE_EVENT_OIF of program /1BCWDY/0O2TST5VUWTCNOS8226Y==CP

Method: GET_UIBBS_FOR_EVENT of program /1BCWDY/0O2TST5VUWTCNAR83UZE==CP

Method: IWCI_IF_FPM_FLOORPLAN_COMP~GET_UIBBS_FOR_EVENT of program /1BCWDY/0O2TST5VUWTCNAR83UZE==CP

Method: IF_FPM_FLOORPLAN~GET_UIBBS_FOR_EVENT of program CL_FPM_OIF_INTERNAL===========CP

Method: GET_NEXT_UIBBS of program CL_FPM========================CP

 

 

 

Thanks

Sebastian

 


Viewing all articles
Browse latest Browse all 3667

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>