Skip to Content
author's profile photo Former Member
Former Member

OCA edit button problem

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jul 24, 2012 at 01:09 PM

    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 ).

    After that you can perform navigation , if you need to edit the details in detail .



    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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.



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.