cancel
Showing results for 
Search instead for 
Did you mean: 

Reg : wd_get_api( ) method

Former Member
0 Kudos

What is the use of wd_get_api( ). method??

Iam confused on this method....Can anyone help me .

When Iam using message manager..the below code got generated . Here why are we using this method?? this method Returns

of type REF TO if_wd_controller .

  • get message manager

DATA lo_api_controller TYPE REF TO if_wd_controller.

DATA lo_message_manager TYPE REF TO if_wd_message_manager.

lo_api_controller ?= wd_this->wd_get_api( ).

but when iam using popup window.. the below code got generated .Here why are we using this method?? this method Returns

of type REF TO if_wd_component.

DATA lo_api_component TYPE REF TO if_wd_component.

lo_api_component = wd_comp_controller->wd_get_api( ).

why there is difference in returning parameter ??

for message it is type REF TO if_wd_controller .

for poup it is TYPE REF TO if_wd_component

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

API is a framework/Interface which most of the technologies have them. It provides the classes/Interfaces/controlles and other programming

concepts to start with any technology. There should be some basis to start with the application/work on some technology right. In tihs case the API is useful.

For Ex: To create some UI elements/some logic, this API provides these basic set of tools in the form of classes/interfaces and many more...............To create custom UI element it should have some root class so that we can create it right.For this API is useful. It aslo provides some standard functionalities for the end user to work on with.

Refer these links-

http://help.sap.com/saphelp_nw2004s/helpdata/en/21/957f41964c050de10000000a1550b0/content.htm

Regards,

Lekha.

Answers (2)

Answers (2)

Former Member
0 Kudos
Former Member
0 Kudos

Hi Arjun ,

hope this post by neha satifies ur query :

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.

reference thread :

rgds.

amit