cancel
Showing results for 
Search instead for 
Did you mean: 

Disable EDIT button in all assigment blocks on OVP

Former Member
0 Kudos

Hi, Experts!

I need disable all edit buttons on all asssigment block of Change Request in CHARM.

How to disable EDIT button on toolbar of OVP I know, but I do not know how to disable edin buttons on assigment blocks.

I redefined methods GET_BUTTONS and DO_PREPARE_OUTPUT of  views on OVP, but this do not work.

Component AIC_CMCR_H.

Thank's for ANY help.

P.S. Sorry for my english

Accepted Solutions (0)

Answers (7)

Answers (7)

0 Kudos

Hi Konstantin,

               If you want to disable the toolbaar buttons of each assignment block, then you need to do the code changes in each assignment block's (View's) do_prepare_output method.

Acutally there is a global table gt_button_header, in the impl class of respective view. U need to read that table and change the "enabled" value of particular button to 'false'. after these changes the corresponding button will remain grayed out based on your condition.

e.g.

***************** Title toolbar *****************

   IF gt_button_header IS INITIAL.

     ls_button-text     = cl_wd_utilities=>get_otr_text_by_alias( 'CRM_UIU_BP/BP_EDITLIST' ). "#EC NOTEXT

     ls_button-on_click = 'editlist'.                        "#EC NOTEXT

     APPEND ls_button TO gt_button_header.

     CLEAR ls_button.

   ENDIF.

* set button status

   ls_button-enabled = lv_display_mode.

   MODIFY gt_button_header FROM ls_button TRANSPORTING enabled

      WHERE enabled NE ls_button-enabled.

*************************************************

Former Member
0 Kudos

That's what I did, but this option does not suit me. Because using such a solution, there are many other problems, such as the button 'EDIT" is activated when switching to edit mode, because working method DO_BEFORE_OUTPUT, and user have permission for edit this document. If I do this with condition IV_FIRST_TIME that is working bad too. In this case check for role working one time before view is dispalying.

In all these cases, I need a lot of checks that need to be specified for each block. I think there is some easier way out

0 Kudos

Konstantin, it totally depends on ur condition which you have to write to call this piece of code. and even in edit mode also button will remain disabled.

Former Member
0 Kudos

My issue is disable edit option for change request. Condition is below. Partner function and status for current request is stored in custom table. If record is in table enable all buttons with edit function, else disable. I want disable all button in all assigment block, and do not want to write hadred rows of ABAP-code

Former Member
0 Kudos

Hi Konstantin,

  Click on the Overview of the BSP component your working on and go to the implementation class the same. As an example i'm taking the BSP Service request component. Click on the Attribute 'VIEW_GROUP_CONTEXT'  and it's type IF_BSP_WD_VIEW_GROUP_CONTEXT. This interface has the method 'SET_ALL_DISPLAY_ONLY' which deactivates all edit buttons of the view linked to this overview page and implement the same.

Regards,

Arun V.

Former Member
0 Kudos

Hello, Arunmozhivarman

That's not working. In this case method SET_ALL_DISPLAY_ONLY disable edit mode for all assingment blocks, but not disable "EDIT" buttons, my issue to make refuse all changes for change request, for users without permissions.

Former Member
0 Kudos

Hi Konstantin,

You can create a new configuration for the views in display mode or if needed one more config in edit mode. There is a a request processing method 'DO_CONFIG_DETERMINATION' where you can do the config determination based on UI Role Config keys, Object type and suboject and accordingly the whole set of views can be displayed in edit or display mode.

Regards,

Arun V.

Former Member
0 Kudos

Hello, Arun!

Thanks a lot! I do not think about different configuration!

TRY.

     do_that_changes( ).

CATCH.

      cx_nothing_happens.

ENDTRY.

Thanks, I will try.

Former Member
0 Kudos

Hello, experts!

Who is solved my problem?

My issue is disable all buttons on all assigment blocks, if user have permissions only for viewing.

I resolved that problem. I enhanced all asssigment blocks on OVP, but I don't like this solution.

Maybe someone will be able to offer a better solution?

navn_metts
Active Participant
0 Kudos

Hi,

Please check below link once. There is one badi for this.

Br,

Navn

Former Member
0 Kudos

Hi, Naveen!

Thaks for answer, but in CHARM BAdi like CRM_BP_UIU_VIEW_CONFIG is not available.

I don't find any BAdi for this case.

Former Member
0 Kudos

Hi Konstantin

Rather than resorting to custom code.

Did you consider trying to manage this with Authorisations?

Regards

Arden

Former Member
0 Kudos

Hi, Arden!

Thanks for replay.

But athorisation BADI works for any click in CRM Web UI. How do I know when I have to run the authorisation code?

samantak_chatterjee
Active Contributor
0 Kudos

Hi Konstantin,

I guess you are working in SOLMAN System. So, the above Badi will not work.

In case of manually changing the Views, how many views need to be changed manually ? If there are many views, then you need to make the changes in the Overview Page - method SET_VIEW_GROUP_CONTEXT. Redefine the method and need to pass the IF_BSP_WD_VIEW_GROUP_CONTEXT Interface. Here you will get the interface methods which will help you to achieve to disable all the functionality in all the views.

