Web Dynpro ABAP: Assistance Class
The article is written to illustrate the use of Assistance class in WebDynpro ABAP.
About Assistance Class:
For each Web Dynpro component, a uniquely assigned assistance class can be created. Creating an assistance class for a component provides the following benefits:
● We 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. 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.
Web Dynpro ABAP: Creating Assistance class
Consultants should have basic knowledge of creating and using class/methods. They should have basic WebDynpro ABAP knowledge. Refer the link given in reference section for detailed step by step explanation for creating select-option.In this article, we are going to create Assistance class with a method which will retrieve the details for group of employees and the same will be called from WebDynpro.
Steps to create class:
Go to SE24 and create class ZZZ_CL_JAYTEST.
Declare the below in types.
Use the arrow on the right side to define the following.
Step 3: Define Method Get_Empdetails.
Place the cursor in the method GET_EMPDETAILS and choose parameters to add the below.
Steps to create WebDynpro
Create an Web Dynpro component (say zzz_jaytest20). In properties, mention the name of the class which we created now in Assistance class and then include WDR_SELECT_OPTIONS component in Used Components section as shown below.
Detailed step by step explanation is given in the article mentioned in the reference for creating select-option.Write the below coding in WDDOINIT method of VIEW Main to create select-option.
Mention the type name as P_PERNR and search help as PREM(we can find it from Tcode PA20->F1 help->Technical Information of personnel number.
In the window (Say ZZZ_JAYTEST20), embed the select-option as below.
Create Web Dynpro Application(say zzz_jaytest20).
Enter the employee range.