Sub topic 1
Extensibility options in SAP S/4HANA
SAP S/4HANA offers three ways to add your own fields, logic and apps to the standard system. This chapter explains each one and gives you criteria for choosing between them. Later chapters cover key user extensibility in detail.
Prerequisites
This chapter assumes you have the following:
- Basic navigation of SAP Fiori launchpad.
- Familiarity with SAP S/4HANA business objects such as sales orders, business partners and products.
- A basic understanding of data types such as text, number, date and amount.
- Reading knowledge of SQL or ABAP. This helps in the custom logic chapters, but you don't need it here.
The three extensibility options
SAP groups extensions by who builds them and where they run.
- Key user extensibility (in-app). Business experts add custom fields, simple logic, custom CDS views and custom business objects with Fiori apps. They don't need a developer license or a development environment. Everything runs inside the S/4HANA system.
- Developer extensibility (on-stack). Developers write ABAP code in ABAP Development Tools (ADT) in Eclipse. They can build larger extensions inside the same system. These extensions are still limited to released objects when you follow clean core rules.
- Side-by-side extensibility. Developers build applications on SAP Business Technology Platform (BTP). These applications run outside S/4HANA and talk to it through released APIs and events.
Comparing the options
| Aspect | Key user | Developer (on-stack) | Side-by-side |
|---|---|---|---|
| Typical person | Business expert or administrator | ABAP developer | Cloud developer |
| Tool | Fiori apps such as Custom Fields and Logic | ABAP Development Tools | SAP BTP services |
| Runs in | S/4HANA | S/4HANA | SAP BTP |
| Typical use | Add a field, validate an entry, derive a value | Complex logic, custom applications on S/4HANA data | Separate apps, integrations, extra scale |
| Data access | Released objects only | Released objects only (clean core) | Released APIs and events |
What key users can do
Key user extensibility covers a small, well-defined set of tasks:
- Add custom fields to business objects and expose them in UIs, reports, forms and APIs.
- Write custom logic in BAdI implementations, using only released ABAP objects.
- Create custom CDS views for reporting and custom business objects for new data.
- Transport these extensions to other systems.
The restriction to released objects is important. Custom logic may read data only through released objects such as the CDS view I_Product:
" Read data through a released CDS view, as allowed in key user custom logic.
DATA lv_product TYPE matnr VALUE 'TG11'.
DATA lv_product_type TYPE I_Product-ProductType.
SELECT SINGLE ProductType
FROM I_Product
WHERE Product = @lv_product
INTO @lv_product_type.
IF sy-subrc <> 0.
" No product found: handle the case here, for example by raising a message.
ENDIF.The @ in front of lv_product and lv_product_type escapes the host variables, as ABAP SQL requires. If you select from an unreleased table such as MARA, the key user editor reports an error.
Custom fields created by key users carry the YY1_ prefix, so you can tell them apart from standard fields in field lists, reports and API responses.
Custom field ID pattern: YY1_<FieldName>_<suffix>
Example: YY1_CostCenterNote_PRD
The YY1_ prefix marks key user extensions. The suffix is generated by the system from the business context.Choosing an option
Start with the lightest option and move to a heavier one only when you must.
- If you need a field or a small rule on an existing business object, use key user extensibility.
- If you need complex logic, many classes, or your own application on S/4HANA data, use developer extensibility.
- If you need a separate lifecycle, external users, or services S/4HANA doesn't provide, use side-by-side extensibility on SAP BTP.
Common mistakes
- Choosing developer extensibility for a task a custom field would solve. This adds maintenance work.
- Reading unreleased tables in custom logic. The editor blocks this, and it would also break upgrade stability.
- Forgetting that custom fields appear in other places only after you publish them. The next chapters cover this.
Exercise
A sales team wants an extra text field on sales orders and a check that rejects orders when the field is empty. Which extensibility option fits best, and why?
Show answer
Key user extensibility. A custom field and a simple BAdI validation are within the key user scope, run inside S/4HANA, and need only released objects. Developer or side-by-side extensibility would add effort without a benefit.
Exercise
What does the YY1_ prefix on a field name tell you?
Show answer
The field was created by a key user as a custom field, so it is an extension and not a standard field.