Sub topic 6
In-app extensibility for key users
Prerequisites and scope
This chapter assumes you know the basic SAP S/4HANA business processes, you understand what a released API is, and you have read the earlier chapters on the clean core principle and the three extension options. You do not need to write ABAP. In-app extensibility is the option meant for people who configure the system instead of programming it.
In-app extensibility lets a key user add fields, logic, and UI changes to an SAP S/4HANA system from inside that system. A key user is a business expert, such as a finance analyst or a procurement lead, who has been given the authorization to adapt the system with browser-based tools. The extensions run in the same system as the standard application, but SAP controls the technical contract, so upgrades do not break them.
Why this option exists
Many business requests are small. A sales team wants a "Delivery priority" field on the sales order. A buyer wants a dropdown with approved values. A finance team wants an extra check before a document is saved. Sending each of these to a developer, or building a side-by-side application for them, costs more than the change is worth.
In-app extensibility handles this class of request. The extension lives in the S/4HANA system, shares its database transaction and its user interface, and is transported and upgraded together with it. This is the main difference from a side-by-side extension, which runs in a separate SAP BTP application and talks to S/4HANA through APIs.
The main tools
In SAP S/4HANA Cloud, the tools are grouped in the Extensibility area of the Fiori launchpad. The names below are the ones used in current releases, but app names can change, so check the documentation for your release.
| Tool | What it does | Typical example |
|---|---|---|
| Custom Fields | Adds a field to a business object, a UI, forms, and email templates | A "Delivery priority" field on a sales order |
| Custom Logic | Runs a small ABAP Cloud snippet at a defined extension point | Reject a purchase requisition when a custom field is empty |
| Custom Business Objects | Creates a new data model with its own database table, UI, and API | A register of inspection results |
| Custom CDS Views | Builds a reporting view on released data | A list of open orders with a custom field |
| Adapt UI (UI adaptation) | Hides, moves, or renames fields on a Fiori page for a role or the whole company | Hide an unused field for the sales role |
| Custom Code Lists | Defines value lists for custom fields | Approved delivery priorities |
Custom Logic and Custom Business Objects need the most care. They are the point where "configuration" becomes "code," even though the editor is inside a browser.
How a custom field travels through the system
When a key user creates a custom field, the system does more than add a column. It generates the pieces that make the field usable on every layer of the application, and it does this inside the boundary SAP allows.
The diagram shows the flow for one custom field.
Two points matter here.
- The field is attached to a business context, which is a predefined area of the standard application, such as sales order header or purchase order item. You can only add fields where SAP has opened an extension point.
- After publishing, the field is also available on released APIs for that business object. A side-by-side application can then read and write the field without any change to the core.
A worked example
Suppose the sales team needs a delivery priority on sales orders, and the system must refuse the value "URGENT" when the customer is blocked. The steps are as follows.
- Open the Custom Fields app and create a field for the context for sales order header. Give it a label, choose a type such as "Code list," and select the code list of approved values.
- Publish the field. The system generates the required artifacts.
- Open the sales order page and use Adapt UI to place the field in a section of the form.
- Open the Custom Logic app and select the business add-in (BAdI) for validating a sales order. A BAdI is a defined hook where SAP lets you add behavior.
- Write the check in ABAP Cloud, then test and publish.
Here is a minimal sketch of the logic from step 5. The interface and field names are placeholders. The generated names in your system will differ, because the custom field name receives a prefix such as YY1_.
METHOD if_ex_validate_sales_order~validate.
" Placeholder names: use the interface and field names the
" Custom Logic app shows for your system.
IF salesorder-yy1_deliverypriority = 'URGENT'
AND salesorder-customerisblocked = abap_true.
APPEND VALUE #( severity = if_abap_behv_message=>severity-error
text = 'Urgent delivery is not allowed for blocked customers.' )
TO messages.
ENDIF.
ENDMETHOD.Treat this as a pattern and not as copy-and-paste code. The exact interface depends on the extension point you pick, and the Custom Logic editor suggests the correct signature when you create the implementation.
Why this stays clean
In-app extensions are usually classified at the best clean core levels because they only use what SAP has opened. Three mechanisms keep them safe.
- Released extension points only. The tools list the business contexts and hooks that SAP supports. You cannot attach a field to an arbitrary internal table.
- Released objects only. Custom Logic and Custom CDS Views are checked against the list of released APIs and views. An attempt to read an internal table fails at design time.
- Managed lifecycle. SAP upgrades the system and keeps the extension contracts stable. Custom fields and logic are carried through the upgrade by the platform.
This is the reason in-app extensibility needs no separate regression plan for each upgrade, apart from your normal business tests.
Limits and common errors
In-app extensibility is not a general programming platform. Know the limits before you promise a feature.
- No new applications with complex processes. A custom business object can hold data and offer a basic UI, but it is not a place for multi-step workflows, heavy calculation, or integration with other systems.
- No access to arbitrary data. If a table or view is not released, the editor will not let you use it. Do not look for a workaround. Request a release from SAP or choose another option.
- Performance is shared. Custom logic runs inside the same transaction as the standard process. A slow validation slows down every user who saves a sales order.
- Limited external calls. In-app logic is not the right place to call a third-party service. That is a job for a side-by-side extension.
- Publishing is a commitment. A published custom field cannot simply be deleted if data and other objects depend on it. Plan naming and types first. A wrong data type is expensive to fix later.
- Transport across systems. In SAP S/4HANA Cloud, extensions move through the landscape using the software packaging and transport tools the system provides. Test in a quality system first and avoid creating fields directly in production.
A common mistake is to build a field in the system and then forget to enable it for the APIs or for analytical use. If a side-by-side application cannot see a custom field, check the field's usage settings, and check whether the field was published.
How in-app extensibility relates to the other options
The choice between the three options often comes down to where the data and the logic belong.
- Use in-app extensibility when the change is tightly tied to one business object, needs the standard UI, and must take part in the same transaction.
- Use developer extensibility when you need more code, your own classes, or reuse of the same logic by many apps, and you have ABAP developers.
- Use a side-by-side extension when you need a different user experience, a different lifecycle, other systems, or scalable processing outside the core.
In-app and side-by-side extensions are often combined. A key user adds a field in the core, and a CAP application on SAP BTP consumes it through the released API. The following chapters build that kind of scenario.
Practical guidance
- Start with the standard configuration. Many requests are already covered by settings.
- Name fields for their business meaning. The label can change later, but the technical name stays.
- Keep custom logic short. If it grows beyond a screen or two, move it to developer extensibility or a side-by-side application.
- Document who owns each extension. The governance chapter returns to this point.
- Test with realistic data and a second user role, because UI changes made for one role may not be visible to another.
Exercise
A sales manager asks for a new "Region group" field on the sales order and a rule that blocks saving when the field is empty. A second request asks for a nightly job that reads all sales orders and sends them to a third-party forecasting service. Which extension option fits each request, and why?
Show answer
The field and the rule fit in-app extensibility. A custom field (Custom Fields) and a validation in Custom Logic are tied to one business object, use the standard UI, and run in the same transaction, using only released extension points. The nightly job that calls a third-party service fits a side-by-side extension on SAP BTP. It needs scheduled processing, an external connection, and a lifecycle independent of the core. In-app logic is the wrong place for external calls. The side-by-side application can read the sales orders, including the custom field, through the released OData API.
Exercise
A key user creates a custom field and places it on the Fiori page, but a CAP application cannot see it in the Sales Order API. Name two things to check.
Show answer
First, check that the field was published, because only published fields are generated into the system. Second, check the field's usage settings to confirm that it is enabled for the released API. After that, refresh or re-import the API metadata in the CAP project, since the imported EDMX file is a snapshot and does not contain the new field until you update it.