on 07-24-2012 1:41 PM
Hi ,
In my custom search page i have two OCA buttons namely Edit and Delete.....before creating these two buttons my overview page was
in edit mode which i transferred into display mode by redefining the SET_VIEW_GROUP_CONTEXT method in main window.
now the problem is after creating the OCA ,if i click on edit button it is showing in display mode rather than edit mode .
what can i do to solve this problem.
thank you.
Hi Rohan,
When edit button of OCA is clicked , then you need to lock the entity and set all views as editable.
WHEN 'EDIT'.
IF lr_ent->lock( ) EQ abap_true.
view_group_context->set_view_editable( me ).
lr_vgc ?= view_group_context->get_parent_vg_context( ).
lr_vgc ?= lr_vgc->get_dependant_vg_context( lr_ent ).
lr_vgc->set_all_editable( ).
lr_cw->find( iv_bo = lr_ent ).
ENDIF.
After that you can perform navigation , if you need to edit the details in detail .
Regards,
Nithish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nithish,
this is my code for OCA EDIT Button.
i used ur code but its not navigating to overview page.
WHEN 'EDIT'.
Data: lr_ent TYPE REF TO cl_crm_bol_entity,
lr_vgc TYPE REF TO if_bsp_wd_view_group_context,
lr_cw TYPE REF TO cl_bsp_wd_collection_wrapper.
IF lr_ent->lock( ) EQ abap_true.
view_group_context->set_view_editable( me ).
lr_vgc ?= view_group_context->get_parent_vg_context( ).
lr_vgc ?= lr_vgc->get_dependant_vg_context( lr_ent ).
lr_vgc->set_all_editable( ).
lr_cw->find( iv_bo = lr_ent ).
me->op_to_overview( ).
ENDIF.
i have added one more statement to navigate to overview but it is not working.
Hey Nithish,
My Outbound Plug Method.
METHOD op_to_overview.
view_manager->navigate(
source_rep_view = rep_view
outbound_plug = 'TO_OVERVIEW'
data_collection = iv_data_collection ).
ENDMETHOD.
-----------------------------------------------------------------------------------------------------------------------------------------------------
My ON_click event method.
METHOD eh_onoca_click.
DATA: lv_event TYPE string,
lv_index TYPE string,
lv_row_index TYPE i,
lr_col TYPE REF TO cl_crm_bol_entity.
SPLIT htmlb_event_ex->event_defined AT '.'
INTO lv_event lv_index.
lv_row_index = lv_index.
CASE lv_event.
WHEN 'DELETE'.
CALL METHOD comp_controller->window_manager->create_popup_2_confirm "interface if_bsp_wd_window_manager
EXPORTING
iv_title = 'Confirmation message'
iv_text = 'Are you sure! u want to delete?'
iv_btncombination = if_bsp_wd_window_manager=>co_btncomb_yesno
RECEIVING
rv_result = m_popup_confirm.
CALL METHOD m_popup_confirm->set_on_close_event
EXPORTING
iv_view = me
iv_event_name = 'POPUP_CLSOED'.
CALL METHOD m_popup_confirm->open.
WHEN 'EDIT'.
DATA: lv_indexs TYPE i,
lv_column TYPE string.
------------------------------------------------------------------------------------------------------------------------------------------------
* DATA: lr_ent TYPE REF TO cl_crm_bol_entity,
* lr_vgc TYPE REF TO if_bsp_wd_view_group_context,
* lr_cw TYPE REF TO cl_bsp_wd_collection_wrapper.
*
* IF lr_ent->lock( ) EQ abap_true.
* view_group_context->set_view_editable( me ).
* lr_vgc ?= view_group_context->get_parent_vg_context( ).
* lr_vgc ?= lr_vgc->get_dependant_vg_context( lr_ent ).
* lr_vgc->set_all_editable( ).
* lr_cw->find( iv_bo = lr_ent ).
* ENDIF.
-----------------------------------------------------------------------------------------------------------
cl_thtmlb_util=>get_event_info(
EXPORTING
iv_event = htmlb_event_ex
IMPORTING
ev_index = lv_indexs
ev_column = lv_column ).
me->typed_context->result->collection_wrapper->find( iv_index = lv_indexs ).
me->op_to_overview( ).
WHEN OTHERS.
ENDCASE.
ENDMETHOD.
thankx.
Method in Main Window ,Which makes the overview page change into Display mode.
method SET_VIEW_GROUP_CONTEXT.
*CALL METHOD SUPER->SET_VIEW_GROUP_CONTEXT
* EXPORTING
* IV_PARENT_CONTEXT =
** iv_first_time = ABAP_FALSE
* .
IF iv_first_time EQ abap_true AND
me->view_group_context IS NOT BOUND.
IF iv_parent_context IS INITIAL.
CREATE OBJECT me->view_group_context
TYPE cl_bsp_wd_view_group_context.
ELSE.
me->view_group_context = iv_parent_context.
ENDIF.
ENDIF.
endmethod.
In EDIT case , You need to fetch lr_ent as current entity of collection wrapper.
me->typed_context->result->collection_wrapper->find(iv_index = lv_index).
lr_ent ?= me->typed_context->result->collection_wrapper->get_current( ).
Here lr_ent is result model entity, if its is same as overview page context entity then proceed with the lock code and navigate.
If the overview page entity is different from the result entity , then first fetch overview main entity using some search object . Then lock the main entity and navigate.
Regards,
Nithsih
User | Count |
---|---|
7 | |
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.