BAdi Enhancement Implementation using Developer Extensibility in SAP S/4HANA Cloud Public Edition
Share

[[{“value”:”

Introduction

In On Stack extensibility, Enhancements can be created using BAdi Enhancement Implementation in Developer Extensibility.

Developer extensibility using SAP Cloud ABAP Environment for developer extensions.

 

Business Accelerator Hub

SAP Business Accelerator Hub provides a section for On Stack extensibility (key user extensibility and developer extensibility), to know list of SAP CDS views, APIs, Business Add-ins etc. are available with the release status.

On Stack Extensibility -> Business Add-ins

Search for required BAdi.

YogiPavan_0-1775621840701.png

This BAdi is related to check purchase order before saving to create it.

Here it shows BAdi Definition and Enhancement spot.

BAdi can be used in both Key User and Developer Extensibility as both states of BAdi is in released state.

YogiPavan_1-1775621840713.png

Methods and its Parameters

YogiPavan_2-1775621840720.png

Developer Extensibility – BAdi Enhancement Implementation

Steps to Create Impelementation

Create New BAdi Enhancement Implementation

YogiPavan_3-1775621961523.png

Chose BAdi Enhancement Implementation.

YogiPavan_4-1775621961525.png

Add Name and description.

YogiPavan_5-1775621961530.png

Add Enhancement Spot

YogiPavan_6-1775621961535.png

BAdi Enhancement Implementation is created.

YogiPavan_7-1775621961539.png

Choose BAdi Implementation to add Implementations.

YogiPavan_8-1775621961541.png

Add BAdi Definition and Custom Class name

YogiPavan_9-1775621961545.png

YogiPavan_10-1775621961550.png

Add Implementation Class

YogiPavan_11-1775621985775.png

Choose Implementation Class, add Custom Class name and its description

YogiPavan_12-1775621985779.png

Implementation Class is created.

YogiPavan_13-1775621985783.png

 

ZCL_CHECK_PO▸
CLASS zcl_check_po DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .

PUBLIC SECTION.

INTERFACES if_badi_interface
INTERFACES if_ex_mmpur_final_check_po .

PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.

CLASS zcl_check_po IMPLEMENTATION.

METHOD if_ex_mmpur_final_check_po~check.
ENDMETHOD.
ENDCLASS.

 

Implementation Class is added to Badi Implementation details

YogiPavan_14-1775621985788.png

Logic can be added to implementation class

YogiPavan_15-1775621985793.png

 

ZCL_CHECK_PO▸
CLASS zcl_check_po DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .

PUBLIC SECTION.

INTERFACES if_badi_interface
INTERFACES if_ex_mmpur_final_check_po .

PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.

CLASS zcl_check_po IMPLEMENTATION.

METHOD if_ex_mmpur_final_check_po~check.
IF purchaseorder-supplier EQ ‘0000100005’.
APPEND VALUE #( messagetype = ‘E’ messagevariable1= |Choose another Supplier] ) TO messages.
ENDIF.
ENDMETHOD.
ENDCLASS.

 

Navigate to Create Purchase Order (ME21N)

YogiPavan_16-1775621985797.png

Provide the required details and check

Error appeared as per logic written.

YogiPavan_17-1775621985805.png

Add breakpoint in the implementation class to debug.

Place cursor on the logic, choose right click.

YogiPavan_18-1775621985808.png

Break point is added

YogiPavan_19-1775621985813.png

Break point can be added in the logic, and it triggers when creating purchase order in the Create Purchase Order (ME21N).

Conclusion

In Developer Extensibility, BAdi Enhancement Implementation can be created and deleted.

Custom Implementation can be captured in TR’s and those can be moved to test, production systems.

This custom implementation can also be debugged.

References

“}]] 

  Read More Technology Blog Posts by Members articles 

#abap

By ali