Skip to Content
0
Former Member
Nov 05, 2011 at 03:29 PM

How to get the view in editable mode with OCA button.

78 Views

Dear Experties,

I am new to CRM WEB UI ,I have got the requirement to develope a view with OCA button on it and when i click on the button it should direct to the second view and it should open with edit mode.

The Source view is table type and target view is form type.

I am able to achieve this but unable to get it in editable mode.

I have added the below code in do_prep_output method but getting dump at the line

lr_entity ?= me->typed_context->EMAINLEG->collection_wrapper->get_first( ).

The error message is

Long text During a 'CAST' operation ('?=' oder 'MOVE ? TO')a type conflict occurred. The source type '\CLASS=CL_BSP_WD_MIXED_NODE' is not compatible for assigning with the target type '\CLASS=CL_CRM_BOL_ENTITY'.

Please somebody help me on this

lv_display = me->view_group_context->is_view_in_display_mode( me ).

IF lv_display EQ abap_false.

ELSE.

me->view_group_context->set_view_editable( me ).

ENDIF.

DATA: lr_tx TYPE REF TO if_bol_transaction_context,

  • lr_entity TYPE REF TO cl_crm_bol_entity,

lr_comp type REF TO ZL_BT131QI__BSPWDCOMPONEN_IMPL.

lr_comp ?= me->comp_controller.

Check lr_comp is BOUND.

lr_entity ?= lr_comp->typed_context->BTADMINI->collection_wrapper->get_current( ).

CHECK lr_entity IS BOUND.

IF lr_entity->lock( ) = abap_true.

me->view_group_context->set_view_editable( me ).

ENDIF.

lr_entity ?= me->typed_context->EMAINLEG->collection_wrapper->get_first( ).

WHILE lr_entity IS BOUND.

lr_entity->lock( ).

lr_entity ?= me->typed_context->EMAINLEG->collection_wrapper->get_next( ).

ENDWHILE.

The following error text was processed in the system:

Source type \CLASS=CL_BSP_WD_MIXED_NODE is not compatible, for the purposes of assignment, with target type \CLASS=CL_CRM_BOL_ENTITY

Exception Class CX_SY_MOVE_CAST_ERROR

Error Name MOVE_CAST_ERROR

Program ZL_ZBT131QI_EMAINLEG_IMPL=====CP

Include ZL_ZBT131QI_EMAINLEG_IMPL=====CM00C

ABAP Class ZL_ZBT131QI_EMAINLEG_IMPL

Method EH_ON_EDIT

Line 33

Long text During a 'CAST' operation ('?=' oder 'MOVE ? TO')a type conflict occurred. The source type '\CLASS=CL_BSP_WD_MIXED_NODE' is not compatible for assigning with the target type '\CLASS=CL_CRM_BOL_ENTITY'.

Thanks in advance!!!