on 07-10-2009 9:57 AM
Hi All,
I have a textview ui element, in that I inserted a menuitem. Inside that menu item I created two menuitem actions.
Now I want to hide one menuitemaction.To do this, menuitem action doesnot have "VISIBLE" property.
How to hide that menu item action in a menu
This is my problem.
Can anyone tell me how to hide that menu item action in a menu.
Thanks in Advance!
Edited by: sreelakshmi.B on Jul 10, 2009 2:48 PM
Hi,
I created a test application for your issue....the only option we get is to enable/disable the menuactionitem...the other option would be to create these actions dynamically...so depending on some condition...we create one but not the other...and vice versa....
hope this helps...
Thanks...
AS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I am not sure if you already know this or not....but here is the code to do that:
in WDDOMODIFYVIEW, I have following:
if some_condition = abap_true.
DATA lr_action_item TYPE REF TO cl_wd_menu_action_item.
DATA lr_menu TYPE REF TO cl_wd_menu.
lr_menu ?= view->get_element( 'MENU' ).
CALL METHOD cl_wd_menu_action_item=>new_menu_action_item
EXPORTING
id = 'OPTION'
text = 'OP1_1'
view = view
RECEIVING
control = lr_action_item.
lr_menu->add_item(
EXPORTING
index = 3
the_item = lr_action_item ).
ENDIF.
Just want to let you know that the "id" should be unique....in my test application I am creating only one action item so I kept it static....but you can create a counter variable (global, under the attribute tab)....and keep appending the counter with the "id" name....what i mean is this:
under the attribute tab create a counter of type N.
than
concatenate 'OPTION' counter into lo_id
lo_id is of type string.
this counter value can be increased by "1" everytime you create one action item.
for "text"...this is the text you want to show to the user under the menu item....
hope this helps....
Thanks...
AS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
THANKS!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
73 | |
11 | |
10 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.