cancel
Showing results for 
Search instead for 
Did you mean: 

CProject - Switch edit / display mode

yohann_rongere
Explorer
0 Kudos

Hello all,

We synchronize PPM with PS when user save his project. This works perfectly.

Now we would like to lock a Cproject when corresponding PS Project is opened. This means that Cproject should be opened in display mode and not in edit mode if PS project is opened.

I've created an enhancement on DPR_DET_DATA_PROJECT_O Webdynpro. I tried to code this in pre-exit of UPDATE_DATA_FROM_BE method (seems that we set up fields of dynpro here) :

DATA:  lr_session TYPE REF TO cl_dpr_session_state.

lr_session = cl_dpr_session_state=>get_instance( ).

lr_session->set_change_mode( ' ' ).


It doesn't change anything, it still open in edit mode.


Maybe do you know a better way to do it or you know how to code this.


Thanks to all for helping me.


Yohann.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member388328
Active Contributor
0 Kudos

Hi Yohann,

Can you please check if lr_session is assgined or not.

Thanking you

Vengaiah

yohann_rongere
Explorer
0 Kudos

Hi Vengaiah,

Thanks for your answer. Yes, lr_session is assigned and its attributes mv_change_mode is correctly set to blank after the set_change_mode.

Yohann.

former_member388328
Active Contributor
0 Kudos

Hi Yohann,

DPR_DET_DATA_PROJECT_O  is only a component in the cprojects application. I think you need set the application as display mode.


Thanking you

Vengaiah

yohann_rongere
Explorer
0 Kudos

Thanks again.

You are probably right, we should change display mode in the application but, for the moment, I've found a solution.

In pre-exit of method UPDATE_DATA_FROM_BE, I check lock entries for PS project. If there are lock entries, I set a specific attribute mv_lock to 'X'.

I've created an overwrite-exit of this method UPDATE_DATA_FROM_BE, copy all this method in the overwrite-exit.

Then I test my attribute mv_lock to determine if my fields are read_only or not.

          IF wd_this->mv_lock = abap_true.
           ls_prop_for_node-read_only = abap_true.
         ELSE.
           ls_prop_for_node-read_only = ls_fc-readonly.
         ENDIF.


I did the same thing in WD for task and phase.


Certainly, there is a better solution but I was short at time and this solution is, for the moment, suitable.


Thanks for helping me.


Yohann.