SAP MDG · ABAP FOUNDATIONS
Why does MODIFY return sy-subrc 0 but the row is not found in SE16 for the business partner or vendor number?
MODIFY returns sy-subrc 0 but SE16 shows no row (missing ALPHA conversion)
No dump. MODIFY (or a similar write) returns SY-SUBRC = 0 and the work area looks filled, but a Data Dictionary browser (for example SE16) shows no row for the business partner or vendor number you search with.
Error
No dump. MODIFY (or a similar write) returns SY-SUBRC = 0 and the work area looks filled, but a Data Dictionary browser (for example SE16) shows no row for the business partner or vendor number you search with.
Symptoms
- The write appears successful in the debugger.
- A later
SELECT, or a lookup by business partner or vendor number, finds nothing. - The key field is
CHAR10(or similar) and has an ALPHA conversion routine in the domain.
What is the issue
Fields such as partner or vendor number use conversion exit ALPHA: the database stores the value with leading zeros (for example a 10-character key), while the unconverted value has no leading zeros. If MODIFY is called with the unconverted key, SY-SUBRC is still 0 because a row is written — but under a different key than the one you search for in SE16 or in a SELECT that uses the converted number. Related keys then also fail to match. This is easy to miss after an MDC activation update of a custom table, because the process itself reports success.
Where to debug
- Set a breakpoint immediately before
MODIFYorSELECTin the update function module or model method. - Compare the key in the work area (length, leading zeros, hexadecimal if needed) with a row that already exists in the table and with the value you enter in SE16.
- In SE16, search both forms of the key: with leading zeros and without. If the row appears only for one form, the write used that form.
How to solve
Apply CONVERSION_EXIT_ALPHA_INPUT to the key field before every MODIFY, INSERT, UPDATE, and SELECT:
1DATA(lv_partner) = ls_cust-partner. " or vendor number
2
3CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
4 EXPORTING
5 input = lv_partner
6 IMPORTING
7 output = lv_partner.
8
9ls_cust-partner = lv_partner.
10MODIFY zz_cust_table FROM ls_cust.Use the same converted key when you search in SE16 or in test SELECT statements.
Alternate option
If the field uses a different conversion exit, call that field's INPUT conversion instead of ALPHA. Do not pad with zeros by hand unless the domain has no conversion exit and a fixed length is required.
The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- Why is a custom table row written under a different key than the one I search for?
- When should I call CONVERSION_EXIT_ALPHA_INPUT before MODIFY or SELECT?
- SE16 finds no row after a successful MODIFY of a partner or vendor key — what should I check?
Possible questions
- Why is a custom table row written under a different key than the one I search for?
- When should I call CONVERSION_EXIT_ALPHA_INPUT before MODIFY or SELECT?
- SE16 finds no row after a successful MODIFY of a partner or vendor key — what should I check?
- What configuration is required for MODIFY returns sy-subrc 0 but SE16 shows no row (missing ALPHA conversion)?
- How can this SAP MDG scenario be tested?