webdynpro的select_option示例

需求,输入航线代码和航线编号区间,查询记录存在表中显示,并不是alv显示

1、使用组件WDR_SELECT_OPTIONS.

webdynpro的select_option示例

2.在组件控制器中加入以下组件

webdynpro的select_option示例

3、在视图属性中也添加该组件

webdynpro的select_option示例

4、创建节点

webdynpro的select_option示例

5、控件设计

webdynpro的select_option示例

6、窗口下的视图中嵌套这个视图

webdynpro的select_option示例

7、设计视图初始化方法WDDOINIT

webdynpro的select_option示例
method WDDOINIT .
DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
  lo_cmp_usage = wd_this->wd_cpuse_select_options( ).
  IF lo_cmp_usage->has_active_component( ) IS INITIAL.
    lo_cmp_usage->create_component( ).
  ELSE.
    EXIT.
  ENDIF.
*---选择屏幕的引用
  DATA lo_interfacecontroller TYPE REF TO iwci_wdr_select_options .
  lo_interfacecontroller =   wd_this->wd_cpifc_select_options( ).
  "修改SELECT_OPTIONS
  wd_this->m_handler = lo_interfacecontroller->init_selection_screen(   ).
*---设置全局信息
  CALL METHOD wd_this->m_handler->set_global_options
    EXPORTING
      i_display_btn_cancel  = abap_false
      i_display_btn_check   = abap_false
      i_display_btn_reset   = abap_false
      i_display_btn_execute = abap_false.


  DATA: lr_field TYPE REF TO data.

  DEFINE mcr_sel.
    free lr_field.
    lr_field = wd_this->m_handler->create_range_table( &1 ).
    wd_this->m_handler->add_selection_field(
      i_id = &1                                "字段参考类型
      i_description = &2                       "描述
      it_result = lr_field
      i_read_only = &3 ).
  END-OF-DEFINITION.

  mcr_sel S_CARR_ID 航线代码 abap_false.
  mcr_sel S_CONN_ID 航班编号 abap_false.

endmethod.
webdynpro的select_option示例

8、设计按钮SEARCH事件方法

webdynpro的select_option示例
method ONACTIONSEARCH .
*获取SELECT OPTIONS
  FIELD-SYMBOLS: <fs_CARRID> TYPE ANY TABLE,
                 <fs_CONNID> TYPE ANY TABLE.
  DATA lv_CARRID TYPE S_CARR_ID .          "屏幕上输入的
  DATA lv_CONNID TYPE S_CONN_ID .          "屏幕上输入的
  DATA:lo_data TYPE REF TO data.
  FREE lo_data.
  lo_data = wd_this->m_handler->get_range_table_of_sel_field( S_CARR_ID ).
  ASSIGN lo_data->* TO <fs_CARRID>.
  FREE lo_data.
  lo_data = wd_this->m_handler->get_range_table_of_sel_field( S_CONN_ID ).
  ASSIGN lo_data->* TO <fs_CONNID>.


*数据绑定
  DATA lo_nd_sflight TYPE REF TO if_wd_context_node.

  DATA lo_el_sflight TYPE REF TO if_wd_context_element.
  DATA lt_sflight TYPE wd_this->Elements_sflight.

  lo_nd_sflight = wd_context->get_child_node( name = wd_this->wdctx_sflight ).

  SELECT * INTO TABLE lt_sflight from sflight
    WHERE CARRID in <fs_CARRID>
    AND   CONNID in <fs_CONNID>.

  lo_nd_sflight->BIND_TABLE(
  NEW_ITEMS = lt_sflight ).

endmethod.
webdynpro的select_option示例

9、效果展示

webdynpro的select_option示例

 

 

webdynpro的select_option示例,布布扣,bubuko.com

webdynpro的select_option示例

上一篇:PHP中spl_autoload_register函数的用法


下一篇:win10禁用windows更新