editObjectSource
Edit ABAP object source by providing only the snippet to change; the server handles lock, read-modify-write, syntax check, and optional activation.
Instructions
Edits a (possibly LARGE) ABAP object by sending ONLY the snippet to change — the server does the whole read-modify-write: lock → get source → apply edits → syntax check → set source → (optional) activate → unlock. Nothing is written if an edit does not match uniquely or if the syntax check finds errors. Provide edits as string replacements ({oldString,newString[,replaceAll]}) and/or line replacements ({startLine,endLine,newText}).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edits | No | List of edits. Each is either {oldString,newString[,replaceAll]} or {startLine,endLine,newText}. Line numbers refer to the CURRENT source; line edits are applied bottom-up. | |
| activate | No | Activate the object after a successful write (default false). | |
| newString | No | Replacement for oldString. | |
| objectUrl | No | ADT object URL for lock/activate. If omitted, derived from objectSourceUrl by stripping the trailing /source/… segment. | |
| oldString | No | Convenience for a single string edit (use with newString). | |
| transport | No | Transport request to record the change (if the object is transportable). | |
| connection | No | Optional: SAP connection name to use for THIS call only (overrides the active connection; see listConnections). Immune to server restarts and concurrent switches. | |
| objectName | No | Object name for activation (derived from objectUrl if omitted). | |
| mainProgram | No | Main program source URL, when editing an include (used by the syntax check). | |
| syntaxCheck | No | Run a syntax check before writing and abort on errors (default true). | |
| objectSourceUrl | Yes | ADT source URL (same used in getObjectSource). |