First BOPF example
In this section, we will try to play around with one of standard BOs to get a better understanding of how individual elements interact with each other. This example uses a standard object called /BOBF/DEMO_PRODUCT
, which represents the product.
Creating the object
Create a new report called ZMSA_R_CHAPTER9_1
in the ABAP Workbench and pass the report template from the Appendix. We will start by adding class attributes, that is, the three main BOPF API classes I mentioned previously. Put the following code into a private section of the lcl_demo
class definition:
DATA: mo_transaction_mgr TYPE REF TO /bobf/if_tra_transaction_mgr. DATA: mo_service_manager TYPE REF TO /bobf/if_tra_service_manager. DATA: mo_configuration TYPE REF TO /bobf/if_frw_configuration.
We also need a specific constructor definition:
METHODS: constructor RAISING /bobf/cx_frw.
The custom constructor initializes all of the variables. For this, we will use factory classes and their corresponding factory methods...