What is a BAPI Wrapper?   |  BAPI Wrapper Types

 

Testing BAPI Wrappers

To check the logic and the implementation of the BAPI wrappers, the following simple ABAP test program can be written for each type of BAPI wrappers (e.g. using the transaction se38):

Bapi Wrapper Type

Call cycle
GetList
  1. Call GetList BAPI wrapper
  2. Call GetList BAPI wrapper again and verify the results are the same (header data in Tables parameter)
GetDetail
  1. Call GetList BAPI wrapper
  2. Call GetDetail BAPI wrapper and verify the object
Create
  1. Call Create BAPI wrapper
  2. Call GetDetail BAPI wrapper and verify the object (header data in Export parameter and items in Tables parameters)
Change
  1. Call GetDetail BAPI wrapper, and modify some fields
  2. Call Change BAPI wrapper
  3. Call GetDetail BAPI wrapper and verify the object (header data in Export parameter and items in Tables parameters)
Delete
  1. Call Delete BAPI wrapper
  2. Call GetDetail BAPI wrapper and verify that the object is deleted

 

These tests (other than the test for GetList) simulate what Smart Synchronization performs internally for the corresponding actions in the runtime. Thus, it is important to test each function module not just by single test execution (for example, from the transaction se37) but also by the combination of function modules.

In addition to the functional test above, it is also worth evaluating the performance of each BAPI wrapper function call.

Example

An example unit test program is the report MDK_SST_CONTACT_CREATE_UNITTST that can be found in any SAP system with mySAP Technology 6.20 (as of SP18).