Monday, 7 September 2020

How to Test BAPI Function Module in SAP?

Introduction


As a SAP Consultant at some point of your career you will use BAPI. There is special way to test a BAPI whether it is really useful for you to call in your Program.

Solution


In our example we will be using BAPI_PO_CHANGE to change some fields in PO Line Item.

SAP ABAP Development, SAP ABAP Exam Prep, SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Guides

Now we will fill the Parameters and save it as a Test Data

SAP ABAP Development, SAP ABAP Exam Prep, SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Guides

Below is the Saved Test Data Entry

SAP ABAP Development, SAP ABAP Exam Prep, SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Guides

Now we go back to SE37 and follow the below path

SAP ABAP Development, SAP ABAP Exam Prep, SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Guides

We will put the following Function Modules.

SAP ABAP Development, SAP ABAP Exam Prep, SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Guides

Now we execute based on the saved Test data

SAP ABAP Development, SAP ABAP Exam Prep, SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Guides

After Executing we will hit Back Button and this will call the Commit Function Module

SAP ABAP Development, SAP ABAP Exam Prep, SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Guides

BAPI_TRANSACTION_COMMIT is called and we execute

SAP ABAP Development, SAP ABAP Exam Prep, SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Guides

Now executing is completed and the Database has commited.

SAP ABAP Development, SAP ABAP Exam Prep, SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Guides

No comments:

Post a Comment