on 07-22-2008 6:08 PM
Hi All,
I have an attribute C_MyAttr of type 'c' defined in the 'Attributes' tab in component controller.There is a requirement to define get and set methods for this attribute.
Please let me know the code to define this in the methods tab.
Thanks
Kukku.
>
> Hi All,
>
> I have an attribute C_MyAttr of type 'c' defined in the 'Attributes' tab in component controller.There is a requirement to define get and set methods for this attribute.
>
> Please let me know the code to define this in the methods tab.
>
> Thanks
> Kukku.
This sounds pretty basic.
For you SET method define an importing parameter of the method of type 'c' (perhaps named i_myattr). For the code:
wd_this->c_myattr = i_myattr.
For the GET method define a returning or exporting parameter of method of type 'c' (perhaps name e_myattr). For the code:
e_myattr = wd_this->c_myattr.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomas,
ThankYou for the quick response. I was a web dynpro Java developer and now into web dynpro ABAP.
The above code solved my problem for get method. But for set method,
wd_this->c_myattr = i_myattr.
I am getting 'i_myattr' is unknown
I defined an importing parameter of the method of type c.
Thanks
K
>
> Hi Thomas,
>
> ThankYou for the quick response. I was a web dynpro Java developer and now into web dynpro ABAP.
>
> The above code solved my problem for get method. But for set method,
>
> wd_this->c_myattr = i_myattr.
>
> I am getting 'i_myattr' is unknown
>
> I defined an importing parameter of the method of type c.
>
> Thanks
> K
Well if you defined an importing parameter and named it i_myattr then you won't get this error message. Check again that your names match.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.