Enhance standard business objects so that you can customize them to your requirements without creating new business objects or modifying the standard business object. You can develop the standard business object’s method to fulfill additional requirements such as adding related standard or custom fields.
Key Concept
A business object is the interpretation of a real-time entity in an object-oriented way. Examples of business objects are materials, inspection lots, sales orders, and purchase orders. A business object has both attributes and methods. Attributes are the characteristics of business objects. For example, Inspection Lot (BUS2045) contains attributes such as inspection lot number, plant, and item. Methods are the actions that the business object can perform. For example, Inspection Lot (BUS2045) encapsulates methods such as Create, Edit, and GetDetail.
Business objects are frequently used in workflow and interfaces with non-SAP applications. In either case, you mostly create a new business object to fulfill a requirement for a particular business process. For example, with custom fields of the material master, no method is available in the business object of material BUS1001 to either get or set the custom fields. In such situations, you create a new custom business object to cater to these requirements. Creating new business objects has the risks of low performance and continued maintenance. To overcome these problems, the solution is to enhance the standard business object to fulfill specific requirements, resulting in fewer performance and maintenance risks.
You need to enhance two sections to improve a business object’s method: the parameter enhancement and the source code enhancement. Methods are events of the business object that are performed based on the business need. Methods are used for either data manipulation or data modification. Methods for data manipulation provide the attribute values after performing a certain procedure. Methods for data modification either create or change the attribute values as per the requirements. With data manipulation, the parameter enhancement requires you to improve the structure used in either exporting or changing the parameter. You can enhance the structure by customizing includes or appending structures. The source code enhancement is implemented by an implicit enhancement. With data modification, the difference from data manipulation is that the import parameter is used instead of the export parameter. The remaining parameter and source code enhancements remain the same.
Here are two examples of enhancing a standard business object:
- Example 1: For the standard business object Inspection Lot (BUS2045), the business process needs information related to the material, then the standard business object’s method is developed to provide additional information without creating a new business object. In this example, you need customizing includes and an implicit enhancement that are implemented to cater to these requirements.
- Example 2: For the standard business object of material BUS1001, the additional information of material group standard and custom fields is required by the user, and then the standard business object’s method is enhanced to cater to these requirements. In this example, an append structure and implicit enhancement are used to fulfill the business process.
I now show you how to implement these two examples. Before you implement these enhancements in the business object, however, you must have knowledge of ABAP, including the ABAP Data Dictionary, function modules, and business objects.
Enhance a Business Object Using Customizing Includes and an Implicit Enhancement
In this example, I describe the procedure to enhance the method GetDetail of business object Inspection Lot (BUS2045). Use transaction SWO1 to go to the Business Object Builder (Figure 1).

Figure 1
Screen of business object builder
Enter the business object name that you want to enhance and then click the Display button. The business object’s component overview is displayed (Figure 2). Select the method that you want to enhance. In this example, select the GETDETAIL method of business object Inspection Lot (BUS2045).

Figure 2
Business object’s component overview screen of BUS2045
On the new pop-up screen, the ABAP tab and the API function radio button are selected by default. Double-click the function module that is populated in the Name field to open the function module (Figure 3).

Figure 3
Function module selection screen of GETDETAIL method
Go to the Export parameter tab of function module (Figure 4). Here, the customer include exists that contains customizing include CI_QALS. Select the type BAPI2045CI of export parameter CUSTOMER_INCLUDE_DATA for enhancement.

Figure 4
Method’s export parameter screen
Double-click the type BAPI2045CI of export parameter CUSTOMER_INCLUDE_DATA. The component overview of structure BAPI2045CI is displayed (Figure 5). Currently, no CI_QALS structure exists in the ABAP Dictionary.

Figure 5
BAPI2045CI component overview screen before enhancement
To create the structure CI_QALS double-click Component Type CI_QALS. The pop-up screen appears and asks whether you want to create new structure CI_QALS (Figure 6). Click the Yes button.

Figure 6
Create structure CI_QALS
Now add new fields in structure CI_QALS based on the user requirement and then click the activate icon on the toolbar to activate the structure (Figure 7).

Figure 7
The BAPI2045CI component overview screen after enhancement
You have completed the parameter enhancement. Now you need to configure the source code enhancement. First, select the Source Code tab of the function module. Now click the enhance icon on the toolbar for source code enhancement (Figure 8).

Figure 8
Enhance the standard source code
Follow menu path Edit > Enhancement Operations > Show Implicit Enhancement Options. Go to the end of the function module before the ENDFUNCTION statement. Select the implicit enhancement section that appears in this module and then choose Edit > Enhancement Operations > Create Implementation from the menu. You see two enhancement types: Source Code and Data Declaration. Click the Code button to select the enhancement type of source code (Figure 9).

Figure 9
Select the enhancement type
Now enter the Enhancement Implementation name and Short Text (Figure 10) to differentiate between the different types of enhancement implementations.

Figure 10
Enter the name and short text of the enhancement implementation
Select the new enhancement implementation to enhance the source code of the function module (Figure 11).

Figure 11
Select the new enhancement implementation
Now add the source code logic based on your requirements (Figure 12). You can write the following statements in this new implementation:
- Modify any return parameter value
- Modify the data in the transparent table (directly or through the function module)

Figure 12
New logic in the source code of the function module
Now test the method GETDETAIL of business object BUS2045. The results of the method are in Figure 13.

Figure 13
Display results of the GETDETAIL method
You can see that the structure CUSTOMER_INCLUDE _DATA contains the value against field ZZMAKTX (Figure 14).

Figure 14
Display the results of structure CUSTOMER_INCLUDE_DATA
Enhance the Business Object Using Append Structure and Implicit Enhancement
In this example, I explain the procedure to enhance the method GetDetail of business object BUS1001. Perform the same steps as in the previous section to go to the function module of the business object’s method.
Go to the Export tab of the function module (Figure 15). No customer include exists, so you have to use the append structure for type BAPIMATDOA of structure MATERIAL_GENERAL_DATA parameter. To do this, double-click the structure type BAPIMATDOA.

Figure 15
The export parameter screen for GetDetail of business object BUS1001
Click the Append Structure… button from the toolbar to append the structure (Figure 16).

Figure 16
Overview of BAPIMATDOA structure
Now a pop-up screen appears. Click the create append icon (Figure 17).

Figure 17
Create a new append structure for the BAPIMATDOA structure
Now specify the Append Structure name and the new fields to be added in the append structure. You can add both standard and custom fields (Figure 18).

Figure 18
The append structure overview screen
Save and activate the append structure. You have completed the parameter enhancement. The source code enhancements are the same as shown in the previous section.
Note
Keep in mind two exceptions:
- In the parameter enhancement, if no structure parameter exists in the function module, then that method of business object cannot be enhanced.
- In the source code enhancement, the batch data communication is not possible, whereas the function module can be used instead.
Saif ur Rehman
Saif ur Rehman is an SAP ABAP team lead at DESCON Engineering Limited in Pakistan. He has more than five years of SAP experience. He has an MS degree in computer science and has worked in industries such as FMCG, health, beverages, and telecommunications. Formerly, he worked at PepsiCo Inc. and Pakistan Telecommunication. To contact the editor, click here.
You may contact the author at saif.rehmann@gmail.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.