patch_enho
Replace a uniquely matching code segment in an existing SAP hook Enhancement Implementation, then update and optionally activate without resending the full source; production writes are refused.
Instructions
Modify PART of an existing hook Enhancement Implementation (ENHO/XHH) without resending the whole source. Reads the current source, replaces oldString with newString (must match EXACTLY ONCE), then locks, PUTs, unlocks, and optionally activates. Refuses to run on production profiles. Use this to add/change a single ENHANCEMENT block or a few lines inside one. For BAdI implementations use patch_class on the implementing class.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"enhoName": "<enhoName>",
"oldString": "<oldString>",
"newString": "<newString>"
},
"name": "patch_enho"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| activate | No | Activate after writing. Default false. | |
| enhoName | Yes | Enhancement implementation name, e.g. ZEH_MY_HOOK | |
| newString | Yes | Replacement text | |
| oldString | Yes | Exact existing text to replace. Must occur exactly once - include enough context to be unique. | |
| transport | No | Transport request. Omit only for local/$TMP objects. |