Read ABAP Source
sap_get_sourceRead ABAP source code for programs, includes, classes, interfaces, or function modules, with line count and etag for version-safe updates.
Instructions
Read the ABAP source code of a program, include, class, interface, or function module.
Args:
object_type ('program'|'include'|'class'|'interface'|'function').
object_name (string): e.g. 'ZFI_POST', 'CL_FOO'.
function_group (string): required only for object_type='function'.
response_format ('markdown' | 'json').
Returns (json): { objectType, objectName, sourceUri, etag?, source, lineCount }. 'etag' identifies the version and enables concurrency-safe writes.
Examples:
"Show me class CL_FOO" -> object_type='class', object_name='CL_FOO'.
"Read function module Z_CALC in group ZFG1" -> object_type='function', object_name='Z_CALC', function_group='ZFG1'. Error Handling:
404 -> wrong name/type, or missing function_group for a function module.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| object_name | Yes | Object name (e.g. 'ZFI_POST', 'CL_FOO', 'Z_MY_FM'). | |
| object_type | Yes | Kind of object: 'program', 'include', 'class', 'interface', or 'function'. | |
| function_group | No | Required only when object_type='function': the enclosing function group. | |
| response_format | No | Output format: 'markdown' (human-readable, default) or 'json' (structured). | markdown |