Sub topic 12
Troubleshooting and Known Limitations
This chapter assumes you can create and publish a custom field in the Custom Fields and Logic app. It also assumes you have read the chapters on released objects, BAdI implementations and transports. It covers the problems you are most likely to meet and the limits you should plan around.
A working model for troubleshooting
Most problems fall into one of four groups:
- The user cannot do the task (authorization).
- The field exists but does not appear (publication or usage).
- The custom logic does not compile or does not run (released objects, activation).
- The extension works in one system but not in the next (transport).
Work through the groups in this order. Each one rules out a cheaper cause before you look at a more expensive one.
Authorization problems
If the Custom Fields and Logic app is missing from the launchpad, the user lacks the business catalog or role for key user extensibility. Assign the role and refresh the launchpad. If the app opens but a user cannot publish, check the authorization for the extensibility business contexts and the transport request. A missing transport authorization often shows up only when you save.
The field is created but not visible
A new field is not usable until you publish it. Publishing is also what generates the technical objects for the field. Check these points in order:
- The status of the field in the app. A field that is saved but not published has no effect.
- The usage settings. A field can be available in UIs, reports, forms or APIs. Each one is a separate switch.
- The business context. A field created for a sales order header does not appear on the item.
- The UI itself. A custom field must be added to the screen through adaptation mode, because publishing does not place it on a page.
Custom logic errors
Custom logic is checked against the list of released objects. If a syntax check reports that an object is not allowed, you used something outside that list. Replace it with a released object, such as a released CDS view.
The following snippet reads a product type through a released view. It handles the case where no row is found.
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.Common causes of errors in logic:
- Reading a database table directly instead of a released CDS view.
- Using a field name without the
YY1_prefix. - Leaving the implementation inactive. An implementation that is saved but not activated never runs.
- Forgetting the
@escape on host variables in ABAP SQL.
Transport problems
An extension works in development but not in quality or production. Usually one of these is the cause:
- The field was published but its transport request was not released or imported.
- The logic was imported before the field it depends on. Import the field first.
- The target system has a different release, so a released object is missing or has a different state.
Known limitations
Key user extensibility is deliberately narrow. Plan for these limits.
| Limit | Consequence | Alternative |
|---|---|---|
| Only released objects are allowed in logic | You cannot read arbitrary tables | Create a custom CDS view on released objects |
| Only offered business contexts are available | Some objects cannot be extended | Use developer or side-by-side extensibility |
| Limited data types | Complex structures are not possible | Use a custom business object |
| Logic runs only at BAdI extension points | You cannot change any step you like | Check for another released extension point |
Exercise
A key user published the field YY1CostCenterNotePRD in development. In the quality system, the field is missing. The user can see the field in development. Name two checks, in order, that you would do first.
Show answer
First, check whether the transport request that holds the field was released and imported into quality. Second, check the import log for errors, and confirm that dependent logic was imported after the field. If the field is present but not visible on a screen, also check the usage settings and the UI adaptation in quality.
Exercise
Your custom logic fails the syntax check with a message that a database table is not allowed. What do you change?
Show answer
Replace the direct table access with a released CDS view, such as I_Product, and read it with ABAP SQL. If no released view has the data you need, create a custom CDS view on top of released objects.