cancel
Showing results for 
Search instead for 
Did you mean: 

purpose of methods wd_get_api ?

Former Member
0 Kudos

Hi friends..

while creating web dynpro component in WDA. automatically controller interface if_componentcontroller get created.

inside the code.. i can able to see

1. constant for context name

2. elments for context node

above 2, i created in the context node so its coming but

3. methods wd_get_api

returning

value(Result) type ref to IF_WD_COMPONENT.

what is the purpose of this code ?

why it wil come ? wen we use thid method ?

kindly give some inputs

regards

deva

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Answers (2)

Answers (2)

Former Member
0 Kudos

Solved my own

Former Member
0 Kudos

Hi,

When you create any web dynpro component, two controller interfaces are created. One you can see at design time of type IF_COMPONENTCONTROLLER, this is the interface which provides you necessary API specific to your component only. Like contexts,nodes,attributes,events etc. The reference variable which is available in code is wd_this.

However at runtime you also get an access to so called run time interface of type IF_WD_COMPONENT. This is a generic standard API which is provided by web dynpro framework to access some important information related to the component. This particular interface contains near about 20 methods which gives you different information. To see the methods just go through the interface IF_WD_COMPONENT in se24. So the method wd_get_api just returns you the instance/object of type IF_WD_COMPONENT. This interface is implemented by web dynpro framework so you need not to worry about that. Once you have the instance you can use this API in your code as and when required.

I suggest you to go through the methods that will give you clear picture what type of information I am refering to.

Regards,

Neha