cancel
Showing results for 
Search instead for 
Did you mean: 

Attribute Reference to class in component controller

Former Member
0 Kudos

Hi,

I have declared an attribute as reference to a class in component controller and i had made use of it to call methods (which inturn calls function modules) within the class. The class is activated successfully. When i syntax check the code, it says 'Field <attribute> is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement'.

I tried making it 'Public' and still resulted in same error. I tried to call the method with syntax 'WD_COMP_CONTROLLER -> <attribute> -> <methodname>'. Still i result in same kind of error. I am not sure on how to solve this error. Earlier posts in this forum doesnot give me a clear picture on how to solve this error. Can someone please help me to solve this error ?

Thanks,

Gaurav.

Edited by: Gaurav Subramaniam on Jun 4, 2009 8:09 AM

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Again,

Here is a way to access the ref variables of WD_COMP_CONTROLLER

att_ref   X(mark as public)     type ref to TEST_CLASS.

* Now in View, have one local var declared of similar type and get the comp_contr inst
lc_view_attr_ref  type ref to TEST_CLASS

lc_view_attr_ref = wd_comp_controller->att_ref.

* now using this lc_view_attr_ref, you can access class methods

Regards,

Manne.

Former Member
0 Kudos

Hi Gaurav,

Even i donot have idea on how to access ref variables for WD_COMP_CONTOLLER from view but what can be done as an alternative is below.

Declare attribute a referance(as you said and this will not given any syntax issue) and have two methods in COMP_CONTROLLER which will SET/GET the referance value.

Using these custom defined methods you can get the WD_COMP_CONTROLLER ref attribute to a local value and using this loca value you can call the class methods.

I know this is indirect way but it might be helpful.

Best Regards,

Manne.

Former Member
0 Kudos

Hi,

Have you given that attribute as TYPE REF TO as it is refering to your Zclass. Is that right.

Regards,

Lekha.

Former Member
0 Kudos

I also had a similar prob...still after doing wht u suggested...it was nt wrkng..??