on 2016 Aug 30 11:54 AM
Request clarification before answering.
Hi Kartik,
You can accomplish the task by following these steps:
> Add a change button/edit button to the gt_buttons table after redefining DO_PREPARE_OUTPUT method and adding this code:
ls_button-on_click = 'edit'.
ls_button-tooltip = cl_wd_utilities=>get_otr_text_by_alias( 'CRM_UIU_BT/EDIT' ).
ls_button-type = cl_thtmlb_util=>gc_icon_edit_text.
ls_button-enabled = me->view_group_context->is_view_in_display_mode( me ).
APPEND ls_button TO gt_button.
> Create an event handler for it (You can check the standard event handler EH_ONEDIT) and add the following code to set the view as editable.
DATA:
lo_ent TYPE REF TO cl_crm_bol_entity,
lo_vgc TYPE REF TO if_bsp_wd_view_group_context,
lo_coco TYPE REF TO cl_crm_icm__bspwdcompone7_impl.
lo_coco ?= me->comp_controller.
IF lo_coco IS BOUND.
lo_ent ?= lo_coco->typed_context->btadminh->collection_wrapper->get_current( ).
IF lo_ent IS BOUND.
IF lo_ent->lock( ) = abap_true.
* Set view editable
me->view_group_context->set_all_editable( ).
ENDIF.
ENDIF.
ENDIF.
> Redefine the GET_I methods for the fields which you want to be disabled and set the rv_disabled to 'TRUE' for these fields.
Let me know if you need any further information.
Please award points if useful.
Thanks!
Viksit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank u viksit for your reply,
i already maintain this code,
But as i have lots of fields and only few i want in edit mode so i am using,
me->view_group_context-> set_all_display_only( ).
and maintaining FALSE in get_i of respective filed .
But display only putting all in display none is editable.
Please suggest something.
Code In event is.
me->view_group_context->set_all_display_only( ).
lr_vgc ?= view_group_context->get_dependant_vg_context( ).
lr_vgc->set_all_display_only( ).
but when i am using like this it is not triggering get_i method.
But,
me->view_group_context->set_all_editable( ).
lr_vgc ?= view_group_context->get_dependant_vg_context( ).
lr_vgc->set_all_editable( ).
but on this it is triggering.
please suggest any way to solve this one
Hi Kartik,
Create new view configuration. Set some fields display only (as per requirement).
Set some variable in event handler of new change button. Implement DO_CONFIG_DETERMINATION in view implementation class and determine new configuration when this variable is set.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
21 | |
16 | |
3 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.