TalentLean

博客园 首页 联系 订阅 管理

Here is just a sample to demonstrate how to popup the window via FPM.

 

 


  DATA: ls_content_area       TYPE if_fpm_ovp=>ty_s_content_area, "dynamic popup
        ls_section            TYPE if_fpm_ovp=>ty_s_section,
        lt_uibb               TYPE if_fpm_ovp=>ty_t_uibb,
        lt_column_layout      TYPE if_fpm_ovp=>ty_t_column_layout,
        ls_column_layout      TYPE if_fpm_ovp=>ty_s_column_layout,
        lv_config_id          TYPE wdy_config_id,
        lo_bo_conf            TYPE REF TO /bobf/if_frw_configuration,
        ls_uibb               TYPE if_fpm_ovp=>ty_s_uibb,
        lr_act_conf           TYPE REF TO /bobf/s_confro_act_list,
        lr_act_do2host        TYPE REF TO ts_act_do2host,
        ls_act_do2host        TYPE ts_act_do2host,
        lv_act_key            TYPE /bobf/act_key,
        lv_action_id          TYPE fpm_event_id,
        lo_fpm_event          TYPE REF TO cl_fpm_event.

* build fpm dialog content area
  ls_content_area-type           if_fpm_constants=>gc_content_area_type-dialog.
  ls_content_area-dlg_button_set 3.

  CASE iv_action.
    WHEN 'CREATE_FOLDER'.
      ls_content_area-title          cl_wd_utilities=>get_otr_text_by_alias'/SCMTMS/UI_CMN/CREATE_FOLDER' ).
      ls_content_area-id             /scmtms/if_ui_cmn_c=>sc_content_area-dlg_create_folder.
      lv_config_id                   cv_folder_config.
      lv_action_id                   iv_action.
    WHEN 'CREATE_FILE'.
      ls_content_area-title          cl_wd_utilities=>get_otr_text_by_alias'/SCMTMS/UI_CMN/CREATE_FILE' ).
      ls_content_area-id             /scmtms/if_ui_cmn_c=>sc_content_area-dlg_create_file.
      lv_config_id                   cv_file_config.
      lv_action_id                   iv_action.
    WHEN 'CREATE_LINK'.
      ls_content_area-title          cl_wd_utilities=>get_otr_text_by_alias'/SCMTMS/UI_CMN/CREATE_LINK' ).
      ls_content_area-id             /scmtms/if_ui_cmn_c=>sc_content_area-dlg_create_link.
      lv_config_id                   cv_link_config.
      lv_action_id                   iv_action.
    WHEN 'VIEW_LINK'.
      ls_content_area-title          cl_wd_utilities=>get_otr_text_by_alias'/SCMTMS/UI_CMN/SECURITY_MESSAGE' ).
      ls_content_area-id             /scmtms/if_ui_cmn_c=>sc_content_area-dlg_view_link.
      lv_config_id                   cv_show_link_config.
      lv_action_id                   iv_action.
  ENDCASE.

* build section
  ls_column_layout-column   1.
  APPEND ls_column_layout TO lt_column_layout.

  ls_section-column_layouts lt_column_layout.
  ls_section-id             'POPUP'.
  ls_section-layout_type    if_fpm_constants=>gc_layout_type-defalt.
  ls_section-index          1.

* build form uibb
  ls_uibb-component      if_fpm_cfg_constants=>gc_component_name-form.
  ls_uibb-interface_view if_fpm_cfg_constants=>gc_window_names-wnd_form.
  ls_uibb-config_id      lv_config_id.
  ls_uibb-config_type    gc_config_type.
  ls_uibb-location       1.
  ls_uibb-index          1.
*  ls_uibb-needs_stretching = 'X'.
  APPEND ls_uibb TO lt_uibb.

* Special coding for the View Link
  IF iv_action 'VIEW_LINK'.
* create event now
    lo_fpm_event cl_fpm_event=>create_by_idcl_fpm_event=>gc_event_open_dialog_box ).

