Sub topic 2
Choosing a Business Context for Custom Fields
This chapter assumes that you can navigate the SAP Fiori launchpad and understand basic business objects such as products, sales orders, and business partners.
Choosing the right business context
A business context is the standard object or process to which a custom field belongs. It determines where the field can be added and which applications can use it. For example, choose a product context for a product attribute, not a sales-order context.
Choose a context by asking:
- Which business object owns the value?
- At which level does the value apply: header, item, or partner?
- Which applications must display or process it?
- Does the context support the required field type and publication options?
| Requirement | Suitable choice |
|---|---|
| A note about one product | Product context |
| A delivery instruction for one sales order | Sales-order header context |
| A reference for one sales-order line | Sales-order item context |
Creating a custom field step by step
- Open the Custom Fields app.
- Choose Create and select the business context.
- Enter a label, help text, and field type, such as text, number, date, or amount.
- Check the generated technical field name. Key-user fields commonly start with
YY1_. - Select the intended uses, such as a user interface, form, report, or service.
- Save the draft and validate the field.
- Publish the field.
The context cannot usually be changed after creation. If the wrong context was selected, create a new field in the correct context and retire the unused draft according to your system process.
Publishing and using the field
Publishing activates the field for the selected extensibility targets. The field may then appear in supported UIs, analytical reports, forms, or APIs. Availability depends on the application and the selected business context. Publishing does not automatically add the field to every screen or service.
After publishing:
- Open the target UI and use its adaptation or personalization features.
- Add the field to the relevant report or form template.
- Check the relevant API documentation before expecting the field in an API response.
- Test both display and save behavior with representative business data.
Exercise
A field describes a specific sales-order item, but it was created in a sales-order header context. What should you do?
Show answer
Create the field again in the supported sales-order item context, then publish and test it in the item-level applications.