Implement a Business Add-in (`BAdI`) To Check a Purchase Requisition
- How to log on to SAP S/4HANA Cloud ABAP Environment
- How to create an ABAP package
- How to find relevant existing
BAdI
enhancement spots for your line of business, in this case Materials-Management-Purchasing - How to implement a
BAdI
that checks for the field quantity and delivery date during creation of purchase requisition item
Prerequisites
- You have a license for SAP S/4HANA Cloud and have a developer user in this system
- You have installed SAP ABAP Development Tools (ADT), latest version, and have created an ABAP Cloud project for your SAP S/4HANA Cloud System in it
- You are familiar with the concept of extensions to the SAP standard and with
BAdIs
in particular. If not, see the More Information section at the end of this tutorial - To test the
BAdI
: In SAP Fiori launchpad, you have the authorization for the app Process Purchase Requisitions - Professional, i.e.SAP_BR_PURCHASER
The administrator receives an welcome e-mail after provisioning. This e-mail includes the system URL. By removing
/ui
you can log into the SAP S/4HANA Cloud ABAP Environment system. Further information can be found Developer Extensibility: Connect to the ABAP System.
A Business Add-In (BAdI
) an object-oriented enhancement option, a hook for an object plug-in. It enables you to implement enhancements to standard SAP applications with out modifying the original code.
In these tutorials, SAP has already defined the BAdI
enhancement spot, MM_PUR_S4_PR
for the Fiori App Manage Purchase Requisitions – Professional, and the BAdI
definition, MM_PUR_S4_PR_CHECK
.
You then implemented the BAdI
in the SAP Fiori app as follows:
1. At the BAdI
definition MM_PUR_S4_PR_CHECK
, you create a container, known as a BAdI
implementation, containing a class.
2. You then create a method (i.e. implementation) within this class.
Thus it becomes a BAdI
implementation for this BAdI
definition.

At runtime:
- The user creates a purchase requisition.
- The enhancement checks:
- the quantity of items ordered is 10 or fewer
- the date is 180 days or fewer in advance
- If not, the application returns an error.
The application will look roughly like this:


Throughout this tutorial, objects name include a prefix, such as xx
or suffix, such as XXX
. Always replace this with your group number or initials.