on 05-26-2011 3:15 AM
Hi all,
We have a main component in which on press of a button we need to show alv which is in another component.
I am trying to follow these steps but i need your inputs
1. I have declared the component which calls alv in used components
2. In the main view of my component i have placed a VCU
3. In the window of the main component i have embedded that VCU and embedded the view of the component which calls the alv.
Now how can i call alv on press of that button ?
Please let me know your suggestions
Regards
Bhanu
Hi Bhanu,
I think you follow all steps how to use component usage right.
if not check this,..
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/2e71ce83-0b01-0010-11a4-98c28a33195f
On button click just call another component view using code wizard. you can get.
cheers,
Kris.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks all it worked
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Aditya has the right idea in my opinion. I always do things this way (altering visibility) because 1. it's easiest and 2. you don't have initializing problems. Here's how you can do it:
First of all, set your ViewContainer invisible in design time.
1. Go to the Component controller of your main component (where your ViewContainer is in), go to attributes
2. Add an attribute Z_GO_VIEW, Public, Type ref to, IF_WD_VIEW.
3. Go to your View of the CC where the VC actually is in.
4. Go to hook method WDDOMODIFYVIEW
5. Add the following code:
IF first_time = abap_true.
wd_comp_controller->z_go_view = view.
ENDIF.
--> now you have the instance of your view interface.
6. Make a button
7. In the event handler method of the button, code something alike to this:
DATA:
lo_el_ui_root TYPE REF TO cl_wd_uielement_container,
lo_el_trans_cont1 TYPE REF TO cl_wd_uielement_container,
lo_el_button1 TYPE REF TO cl_wd_button.
DATA: lv_visibility TYPE WDUI_VISIBILITY.
lo_el_ui_root ?= wd_comp_controller->z_go_view->get_element( 'ROOTUIELEMENTCONTAINER' ).
lo_el_trans_cont1 ?= lo_el_ui_root->get_child( ID = 'TC_ONE' ).
lo_el_button1 ?= lo_el_trans_cont1->get_child( ID = 'I_AM_THE_MIGHTY_BUTTON' ).
lv_visibility = '02'.
lo_el_button1->set_visible( value = lv_visibility ).
This isn't exactly what you'll need but you get the picture: Get the View Instance, Downcast the UI tree for the Element you want to dynamically alter, use the right method for alterations.
This should solve your problem. If it doesn't, ask us again
regards, Lukas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
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.