Custom Logic using Key User Extensibility in SAP S/4 HANA Public Cloud
Share

[[{“value”:”

Introduction

In On Stack extensibility, Enhancements can be created using Custom Logic App in Key User Extensibility.

Key user extensibility also know as In App extensibility, extensions can be added with key user tools.

 

Key User Extensibility / In App Extensibility- Custom Logic

Custom Logic is one of the Key User Extensibility Tools                        

In the Custom logic App, 

  • Custom logic can be added
  • Easy exploration of extension points, key user documentation
  • Syntax check, syntax highlighting, code completion
  • Draft, published, testing included
  • ABAP Language Version for Key Users
  • Enhancements can be created using Custom Logi App

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.

Navigate to Business Accelerator Hub to find BAdis

On Stack Extensibility -> Business Add-ins

Search for required BAdi.

YogiPavan_24-1775621192788.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_25-1775621208889.png

Methods and its Parameters

 

YogiPavan_28-1775621240583.png

Steps to Create Custom Logic

Navigate to Custom logic App

Custom Logic App

YogiPavan_2-1775749659041.png

Choose Create button to create Custom Logic.

YogiPavan_1-1775748977978.png

Choose Required Business Content

YogiPavan_2-1775748992046.png

 

YogiPavan_3-1775749002643.png

List of available BAdi Definitions for the business context.

YogiPavan_4-1775749020679.png

Choose required BAdi Definition.

YogiPavan_5-1775749030590.png

Its Documentation.

YogiPavan_6-1775749041471.png

Choose Step 2 to add Implementation Description and ID.

YogiPavan_7-1775749052755.png

Implementation ID automatically appears based on Description and it can also be changed.

Choose Review

YogiPavan_8-1775749060997.png

Choose Create

YogiPavan_9-1775749070093.png

Click on Publish button.

YogiPavan_10-1775749078079.png

Its published.

YogiPavan_11-1775749088551.png

Click on Open Code Editor to write the logic.

Importing Parameters.

YogiPavan_12-1775749104915.png

Changing Parameters.

YogiPavan_13-1775749113594.png

Sampe Code -> Show Sample Code

YogiPavan_14-1775749122690.png

Keyboard Shortcuts -> three dot menu -> Show Keyboard Shortcuts

YogiPavan_15-1775749132204.png

YogiPavan_16-1775749141546.png

Write the required logic.

YogiPavan_17-1775749159909.png

IF purchaseorder-supplier EQ ‘0000100005’.
APPEND VALUE #( messagetype = ‘E’ messagevariable1 = |Choose another Supplier| ) TO messages.
ENDIF.

 Navigate to Create Purchase order (ME21N)

YogiPavan_18-1775749171379.png

Provide the required details and check.

YogiPavan_19-1775749180090.png

Error is appeared as per logic written.

YogiPavan_20-1775749187992.png

This implementation class can be opened in the eclipse, and break point can be added in the logic, and it triggers when creating purchase order in the Create Purchase Order (ME21N).

Key-user objects can be displayed and debugged but cannot be edited with ABAP development tools.

 

Conclusion                     

In Key User Extensibility,

Custom logic can be added and Enhancements can be created using Custom Logic App.

Own implementation can be created and those can be deleted.

Implementation can be published to test, production systems

Code can be compared with older code versions.

 

References

 

“}]] 

  Read More Technology Blog Posts by Members articles 

#abap

By ali

Leave a Reply