Sub topic 11
Transporting and Maintaining Extensions
This chapter assumes you can create and publish a custom field in the Custom Fields and Logic app and that you know what a BAdI implementation is. It covers how extensions move from a development system to a production system, and how you keep them healthy afterwards.
Why extensions need a lifecycle
A custom field or logic implementation that exists only in your development system helps nobody. Key user extensions follow the same path as other changes: you build and test them in a development or test system, then move them to quality and production systems. Doing this by hand in each system leads to differences between systems, so SAP provides a transport mechanism.
The mechanism depends on the system type. In SAP S/4HANA Cloud Public Edition, extensions move between tenants with the software logistics tools of the cloud system. In on-premise and private cloud systems, the Custom Fields and Logic app writes changes to a transport request. This chapter uses the on-premise and private cloud model. Check your system's documentation for the exact tool names, because they differ between editions.
The extension lifecycle
A custom field passes through clear states. Only the last state is safe to move.
Transporting a custom field
Follow these steps for a custom field:
- Create the field and publish it. Publishing generates the field in all the objects that use its business context, such as the database table, the CDS view and the OData service.
- Confirm that the field works in the UI or report where you plan to use it.
- When you save or publish, assign the change to a transport request. If the app asks for a request, choose one that is open and meant for key user changes.
- Release the request in the transport tool, then import it into the target system in the usual order of your landscape.
The import in the target system activates the field there. You do not need to publish it again by hand, but you should check the field after the import.
Transporting custom logic
A BAdI implementation moves in the same way. Save the implementation, assign it to a transport request, and release it.
Custom logic often depends on custom fields. For example, a BAdI that reads YY1_CostCenterNote_PRD needs that field in the target system before the logic can be activated. Transport the field first, or put both in the same request. If the logic arrives first, the import fails or the logic stays inactive, because it refers to an element that does not exist yet.
Maintaining extensions
After the first transport, you will need to change extensions. These rules keep the change safe.
- You can add, but you cannot freely change. Once a field is published and in use, you cannot change its data type. You can usually change labels and some settings, such as the field label shown in the UI. Plan the type carefully before the first transport.
- Deleting a field is risky. Data may already be stored in it, and reports, forms or logic may refer to it. Check where it is used before you remove it. Use the Custom Fields and Logic app's usage information where it is available.
- Retest after upgrades. Key user extensions are designed to be upgrade-stable because they use released objects. If SAP deprecates a released object that your logic uses, the logic may need adjusting. Run your tests after each upgrade.
- Keep naming consistent. The
YY1_prefix marks key user extensions. A short, meaningful field name helps colleagues recognize the purpose of the field months later.
Common problems
| Symptom | Likely cause | What to do |
|---|---|---|
| Field missing in the target system after import | Request not released, or imported in the wrong order | Check the import log and the order of requests |
| Logic does not activate after import | The logic uses a field or object that does not exist in the target | Transport the missing field first |
| Field exists but does not appear in the UI | The UI adaptation was not transported or not set up there | Check the field's usage in the target system |
| Cannot change field type | The field is already published | Create a new field and migrate the data |
Many "missing" issues come from an incomplete transport request. Before you release it, open the request and verify that it contains every field and every implementation you expect.
Summary
Build and test in development. Publish the field before you transport it. Keep fields and dependent logic together, or import fields first. Treat published fields as hard to change, and retest your logic after every upgrade.
Exercise
You created the custom field YY1CostCenterNotePRD and a BAdI implementation that reads it. You transported the BAdI request to the quality system on Monday and the field request on Tuesday. The logic did not activate on Monday. Why, and how do you avoid this next time?
Show answer
On Monday the quality system did not have the field yet, so the logic referred to an element that did not exist. Put the field and the logic in the same transport request, or import the field request first.