on 06-26-2015 2:53 PM
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
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.
*************************************************
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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?
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.