cancel
Showing results for 
Search instead for 
Did you mean: 

(ABAP) Internal table of type context node (Urgent)

Former Member
0 Kudos

Hi All,

I created a internal table in a view say ABC_VIEW using a context node say ABC_NODE. This is did using following statement:

it_abc type table of if_abc_view=>element_abc_node.

Now I would like to pass this as a exporting parameter to a method in component controller. Kindly suggest how i can achieve this. I tried the following:

it_abc exporting element_abc_node.

But this does not work.

Kindly reply soon.

Regards,

Anoop

Message was edited by: Anoop Singh Saini

Accepted Solutions (1)

Accepted Solutions (1)

thomas_szcs
Active Contributor
0 Kudos

Hi Anoop,

Web Dynpro generates an internal table (and structure) for each context node in a controller's context. Such a definition is local to the controller where the node is defined, since a different controller could have a node of the same name with different attributes. Nonetheless, it is possible to transfer the data of a node to another controller by:

(a) Using a DDIC structure for a context node. The generated structure and the DDIC structure are the same then. The generated internal table is a standard table. If you define one in DDIC or somewhere else, you can use it for typing the parameter.

(b) Transfer the pointer to the node! You can still access it from any other place.

Best regards,

Thomas

Former Member
0 Kudos

Hi Thomas,

Thanks for suggestion but in my case i have already written the two methods of which one is in view and other in component controller so i thought incase we could make a direct communication link then it would have been good .. i knew this DDIC thing but was hesitent in creating a structure i guess i now will have to use this approach only ..

Thanks again.

Regards,

Anoop

Former Member
0 Kudos

Hi Thomas,

Just curious to know how you can pass pointer to that node. So can you please post the solution or the steps that i should take to achieve my objective using the second approach, "(b) Transfer the pointer to the node! You can still access it from any other place.", suggested by you.

Regards,

Anoop

Message was edited by: Anoop Singh Saini

thomas_szcs
Active Contributor
0 Kudos

Hi Anoop,

Just get the pointer to the node via one of the usual methods, like GET_CHILD_NODE of wdContext or any other way you like. Then create a parameter of your method foo type it as "type ref to IF_WD_CONTEXT_NODE". The sample coding below will pass a pointer of child node "bar" of wdContext to the method.

data lr_node type ref to if_wd_context_node.

lr_node = wd_context->get_child_node( 'BAR' ).

foo( lr_node ).

Best regards,

Thomas

Former Member
0 Kudos

Hi Thomas

I actually want to define this as the type for the formal parameter of the method 'foo'.

Regards,

Anoop

thomas_szcs
Active Contributor
0 Kudos

Hi Anoop,

Just type the parameter as type ref to IF_WD_CONTEXT_NODE.

Best regards,

Thomas

Answers (0)