Entering content frame

This graphic is explained in the accompanying text Free Methods of the Application Development

As an application developer, you can create and implement your own methods for each controller. These self-defined methods are typically used to read and edit data. These methods can be called within the controller by other methods which are also implemented by the application developer. Locate the document in its SAP Library structure

This graphic is explained in the accompanying text Example:

In the following example, the method GET_FLIGHTS has been implemented to read data from the back end for the current controller. This data is to be used in the second method of the same controller.

 

 

method GET_FLIGHTS .  

.

.

endmethod.

 

 

 

method FILL_CONTEXT_NODE .  

 

data: FLIGHTSTRUC type SPFLI.

      MY_NODE type ref to IF_WD_CONTEXT_NODE.

 

FLIGHTSTRUC = WD_THIS->GET_FLIGHTS( ).

 

MY_NODE = WD_CONTEXT->GET_CHILD_NODE( ‘MY_CONTEXT_NODE’ ).

 

MY_NODE->BIND_STRUCTURE( NEW_ITEM = FLIGHTSTRUC ).

 

 

endmethod.

 

 

The reference variable WD_THIS is used to call the controller method GET_FLIGHTS and to pass the return value to the internal variable FLIGHTSTRUC.

In the next step, the context node MY_CONTEXT_NODE is passed to a second internal variable MY_NODE of the type IF_WD_CONTEXT_NODE (see above, section for WD_CONTEXT).

The last step is to bind the internal variable FLIGHTSTRUC to MY_NODE.

Free Methods of the Component Interface

Each free method you created and defined for the component controller can be added to the interface of the component. To do this, you can check the Interface checkbox of the Methods  tab of the component controller in the table. Each method for which you checked the checkbox is a part of the interface controller of the component and is available using controllers of other components (see also Cross-Component Programming).

 

 

Leaving content frame