Creating and Using ABAP Classes
Use
The Web Design API for Tables enables you to modify individual cell data in relation to content, display and navigation options. To do this, you create your own ABAP class that inherits the associated properties and parameters from the class CL_RSR_WWW_MODIFY_TABLE and you redefine one or more methods for this class.
Prerequisites
You have created a Web application that includes the Web item Table and/or the Web item Generic Navigation Block.
Procedure
Create ABAP Class
...
1. From the SAP Easy Access screen, choose Tools ® ABAP Workbench ® Development ® Class Builder (transaction SE24). See also
You can also use the Object Navigator from the ABAP Workbench (transaction SE 80) to generate a class. See also
2. To create a new class, under Object Type, enter a technical name for your class (for example, ZCL_RSR_WWW_MODIFY_TABLE) and choose
3. Save your class. You get to the Object Catalog screen.
4. Depending on the system configuration in regard to changes and the transport of objects, either choose a package or save your class as a local object. For more information, speak to your system administrator. The Class Builder: Change Class YOURCLASSNAME screen.
5. Choose Superclass on the Properties tab page. Under Inherits from, enter CL_RSR_WWW_MODIFY_TABLE as the superclass.
6. To see all of the inherited properties and methods of the class CL_RSR_WWW_MODIFY_CLASS in your ABAP class, choose
7. On the Methods tab page, choose a method (for example, CHARACTERISTIC_CELL or GET_CELL_INFO) that you want to redefine and choose
8. To change the implementation of the method, call up the method name by double clicking.
9. To get back to the original screen, choose
10. Save your changes.
11. To activate event linking, choose
Using an ABAP Class in a Web Template
To be able to use the ABAP class you created, it must be included in a Web template.
...
1. Open your Web template that contains the Web item Table and/or Generic Navigation Block in the BEx Web Application Designer.
2. Use the HTML tab page to switch to the HTML view of the Web Application Designer.
3. Navigate to the Object Tag of the Web Item Table and/or the Web Item Generic Navigation Block (CL_RSR_WW_ITEM_GRID and/or CL_RSR_WWW_ITEM_NAV_BLOCK) and insert the following parameter line into the HTML:
<object>…
<param name=“MODIFY_CLASS“ value=”YourClassName”/>
…</object>
<object>…
<param name=“MODIFY_CLASS“ value=”ZCL_RSR_WWW_MODIFY_TABLE”/>
…</object>
4. Save the changes.
5. Execute the Web template in the browser.
Debug ABAP Class
For test purposes, you can debug the ABAP class. By setting breakpoints in the redefined methods and using the ABAP debugger, you can determine when the individual methods are called and which information they provide. To better understand the individual methods, you can redefine the methods for test purposes. You can set a breakpoint on the individual method without inserting code. You can see all values for the parameters assigned to the method in the debugger. See also
...
1. From the SAP Easy Access screen, choose Tools ® ABAP Workbench ® Development ® Class Builder (transaction SE24).
2. Under the object type, enter the name of the ABAP class you created.
3. Choose
4. Double click on one of the methods in the Methods tab page that you have changed when creating your ABAP class.
5. To set an external (HTTP) breakpoint in your method, in the menu, choose Utilities ® Breakpoints ® Set/Delete.
· Two types of breakpoints exist: External (HTTP) Breakpoints enable debugging in the Web browser. Session Breakpoints enable debugging within transactions. BEx Web Applications are usually executed in the Web browser. The query monitor (RSRT2) transaction allows you to display a BEx Web application in the SAP GUI. Depending on how you call up your Web application you can choose the appropriate breakpoint type.
· To be able to set an external breakpoint, you have to set the external debugging to active. You can set external debugging to active in the menu under Utilities ® Settings... ® ABAP Editor ® Debugging in the External Debugging field. .
6. Close all Web browser windows or query monitor instances (RSRT2) before you call the Web application in which you have included your ABAP class. Otherwise the debugger could not stop at the set breakpoint.
7. Execute the Web application in the Web browser or in the query monitor transaction. You reach the ABAP debugger that stops at the breakpoint you set.
Result
You have created an ABAP class and have redefined one or more methods to specifically change the display of tables and the generic navigation block with the help of the Web Design API for tables.