Entering content frame

Background documentation Working with the Assistance Class Locate the document in its SAP Library structure

For each Web Dynpro component, you can create a uniquely assigned assistance class. This class should inherit from the abstract class CL_WD_COMPONENT_ASSISTANCE. The assistance class of a component provides the following advantages:

·        You can store coding there that is required within the component, but is not linked directly with the layout or with the function of a controller. This could be, for example, a call of the application layer or UI-based editing of the data.

Note Method calls of the assistance class are much better from a performance point of view than calls of methods of a Web Dynpro controller.

·        The second important function of the assistance class is the management of dynamic texts. Texts that are combined at runtime only and/or contain variables can be stored in the text pool of the assistance class as text symbols.

 

The assistance class is automatically instantiated when a component is called. The instance is available to each controller of the component through the attribute WD_ASSIST.

 

Working with Text Symbols in Web Dynpro ABAP

The class CL_WD_COMPONENT_ASSISTANCE provides central functions through which a Web Dynpro component can access text symbols of the assistance class. Using the instance attribute WD_ASSIST as well as the method _WD_COMPONENT_ASSISTANCE~GET_TEXT( ), you can access text symbols of the assistance class from within each controller of your component. When the method is called, the three-digit ID of the text symbol is passed to the KEY parameter.

 method MY_CONTROLLER_METHOD .

 

data: my_text type string.

 

   my_text = WD_ASSIST->IF_WD_COMPONENT_ASSISTANCE~GET_TEXT( KEY = ‘001’ ).

  

.

.

endmethod.

 

Caution Accessing text symbols from a Web Dynpro component is different from the same procedure in ABAP objects (Structure linkText Symbols in General ABAP Programming).

 

Maintaining text symbols in the assistance class is possible from each controller. For this purpose, choose the entry Goto->Text Symbols in the menu.

 

Note As a rule, every ABAP class can serve as an assistance class; however, the services integrated in the Web Dynpro framework are available only if the assistance class is derived from the class CL_WD_COMPONENT_ASSISTANCE.

 

 

Leaving content frame