SAP CRM WebClient UI change view area content dynamically by viewset

Created by Wang, Jerry, last modified on Dec 05, 2014

clipboard1
clipboard2

method DO_PREPARE_OUTPUT.
 data: lt_children             TYPE tbsp_wd_rep_viewarea_assigns,
       lo_child_rep_view       TYPE REF TO cl_bsp_wd_rep_view,
       lv_old_viewname         TYPE string,
       lv_new_view_name        TYPE string,
       lv_old_view_name        TYPE string,
       lv_window_ctrl          TYPE REF TO CL_BSP_WD_WINDOW,
       lo_component            TYPE REF TO CL_ZVIEWSET_BSPWDCOMPONEN_IMPL,
       ls_child                TYPE bsp_wd_rep_viewarea_assignment.
 CONSTANTS: c_detail2 TYPE string VALUE 'detail2'.
CALL METHOD SUPER->DO_PREPARE_OUTPUT
  EXPORTING
    IV_FIRST_TIME = iv_first_time.
lo_component ?= me->comp_controller.
IF lo_component->gv_view_name = 'VIEW2A'.
   lv_new_view_name = 'ZVIEWSET/detailwindow2'.
ELSE.
   lv_new_view_name = 'ZVIEWSET/detailwindow2plus'.
ENDIF.
lt_children = me->rep_view->get_default_children( ).
READ TABLE lt_children INTO ls_child WITH KEY viewarea = c_detail2. "#EC SYNTCHAR
CHECK sy-subrc = 0.
lo_child_rep_view = ls_child-repview.
lv_old_view_name = get_viewarea_content( c_detail2 ).
CHECK lv_old_view_name <> lv_new_view_name.
lo_child_rep_view = lo_child_rep_view->get_replacement( lv_new_view_name ).
bind_view( rep_view = lo_child_rep_view
                                viewarea = c_detail2 ).
"lv_window_ctrl ?= get_subcontroller_by_viewname( lv_new_view_name ).
  endmethod.

clipboard3
clipboard4

展开阅读全文
©️2020 CSDN 皮肤主题: 深蓝海洋 设计师: CSDN官方博客 返回首页
实付0元
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值