Skip to Content
Technical Articles

Key User Extensibility on SAP S/4HANA Cloud – Adding Custom Business Logic

Last reviewed for Updates: January 17 2019

Key User Extensibility on SAP S/4HANA Cloud – Adding Custom Business LogicPart 4

Target Audience – Key Users and Developers

To demonstrate Custom Logic let’s take the standard Fiori App to Create Customer Projects under Project Management. This is a simple demonstration; however, more complex logics can also be created provided such Enhancement Options are provided for a Business Context

Scenario – When we start creating a new customer project, the standard does not automatically generate a Project ID. To check this, go back to Blog 3 and you would notice, Project ID is manually provided

Click the tile to create a customer project and try to save without giving a Project ID

As a Key User, you can randomly choose an ID or implement a business Logic (Restricted ABAP on Cloud) to automatically generate an ID for you. Let’s see how we do this. We will again go back to the tile – Create Custom Fields and Logic

Once in, go to the tab Custom Logic

Note- The above screenshot is old and with the release of SAP S/4HANA Cloud 1802 the new look of Custom Fields and Logic App is as below –

What changed?

  • The term Enhancement Implementation has been renamed to Implementation Description
  • The term Enhancement Option has been renamed to Definition Description

Updated screenshot from SAP S/4HANA Cloud 1802

You may see already some implementations in the list. Click on the  icon to create a fresh Enhancement Implementation. Once you click that icon, following pop-up will appear

Business Context – means for which data set enhancement implementation will be applicable. When this enhancement implementation is implemented, it is integrated with the parent application at the specified and designated point

Enhancement Option – is just like any other enhancement implementation point where an app can be extended

Name – is any meaningful name given to the enhancement implementation that will appear in the list above

Next choose the Business Context, and already available Enhancement Option. Give a meaningful name and hit Create

Please note that the Identifier name here is generated automatically by the system, however, you can still change it

Once you hit create, system takes you to ABAP Web Editor where you can write the enhancement code. As you see in the below screen shot, the system gives you a draft code pre-generated code which you can publish or make any other changes to it. Once you do the changes, you can Test it online and then Publish it

Let’s see how we do it. If you click on the Example, you will see a split screen editor with the example code, which is same as Draft version. Since we do not want to add any additional code, we will just test it and publish the same

If you notice, to a Key User this example code is already Published. Which means that it is already active, however, BADI implementation is not active. So, once you click on the Publish button, enhancement will be activated and automatic number generation for the project ID will start.

See the below screen shot (side by side comparison) of the same BADI in the backend and how it looks in the ABAP Web Editor

The ABAP Web Editor also has Test feature which you can use to test if the logic is working fine

The same is located at the bottom if the editor

Once you click on Test you would see some value being returned in the parameter ‘engagementProject’. This shows that the logic is working fine and can be Published

The ABAP Web Editor also has a syntax check feature and will highlight it with red mark. Some examples see below –

It is also important to note that, the capability of the ABAP Web Editor is restricted ABAP and no d/base update, delete statements etc. is allowed

For more details about Restricted ABAP, see below link – 

S/4HANA Extensibility Concept Details: Restricted ABAP

Image Source: SAP TechEd

Now let’s go ahead and Save Draft and then click on the Publish button to activate the enhancement

Now click on Publish

Click Ok

Now let’s go back and try to create a new customer project. You will notice that Project ID is now automatically generated


Visit SAP teched Online for more interesting videos:

Some more helpful links

Congratulations you have just finished Key User Extensibility – Adding Custom Business Logic to the standard S/4HANA Cloud UI app using Keu User tools!

Rohit Khan, S/4HANA Regional Implementation Group

For any clarification or support, feel free to reach

Thank you for reading through these blogs!


Link to previous parts of the blog series:

Part 1: Introduction to S/4HANA Cloud Key-User Extensibility

Part 2: Key User Extensibility on SAP S/4HANA Cloud – UI Adaptions for Key User

Part 3: Key User Extensibility on SAP S/4HANA Cloud – Adding Custom Fields

You must be Logged on to comment or reply to a post.
  • Dear Rohit, We are migrating Time entry and Expenses into SAP S4 Cloud from our existing Non-SAP Time entry tool, We have to bring 6 months of time entry information into SAP S4 Cloud and I did not find the app in Manage your solution to upload entries. Can you help me in finding a correct app or process to succeed it?

    By the way, its a nice blog and appreciate for sharing information, it's really worth.

  • Hi Suman,

    Thank you for reading through the blog. Can you please mail me and I will get back to you.

    Best Regards



    • Dear Rohit,

      Morning! Thanks for the reply..I sent with more details to your company email and I really appreciate your help.


  • Hi Rohit,

    We have a requirement to add a new tab in Manage Product Master fiori app and in this tab it should show data from a Z table.

    By using UI Adaption we can do 'add new section' to  add a new tab to the existing tabs.

    Currently by using UI Adaption we are able to see a list of section on click of Add section icon in Manage Product Master standard Fiori app.

    But could you please suggest how can I add more user defined entries to the existing sections shows in the add section option.

    And how can we show  data of a  Z table in the newly created tab.

    Kindly suggest.







  • Hallo,

    do you know any possibility how to identify the system within the custom logic. So whether it is the quality or the productive?

    We need to implement a different logic for the systems.