on 12-13-2010 11:05 PM
Dear Experts.
Please can someone help me with suggestions for the following issue that I have in this moment:
I need hide the button "Entrada Nueva" for the component fitv_vc_advances
[fitv_vc_advances|http://img842.imageshack.us/img842/2719/fitvvcadvances.png]
I checked the following link.
Illegal External link removed by moderator
Thanks in advance,
Regards
Carmen G
Edited by: Thomas Jung on Dec 14, 2010 9:39 AM
Hi Carmen,
i would advise to use the PERSONALIZATION feature. Thats a development free way of hiding the button. when application up and running , make a right mouse click over the button you wish to hide on USER SETTING select hide 'btn name'.
Since you want to hide this button for all users , Launch the WebDynpro Application in config mode. This is done simply by appending
&sap-config-mode=X
to URL
example: http://XYZ:8020/sap/bc/webdynpro/sap/zdemo_main?sap-language=EN
http://XYZ:8020/sap/bc/webdynpro/sap/zdemo_main?sap-language=EN&sap-config-mode=X
-Prashant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hallo Carmen,
You can get the component name and application name by this way.Geting application name is already mentioned in this forum.
data:
lv_appli_name type string,
lv_component_name type string,
l_api type ref to if_wd_component,
l_component_info type ref to IF_WD_RR_COMPONENT,
l_application_api type ref to if_wd_application,
l_application_info type ref to if_wd_rr_application.
l_api = wd_this->wd_get_api( ).
l_component_info = l_api->get_component_info( ).
"Component name
lv_component_name = l_component_info->get_name( ).
l_application_api = l_api->get_application( ).
l_application_info = l_application_api->get_application_info( ).
"application name
lv_ api-application_name = l_application_info->get_name( ).
The system display the following when I tried of active th code,
Web Dynpro Comp. / Intf. FITV_VC_ADVANCES,Web Dynpro View ADVANCESVIEW
Post-Exit PST4K69EOHXQ1QO5S8RT7WMB1X6C for WDDOMODIFYVIEW
The result type of the function method cannot be converted into the type of L_API. .
Web Dynpro Comp. / Intf. FITV_VC_ADVANCES,Web Dynpro View ADVANCESVIEW
Property "text" of element "CUSTOMIZING_TEXT" does not contain a value
Thanks
Regards
>
> The system display the following when I tried of active th code,
>
>
> Web Dynpro Comp. / Intf. FITV_VC_ADVANCES,Web Dynpro View ADVANCESVIEW
>
> Post-Exit PST4K69EOHXQ1QO5S8RT7WMB1X6C for WDDOMODIFYVIEW
> The result type of the function method cannot be converted into the type of L_API. .
>
> Web Dynpro Comp. / Intf. FITV_VC_ADVANCES,Web Dynpro View ADVANCESVIEW
> Property "text" of element "CUSTOMIZING_TEXT" does not contain a value
>
> Thanks
>
> Regards
CHange this line to solve the first problem.
l_api = wd_this->wd_get_api( ).
to
l_api = wd_comp_controller->wd_get_api( ).
Second problem, seems to me that you have a CUSTOMIZING_TEXT UI element without the text property binded. Either bind this to a context attribute or supply a string in design time.
To get application name, use this code
data:
lv_appli_name type string.
l_api type ref to if_wd_component,
l_application_api type ref to if_wd_application,
l_application_info type ref to if_wd_rr_application.
l_api = wd_this->wd_get_api( ).
l_application_api = l_api->get_application( ).
l_application_info = l_application_api->get_application_info( ).
lv_ api-application_name = l_application_info->get_name( ).
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
All you need is to hide a standard WD button ?
If so, its simple..
Go to your view, click on the spiral (Enhancement) button, create a enhancement with enhancement name and description.
Now, the WD component will be in change mode. Do everything u need as your customized object.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Carmen,
I assume your requirement is to hide the button on some condition.
Please check whether there is any attribute in the component which is boud to the visiblity of this button.
If yes you can hide the button setting the value of that attribute to None ( WDUI_VISIBILITY = 01 ).
If there is no such attribute then i can suggest below option:
Create a context node and attribute ATTR of type WDUI_VISIBILITY and bind the visible property of this button to this attribute.
Create a post-exit method for the WDDOINIT ( or any method suitable to the flow of this component) and set the value of ATTR to 01 on whichever condition you want.
If you can not get the access key to do above change the second option is to create a Z of above component and replace the standard but I do not support this option as it can impact at many places.
Please revert in case of issues.
Regards,
Sumit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Carmen,
I have a doubt that you can bind a standard UI Element to an Attribute. Properties of standard UI element can not be changed by enhancements. Otherwise, for this situation we can find many solutions to Hide some UI Elements by enhancement
here is a link about how to create it [->Create Enhancements<-|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/700317da-bd79-2c10-368e-8f18bf5d8b81?QuickLink=index&overridelayout=true]
Now enter with enhancement mode and try to DELETE this UI Element (it will not be totally deleted ) you can get it back if you want, by Click right in the Button and -> UNDODELETE.
Hope this Help
Best regards
Hi Carmen,
You can do the same dynamically.
Use the CL_WD_BUTTON runtime class.
For example in the WDmodifyView method you can use following pseduo code
lo_button = view->get_element( 'BUTTON' ).
If application_name is equal to 'App_1'
lo_button->SET_ENABLED with parameter true
else
lo_button->SET_ENABLED with parameter false
Thaks,
Prashant
Hi Carmen,
I tried binding the New Entry buttons visiblity with the newly created attribute and it works for me.
You can use the below code in the post exit of WDDOINIT ( or any method as per your flow) to handle button's visibility.
DATA lo_nd_zzbutton2 TYPE REF TO if_wd_context_node.
DATA lo_el_zzbutton2 TYPE REF TO if_wd_context_element.
DATA ls_zzbutton2 TYPE wd_this->Element_zzbutton2.
DATA lv_zzbuttonattrib TYPE wd_this->Element_zzbutton2-zzbuttonattrib.
* navigate from <CONTEXT> to <ZZBUTTON2> via lead selection
lo_nd_zzbutton2 = wd_context->get_child_node( name = wd_this->wdctx_zzbutton2 ).
* @TODO handle non existant child
* IF lo_nd_zzbutton2 IS INITIAL.
* ENDIF.
* get element via lead selection
lo_el_zzbutton2 = lo_nd_zzbutton2->get_element( ).
* @TODO handle not set lead selection
IF lo_el_zzbutton2 IS INITIAL.
ENDIF.
* @TODO fill attribute
IF sy-uname eq 'OBEROIS'.
lv_zzbuttonattrib = 02.
ELSE.
lv_zzbuttonattrib = 01.
ENDIF.
* set single attribute
lo_el_zzbutton2->set_attribute(
name = `ZZBUTTONATTRIB`
value = lv_zzbuttonattrib ).
.
Please revert back in case of issues.
Regards,
Sumit
Hi Carmen,
>
> I assume your requirement is to hide the button on some condition.
>
> Please check whether there is any attribute in the component which is boud to the visiblity of this button.
>
> If yes you can hide the button setting the value of that attribute to None ( WDUI_VISIBILITY = 01 ).
>
> If there is no such attribute then i can suggest below option:
>
> Create a context node and attribute ATTR of type WDUI_VISIBILITY and bind the visible property of this button to this attribute.
> Create a post-exit method for the WDDOINIT ( or any method suitable to the flow of this component) and set the value of ATTR to 01 on whichever condition you want.
>
>
> If you can not get the access key to do above change the second option is to create a Z of above component and replace the standard but I do not support this option as it can impact at many places.
>
> Please revert in case of issues.
>
> Regards,
> Sumit
Hi Sumit,
I dont think property of button in standard component can bind, even in enhancement mode, as its greyed out. I have tried without success. If you have done it with standard button, pls put out the steps. Also, deleting and creating the button with same ID does not work as it says the ID already exists.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.