Chinaunix首页 | 论坛 | 博客
  • 博客访问: 690495
  • 博文数量: 145
  • 博客积分: 3446
  • 博客等级: 中校
  • 技术积分: 1567
  • 用 户 组: 普通用户
  • 注册时间: 2006-08-30 13:58
文章分类

全部博文(145)

文章存档

2021年(1)

2020年(1)

2019年(1)

2018年(6)

2017年(1)

2016年(10)

2015年(12)

2014年(10)

2013年(15)

2012年(33)

2011年(21)

2010年(9)

2009年(18)

2008年(2)

2006年(5)

我的朋友

分类: Web开发

2018-06-27 18:15:01

<%
  DATA:lv_xml    type string,
  lv_xml_inp type string,
  lv_index type i,
  lv_config_type type BSP_DLC_CONFIG_TYPE,
  lv_view_desc type ref to IF_BSP_DLC_VIEW_DESCRIPTOR,
  it_adv_conf type BSP_DLCT_ADV_CONF_ITM,
  is_adv_conf like line of  it_adv_conf.
* ************Read the original configuration data and property descriptors of the view as an xml file
  lv_xml_inp    = controller->CONFIGURATION_DESCR ->GET_CONFIG_DATA( ).
  lv_view_desc = controller-> CONFIGURATION_DESCR->GET_PROPERTY_DESCRIPTOR ( ).
*********************** Use the utility class to convert xml to ABAP format
  CL_BSP_DLC_CONFIG_UTIL=> ADV_CONF_META_TO_TABLE( exporting IR_VIEW_DESCR = lv_view_desc
  IV_ADV_CONF_META_XML = lv_xml_inp
  importing ET_ADV_CONF = it_adv_conf ).
  LOOP AT it_adv_conf INTO is_adv_conf WHERE field_name = '//BTADMINH/EXT.ZZF_ACTIVE_NOTE' .
  lv_index = sy- tabix.
  if controller-> if_active = 'X' .
  is_adv_conf-MANDATORY = 'X'.
  is_adv_conf-DISPLAY_ONLY = ' ' .
  else.
  is_adv_conf-MANDATORY = ' '.
  is_adv_conf-DISPLAY_ONLY = 'X' ."不可编辑
  endif.
  MODIFY it_adv_conf FROM is_adv_conf INDEX lv_index .
  ENDLOOP.
  CL_BSP_DLC_CONFIG_UTIL=> ADV_CONF_TABLE_TO_META( exporting IT_ADV_CONF = it_adv_conf
  IR_VIEW_DESCR = lv_view_desc
  importing EV_ADV_CONF_META_XML = lv_xml ).
****  ****Here the modified XML is retrieved , but it is not ready as it has been encoded. We have to remove encoding and put it in standard format for rendering.
  DATA: lv_defidx    TYPE sy- fdpos,
  lv_clstagidx TYPE sy-fdpos .
  lv_defidx = -1 .
  lv_clstagidx = 10000.
  IF lv_xml CS '   lv_defidx = sy- fdpos.
  IF lv_xml CS '>'.
  lv_clstagidx = sy- fdpos + 1.
  IF lv_clstagidx > lv_defidx.
  lv_xml = lv_xml+lv_clstagidx.
  ENDIF.
  ENDIF.
  ENDIF.
  CONCATENATE '' lv_xml INTO lv_xml."#EC NOTEXT
%>

    DATA:lv_view_desc      TYPE REF TO if_bsp_dlc_view_descriptor,
         lt_adv_conf       TYPE bsp_dlct_adv_conf_itm,
         ls_adv_conf       LIKE LINE OF  lt_adv_conf,
         ls_current_status TYPE crmst_status_btil,
         lv_estat          TYPE j_estat,
         lv_txt04          TYPE j_txt04.
    FIELD-SYMBOLS: LIKE LINE OF  lt_adv_conf.
    IF gw_btadminh-process_type = 'ZSGN'.
*   获取单据状态
      zcl_crm_common_service=>get_user_status_current(
        EXPORTING
          ir_btadminh       = lr_btadminh
        IMPORTING
          es_current_status = ls_current_status
          ev_estat          = lv_estat
          ev_txt04          = lv_txt04
            )..
      CALL METHOD me->configuration_descr->get_config_data
        RECEIVING
          rv_result        = DATA(lv_xml)
        EXCEPTIONS
          config_not_found = 1.
      IF sy-subrc = 0.
        lv_view_desc = me->configuration_descr->get_property_descriptor( ).
*********************** Use the utility class to convert xml to ABAP format
        cl_bsp_dlc_config_util=>adv_conf_meta_to_table( EXPORTING ir_view_descr = lv_view_desc
        iv_adv_conf_meta_xml = lv_xml
        IMPORTING et_adv_conf = lt_adv_conf ).
        IF lv_txt04 = 'OPEN'.
          READ TABLE lt_adv_conf ASSIGNING WITH KEY field_name = '//BTADMINH/EXT.ZZF_LCHLVEL'..
          IF sy-subrc = 0.
            -display_only = abap_true.
          ENDIF.
        ELSE.
          READ TABLE lt_adv_conf ASSIGNING WITH KEY field_name = '//BTADMINH/EXT.ZZF_LCHLVEL'..
          IF sy-subrc = 0.
            -display_only = abap_false.
          ENDIF.
        ENDIF.
        cl_bsp_dlc_config_util=>adv_conf_table_to_meta( EXPORTING it_adv_conf = lt_adv_conf
           ir_view_descr = lv_view_desc
           IMPORTING ev_adv_conf_meta_xml = lv_xml ).
        DATA(lr_configuration2) = CAST if_bsp_dlc_config_table_layout( me->configuration_descr ).
        lr_configuration2->set_active_table_layout( iv_config_data = lv_xml ).
      ENDIF.
    ENDIF.
*    end add
阅读(926) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~