* set popup parameter for fpm
    lo_fpm_event->mo_event_data->set_valueiv_key   /scmtms/if_ui_cmn_c=>sc_action_param-fpmobject-content_area
                                            iv_value ls_content_area ).

    lo_fpm_event->mo_event_data->set_valueiv_key   /scmtms/if_ui_cmn_c=>sc_action_param-fpmobject-section
                                            iv_value ls_section ).

    lo_fpm_event->mo_event_data->set_valueiv_key   /scmtms/if_ui_cmn_c=>sc_action_param-fpmobject-uibb
                                            iv_value lt_uibb ).

    lo_fpm_event->mo_event_data->set_valueiv_key   cv_action_id
                                            iv_value lv_action_id ).

    lo_fpm_event->mo_event_data->set_valueiv_key 'URL_DATA'
                                            ir_value atf_data ).

    ro_event lo_fpm_event.
  ELSE.

**BOPF Related coding
    READ TABLE mo_view->mt_act_conf WITH KEY act_name iv_action
                                    REFERENCE INTO lr_act_conf.
    CHECK sy-subrc 0.
* Get action runtime configuration key
    IF lo_bo_conf IS NOT BOUND.
      TRY.
          lo_bo_conf /bobf/cl_frw_factory=>get_configurationiv_bo_key ).
        CATCH /bobf/cx_frw.  " BOPF Exception Class
      ENDTRY.
    ENDIF.
    ls_act_do2host-host_act_key lo_bo_conf->query_actioniv_node_key iv_node_key
                                                            iv_act_name lr_act_conf->act_name ).

* create event now
    lo_fpm_event cl_fpm_event=>create_by_idcl_fpm_event=>gc_event_open_dialog_box ).

* set popup parameter for fpm
    lo_fpm_event->mo_event_data->set_valueiv_key   /scmtms/if_ui_cmn_c=>sc_action_param-fpmobject-content_area
                                            iv_value ls_content_area ).

    lo_fpm_event->mo_event_data->set_valueiv_key   /scmtms/if_ui_cmn_c=>sc_action_param-fpmobject-section
                                            iv_value ls_section ).

    lo_fpm_event->mo_event_data->set_valueiv_key   /scmtms/if_ui_cmn_c=>sc_action_param-fpmobject-uibb
                                            iv_value lt_uibb ).

    lo_fpm_event->mo_event_data->set_valueiv_key   cv_action_id
                                            iv_value lv_action_id ).

    lo_fpm_event->mo_event_data->set_valueiv_key 'URL_DATA'
                                            ir_value atf_data ).

    IF it_keys IS SUPPLIED.
*     Attach key information to event parameters
      lo_fpm_event->mo_event_data->set_value(
        EXPORTING
          iv_key   /bofu/if_fbi_runtime_c=>sc_event_parameters-common_params-it_key
          iv_value it_keys ).
    ENDIF.

    IF iv_bo_key IS NOT INITIAL.
*     Attach BO conf key to event parameters
      lo_fpm_event->mo_event_data->set_value(
        EXPORTING
          iv_key   /bofu/if_fbi_runtime_c=>sc_event_parameters-common_params-bo_conf_key
          iv_value iv_bo_key ).
    ENDIF.

    IF iv_node_key IS NOT INITIAL.
      lo_fpm_event->mo_event_data->set_value(
        EXPORTING
          iv_key   /bofu/if_fbi_runtime_c=>sc_event_parameters-common_params-node_conf_key
          iv_value iv_node_key ).
    ENDIF.

    IF ls_act_do2host-host_act_key IS NOT INITIAL.
      lv_act_key ls_act_do2host-host_act_key.
      lo_fpm_event->mo_event_data->set_value(
        EXPORTING
          iv_key   /bofu/if_fbi_runtime_c=>sc_event_parameters-common_params-act_conf_key
          iv_value lv_act_key ).
    ENDIF.

    ro_event lo_fpm_event.
  ENDIF.

 

posted on 2013-03-08 14:47  TalentLean  阅读(1039)  评论(0)    收藏  举报