Write Text Elements
sap_set_text_elementsWrite or merge ABAP text elements (symbols, selections, headings) into a program, class, or function group by ID, preserving omitted entries and verifying each saved value.
Instructions
Write a program's / class's / function group's text elements: text symbols (TEXT-nnn), selection texts (parameter/select-option labels), or list headings. Entries are MERGED over the existing ones by id — ids you omit are preserved.
Args:
object_type, object_name, kind (one kind per call).
entries: [{ id, text, max_length? }].
transport (string): required for transportable packages.
activate (boolean): activate the owning object afterwards (default false).
response_format.
Returns (json): { objectType, objectName, kind, written, merged, transport?, activated, verified, notPersisted, message }. Every write is read back and compared: verified=true means the values are actually stored. notPersisted lists ids the server accepted but did not store.
Examples:
"Set text symbol 001" -> kind='symbols', entries=[{id:'001', text:'Processing complete', max_length:30}].
"Title the list output" -> kind='headings', entries=[{id:'listHeader', text:'Posting log'}]. Validation (checked before any call to SAP):
Symbol ids are exactly 3 characters; selection texts are at most 30 characters; heading ids must be listHeader (<= 71 chars) or columnHeader_1..4 (<= 255 chars). Notes:
The underlying PUT replaces the whole pool section for that kind, so this tool reads the current entries and merges yours over them. Editing one symbol therefore does not delete the others.
KNOWN LIMITATION on this release: kind='selections' is accepted with HTTP 200 but the values are NOT stored — the read-back still shows '?...'. The tool reports this honestly (verified=false, notPersisted listing the ids) instead of claiming success. Maintain selection texts in SE38 (Goto > Text elements > Selection texts) until this is resolved. 'symbols' and 'headings' write correctly.
Texts are stored in the object's ORIGINAL (master) language. On an object whose master language is not English, entries land in that language's pool.
Activation is not required for the texts to become visible; 'activate' is offered for the owning object's sake.
Read the result back with sap_get_text_elements.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | Which pool section to write: 'symbols', 'selections' or 'headings'. One kind per call. | |
| entries | Yes | Entries to write. Merged over the existing ones by id. | |
| activate | No | Activate the owning object afterwards. | |
| transport | No | Transport request (e.g. DEVK900123). Required for objects in transportable packages; ignored for local ($TMP) objects. | |
| object_name | Yes | Object name (e.g. 'ZFI_POST'). | |
| object_type | Yes | 'program', 'class', or 'function_group' (pass the function GROUP name, not a module). | |
| response_format | No | Output format: 'markdown' (human-readable, default) or 'json' (structured). | markdown |