cancel
Showing results for 
Search instead for 
Did you mean: 

To Change View from Display mode to Edit Mode

Former Member
0 Kudos

Hi Experts,

I am facing problem in changing the view from disply mode to edit mode. My scenario is --

I have to make few fields mandatory when the BP role is made SOLD-TO-PARTY by calling a configuration of the view,which I am able to do using a BADI.

Now my Problem is,as soon as the configuration is changed,it should be visible in edit mode,which it is right now in edit mode,becoz of which i am not getting the error for the mandaory fields.

PLs suggest me something so tht i can make tht view in edit mode as soon as i change the configuration while BP role is made sold-to-party.

Thanks,

SA

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Solved

Thanks.

CarstenKasper
Active Contributor
0 Kudos

When you know that a certain configuration should always be in edit mode, why do not you check for this?

At first read through I did not get that you do your config change in a BAdI. Thus I suggested doing it in an event handler. In this scenario however it seems a lot easier if you put your check in the DO_PREPARE_OUTPUT or DO_CONFIG_DETERMINATION of the view impl.

Just check which config is active. If it is yours and the entities can be locked --> set the view_group_context to edit.

cheers Carsten

Former Member
0 Kudos

Hi,

I have done the same you told me before u said inside the do_config_determination but i could not change the view to edit mode though tht edit button became inactive,but tht view did not change to edit mode..

the codes i used like this.

  if lv_subtype eq '<DEFAULT>'.
  data : v_controller type ref to cl_bsp_wd_view_controller.
  v_controller ?= me->m_parent.
  v_controller->view_group_context->set_view_editable( v_controller ).
  endif.

Pls suggest where i am going wrong.

Thanks,

SA

I was able to solve this issue...i just have to use the same implementiong class instead of v_controller.

thanks to u all.

Edited by: Saurabh Agrawal on Sep 6, 2008 10:00 AM

CarstenKasper
Active Contributor
0 Kudos

On the View_group_context there is a method: SET_ALL_EDITABLE or SET_VIEW_EDITABLE. Try these to, who would have guessed, set the flag to edit mode...

When you set the role to sold to parte an event can be fired. Catch it in your own event handler and set the edit state.

cheers Carsten

Former Member
0 Kudos

Hi,

Actually, I am changing the configuration through a BADI and this is happening inside the Accountdetails view of componet BP_HEAD,

not i feel thti have to change something in do_congig method so tht it fires the edit button, but how..from ur guidance i did so, but tht button of edit is pressed but it is still showing me the view in disply mode only...

Thanks,

SA

CarstenKasper
Active Contributor
0 Kudos

Hi,

supposing you are using the configTool:

There will be a CHTMLB:CONFIG tag on the .htm page for the view. This BSP-Tag has got a parameter: displayMode

You can set it via <%= controller->view_group_context->is_view_in_display_mode( controller ). %>

Anyhow you do not have to use the view group context. It can be any variable. But I strongly recommend that you set the view_group_context according to this variable.

cheers Carsten

Former Member
0 Kudos

Hi Carsten,

I found in the view as this :

<chtmlb:config xml         = "<%= lv_xml %>"
               displayMode = "<%= controller->view_group_context->is_view_in_display_mode( controller ). %>"
               mode        = "RUNTIME" />

But how do i make it in edit mode..

and how will i knw tht it gets fired to change in edit mode when BP role is SOLD to party.

Thanks,

SA