在.HTM中:
<%
* Conversion Cnode SelectionMode to Tag
DATA:
lv_editlist TYPE string,
lv_displaymode TYPE string.
IF controller->view_group_context->is_view_in_display_mode( controller ) = abap_true.
lv_editlist = 'FALSE'.
lv_displaymode = 'X'.
ELSE.
lv_editlist = 'TRUE'.
lv_displaymode = ' '.
ENDIF.
%>
table = "//ZATAB0000QM/Table" "ZATAB0000QM是上下文节点名
usage = "ASSIGNMENTBLOCK"
onRowSelection = "select"
displayMode = "<%= lv_displaymode %>"
personalizable = "TRUE"
downloadToExcel = "FALSE"
<%-- cancelEvent = "FALSE"--%>
<%-- actions = "<%= controller->gt_button %>"--%>
actionsMaxInRow = "6"
<%-- selectionMode = "MULTI"--%>
selectedRowIndex = "<%= ZATAB0000QM->SELECTED_INDEX %>"
selectedRowIndexTable = "<%= ZATAB0000QM->SELECTION_TAB %>"
width = "100%"/>
****************************************************
METHOD eh_onedit.
DATA: lr_entity TYPE REF TO cl_crm_bol_entity.
DATA : lr_tx TYPE REF TO if_bol_transaction_context,
lr_customctrl TYPE REF TO cl_bt111h_o_opptdetailscu_impl. "客户控制器的IMPL
* r_comp type REF TO ZL_CPG_MAIN_BSPWDCOMPONEN_IMPL. "组件控制器
* lr_comp ?= me->comp_controller.
* lr_comp->typed_context->header->collection_wrapper->clear( ).
* Get the Parent entity for locking
lr_customctrl ?= me->get_custom_controller( controller_id = 'BT111H_OPPT/OpptDetailsCuCo' ). "#EC NOTEXT
lr_entity ?= lr_customctrl->typed_context->btpartnerset->collection_wrapper->get_current( ).
* Get the current entity
* Lock the entity
IF lr_entity->is_locked( ) = abap_false.
lr_entity->lock( ).
ENDIF.
IF lr_entity->is_locked( ) = abap_true.
me->view_group_context->set_view_editable( me ).
ELSE.
IF lr_entity->lock( ) EQ abap_true.
lr_tx ?= lr_entity->get_transaction( ).
me->view_group_context->set_view_editable( me ).
me->view_group_context->set_associated_tx_context( lr_tx ).
ENDIF.
ENDIF.
ENDMETHOD.
阅读(752) | 评论(0) | 转发(0) |