on 04-03-2014 10:15 AM
Hi All,
Can anyone explain how to access Variables of attributes TAB of component controller and view .
1)I have declared variable
g_werks1 in component controller attributes tab
g_werks2 in view attributes tab .
can I use g_werks1 and g_werks2 any where in my compoent.
2)can we change the content of the g_werks1 and g_werks2 ?.
Please provide me some example how use them.
I gave a try as below
in component controller methods
g_werks1 = '123'.
in view methods
WD_COMP_CONTROLLER->g_werks1 = '123'.
g_werks2 = '123' w.r.t View
its throwing error “Field "G_WERKS" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement."
Thanks
Gopal
Hi Gopal,
To use attributes you have to use instanse variable of the component controller or view.
In your component controller attributes tab you will have,
wd_this which is referring to if_component_controller. This reference variable you can use in anywhere in component provided its Public property is checked.
if you are using at component level -> use like wd_this->g_werks1.
If you want to use the same in view level -> use wd_comp_controller->g_werks1. beacuse view will have comp controller instance.
You can not use views variables inside component controller.
Similarly views variable you can use as wd_this->g_werks2.
Regards,
Ravikiran.K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
To access view attributes in view( or component controller attributes in component controller) use
wd_this->attr_name.
To access component controller attributes in view use, wd_comp_controller->attr_name.
You have to make that attribute public visibility. Select the public check box for that attribute( as shown below) in component controller to access it out side.
Hope this helps u,
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.