cancel
Showing results for 
Search instead for 
Did you mean: 

How Attributes declared in Component level can be used in All the views

nagarjun_kalletla
Participant
0 Kudos

How Attributes declared in Component level can be used in All the views

For Example :

say : context type ref to if_wd_context_node.

is declared at component controller level and check box public is checked !!

How can we use this any view in same WDP Component..

For suppose : in this case

We want to get the ref of child node using above declared attribute..

How is it possible?

Say in detail

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

You have already WD_CONTEXT variable declared in attributes tab right...

Anyways, if you want to access any attribute of component controller->

wd_comp_controller->context-> ........... this way you can use it

nagarjun_kalletla
Participant
0 Kudos

Thank you so much for replying .....

How can we declare tables,attribute,like <xxxxx> type ref to <xyz class>

at component controller level and how can we use the tables and the <xxxxx> in the all views?

Do we need to do any mapping kind of a thing like for the context we do from comp level to view level...

Please reply briefly in each cases tables and any other ....

Thanks in Advance

Lukas_Weigelt
Active Contributor
0 Kudos

You can do this by doing the exact same like you did with the if_wd_context_node.

1. Define attribute in Comp Controller and set it PUBLIC.

2. Access the attribute over the reference of the comp controller, i.e. wd_this within the comp controller itself or wd_comp_controller within somewhere else in the component.

So if you have, lets say, this defined as attribute in your comp controller:

Z_MY_TABLE_REF [X] TYPE REF TO [X] PUBLIC CL_WD_TABLE.

And then you want to catch the reference into a local variable within a method or the like within a view:

DATA: lo_my_table_ref TYPE REF TO CL_WD_TABLE.

lo_my_table_ref = wd_comp_controller->z_my_table_ref.

Lekha has already said so as well, I don't really understand where the problem is

Cheers, Lukas

Former Member
0 Kudos

If you want to declare an internal tbale then 1st declare the table type for it in SE11 and try to declare an internal table referring to this table type, make it public and you can access using WD_COMP_CONTROLLER->TABLENAME...