I don't have access to SOLMAN System. If you need technical help, then I can provide you some code from the CRM System.

Hope this helps.

Thanks,

Samantak Chatterjee.

Former Member
0 Kudos

Hello, Samantak!

Thank you for replay.

I need disable buttons on more the 10 assigment blocks.

I did this by modifying each block.

IF_BSP_WD_VIEW_GROUP_CONTEXT Interface using only for to enable display/edit mode. However, the button does not disabling. That was the first thing I tried.

dharmakasi
Active Contributor
0 Kudos

Hi Kuznetsov,

You can controll all views edit button using BADI "CRM_BP_UIU_VIEW_CONFIG".

Refere below SAP note, you have to create custom implementation for the badi and do the changes as mentione in below note.

OSS Note 1260695 - Data set-specific screen control.

Best Regards,

Dharmakasi.

Former Member
0 Kudos


Hello, Dharmakasi!

That BADI is not working in CHARM.I tested this extension.

Former Member
0 Kudos

HI Konstantin,

     I faced the same problem last month.

     I solved this problem by disabled the EDIT button of the assignment block one by one.

     In the OVPview ,you can see each of the assignment block and their components and views, go to .HTM OF the VIEW LAYOUT.


      You will code like below,


<thtmlb:areaFrameSetter toolbarButtons  = "<%= controller->GT_BUTTONS %>"

                         maxButtonNumber = "3" />

<chtmlb:config displayMode = "<%= controller->view_group_context->is_view_in_display_mode( controller ). %>"

                mode        = "RUNTIME" />

<div style="display:none" id="EmpResName">

<thtmlb:inputField value   = "//Campaign/RESPONSIBLE_NAME"

                    visible = "FALSE" />

</div>

If you want to hidden the button,you can clear the GT_BUTTONS.

If you want to display  only , you can set the displayMode to abap_ture.

Wish this can help.

Best regards.

    

Former Member
0 Kudos

Hello, Liang Yu Ma!

Thanks for replay, but I don't uhderstand you

That's what I understood below.

I need goto in .htm in each block to write the code that you advise me? I need to look in another component to enhance it, and write code in .htm?

P.S. Sorry foe my English again

Former Member
0 Kudos

Sorry , i forgot a word.

      You will see code like below,


<thtmlb:areaFrameSetter toolbarButtons  = "<%= controller->GT_BUTTONS %>"

                         maxButtonNumber = "3" />

what i mean is ,

if you want to hidden the button, add a line of code  in the .htm and make it like below.

<% REFRESH controller->GT_BUTTONS .

%>

<thtmlb:areaFrameSetter toolbarButtons  = "<%= controller->GT_BUTTONS %>"

                         maxButtonNumber = "3" />

and if you want to display only ,just change the code.

data: l_display type c.

l_dislpay = abap_true.

<chtmlb:config displayMode = "<%= l_display. %>"



Maybe your .HTM is not the same with my example, i think it has similar code , your can also add your condition codes  for disabled the button in the .HTM.

In my solution it works well, wish this can help you.



Best regards.

Former Member
0 Kudos

Thats code which I wrote

<thtmlb:areaFrameSetter toolbarButtons  = "<%= controller->gt_button %>"

                      displayMode     = "<%= controller->gv_disable_edit_btn %>"
                        maxButtonNumber = "6" />

<chtmlb:config displayMode = "<%= controller->gv_disable_edit_btn %>"

               mode        = "RUNTIME" />

That code I wrote in AIC_CMCR_H/AICCMCRHeaderEF -> AICCMCRHeaderEF.htm

gv_disable_edit_btn is abap_true but EDIT buttons is not disable

All assigment blocks is opened in display mode. My issue disable "EDIT" buttons. OVP "AIC_CMCR_H/AICCMCROverview" is not contains .htm may be i need create .htm?

Former Member
0 Kudos

In my opinion , you can just refresh  controller->gt_button and shows no button.

Former Member
0 Kudos

Hi

I believe you did not try what I suggested aboove.

Goto the .htm code of your assignment block and put Personalizable = "FALSE".

This would result to disable the Edit buttons on your assignment blocks.

Please revert if the issue gets resolved otherwise paste a screenshot of your assignment block and the EDIT button.

Regards
Nishant

Former Member
0 Kudos

Hi, Nishant!

I need to paste this code in each aassigment block on my OVP?

Former Member
0 Kudos

Hi,

In window controller implementation class, there is a method – set_view_group_context, in that method call ME->VIEW_GROUP_CONTEXT->SET_ALL_DISPLAY_ONLY( ) by passing your condition,  then all views will turn into display only.

Former Member
0 Kudos

Hello, Kiruthika!

Thanks fo replay. But this method is not working. All my views on OVP is in display mode without calling method SET_ALL_DISPLAY_ONLY, but buttons "EDIT" is not disable.. There may be another method of realization my issue?

Former Member
0 Kudos

Hi Konstantin

Please goto the .htm layout of the view of your assignment block.

Under the <chtmlb:configCellerator , put personalizable = "FALSE" .

Regards
Nishant