cancel
Showing results for 
Search instead for 
Did you mean: 

Internal tables

Former Member
0 Kudos

Hello,

To avoid selecting the same data from DB I need to keep some data in internal tables. Those data are used to do the validations, every time the page is charged and the user selects some options. Can I define somehow the typical internal tables which will be visible from componentcontroller? Is it necessary to create the nodes and attributes to keep those data (in my case it would be more then 10 different kinds tables..)?

Thank you in advance.

Anna

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Anna,

You can use the Controller's <b><i>Attributes</i></b> to achieve this functionility. Just create some attributes (under the ATTRIBUTES tab) and store your data there instead of the context.

Also, just for information, a context's main purpose is store UI related data. So using Attributes should be a way out for you.

Hope this helps.

Regards,

Neha

Former Member
0 Kudos

Thanks Neha,

I have tried this, but the problem is that this new attribute is not visible from the method of componentcontroller. How should I access it? For example I have defined in the Attribute tab new attribute with the name TEST. If i try to use it as "TEST" in one of the methods I cannot activate the code.

Regards,

Anna

Former Member
0 Kudos

Hi Anna,

Define the attribute in your component controller and mark it as PUBLIC.

Now, in your view, u can use the following to access your attribute.

DATA lo_componentcontroller TYPE REF TO ig_componentcontroller .

lo_componentcontroller = wd_this->get_componentcontroller_ctr( ).

DATA str TYPE string.

str = <b>lo_componentcontroller->test</b>.

Also, to access the attribute in your component controller, just use <b>wd_this->test</b>

Hope this helps.

Regards,

Neha

Former Member
0 Kudos

Hi Anna.

use wd_this->test.

Cheers,

Sascha

Former Member
0 Kudos

Thanks a lot Neha and Sascha. It works!

Answers (1)

Answers (1)

Former Member
0 Kudos

Anna,

Best bet is to use a ASSISTANCE CLASS for this. Define ur attributes in the assistance class and store ur tables and other parameters in the assistance class.

The dynpro runtine automatically creates a handle for the assistance class, wd_assist

Storing in assistance class had advantage of separating WebDynpro logic and application logic for better maintenance. Also better performance using assistance classes.

U can define assistance class by dould clicking ur component and entering the assistance class name.

The assistance class must inherit fro CL_WD_COMPONENT_ASSISTANCE.