Skip to Content
0
Former Member
Feb 24, 2014 at 05:11 AM

Cancel and Back buttons at view level.

52 Views

Hi Experts,

I have Cancel and back buttons on a table view.

When i try to edit an existing entry and then if i click back, the entry is getting saved with the edited value. itz fine.

But, if i click on cancel after editing, the new value should be restored back to the old value.

In my case, if i click on cancel, the entire entity is getting deleted from the view.

Here is my code for the event eh_oncancel.

DATA:

lr_coco TYPE REF TO cl_erp_note_bspwdcomponen_impl,

lr_iterator TYPE REF TO if_bol_bo_col_iterator,

lr_entity TYPE REF TO cl_crm_bol_entity.

lr_entity ?= me->typed_context->erptext->collection_wrapper->get_current( ).

CHECK lr_entity IS BOUND.

lr_iterator = me->typed_context->erptext->collection_wrapper->get_iterator( ).

cl_crm_uiu_erp_order_tools=>clear_and_delete_entity( ir_entity = lr_entity

ir_iterator = lr_iterator ).

IF lr_entity->alive( ) = abap_false.

me->typed_context->erptext->collection_wrapper->remove( lr_entity ).

lr_coco ?= me->comp_controller.

CHECK lr_coco IS BOUND.

lr_coco->typed_context->erptextset->collection_wrapper->publish_current( ).

ENDIF.

op_to_list( ).

Please suggest the way of restoring the old value, when i cancel the edited data.

Thanks....