cancel
Showing results for 
Search instead for 
Did you mean: 

Small query in ABAP dynpro

Former Member
0 Kudos

Hi Experts,

I am new to ABAP webdynpro. I have created a sample application following the example provided in the SAP help. In one of "supply function" I have used the below code for getting the node in a context


datanode = wd_context->get_child_node( name = 'DATA' ).

wd_context refers to the interface IF_WD_CONTEXT_NODE. I went to this interface and identified the method get_child_node. But when I double click on the method nothing happens. I want to see the coding , how the system gets the node using this method.

thanks

sankar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Sankar,

When you have a reference to an Interface (IF_), you cannot see the code.... it's just an interface, not an implementation. So, when you open IF_WD_CONTEXT_NODE or any other interface, you cannot see the code.

When you have a Class (for instance: CL_WD_TABLE), you can browse through the code.

Regards,

Andre

Former Member
0 Kudos

HI

Thanks for your reply,

I understand that the interface methods does not contain any coding in the methods. But when the system executes the below statement

datanode = wd_context->get_child_node( name = 'DATA' ).

it must execute some logic to search the context for the child node DATA. am I right?. I want to know where is that logic written

thanks

sankar

Former Member
0 Kudos

Hin

go to se80, set your browser on classes/interfaces

and put in if_wd_context_node as interface

there you will see what you need

grtz,

Koen

Former Member
0 Kudos

Hi Sankar,

IF_WD_CONTEXT_NODE is an interface and hence has no code in it. You need to find the code inside a class which implements this interface. In this case, you need to go to class CL_WDR_CONTEXT_NODE.

Again, CL_WDR_CONTEXT_NODE is an abstract class. So you need to find the implementation inside a subclass. In this case, the subclasses are CL_WDR_CONTEXT_NODE_MAP and CL_WDR_CONTEXT_NODE_VAL. Both implement the method we are talking about.

These are general OOPS concepts.

The hierarchy of classes and interfaces can be very easily found by using the 'Object List' tool for the selected object (Short cut ctrlshiftf5)

Hope this helps.

Regards,

Neha

Message was edited by:

Neha Agrawal

Former Member
0 Kudos

Hi Neha,

Thanks for your answer. I am able to see the code for get_child_node method. But in the below statement

datanode = wd_context->get_child_node( name = 'DATA' ).

wd_context refers to inerface IF_WD_CONTEXT_NODE and not to the subclass CL_WDR_CONTEXT_NODE_MAP or CL_WDR_CONTEXT_NODE_VAL. So as the method is implemented in the above sub classes, how the system access these methods refering to the interface.

thanks

sankar

Former Member
0 Kudos

Hello Sankar,

That is why you need some OOPS knowledge before starting WD ABAP.

<b><i>At run-time, a reference to an interface can hold the instance of any class that implements it.</i></b>

You can debug your code and see that at run time, wd_context will not be an instance of if_wd_context_node (which is never possible) but of one of the web-dynpro run time classes. In our case, wd_context is the reference to interface if_wd_context_node and at run-time, it will be hold the instance of one of the two classes mentioned.

Hope this is clear

Regards,

Neha

Message was edited by:

Neha Agrawal

Former Member
0 Kudos

Hi Neha,

I have some knowledge on oops , but it seems I need more. I have debugged the program and understood the exact flow.

Thank you very much for your help.

thanks

sankar

Former Member
0 Kudos

Welcome! (Anytime )

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

the only thing you can do is clicking on parameters to see the import and export parameters

briefly it gets a reference of the child node, meaning an object if_wd_context_node

with name 'DATA' so it looks in the context if you have a lower level node with the

name you put as exporting parameter in the function call

grtz,

Koen