GetProgram
Retrieve ABAP program source code from SAP systems by specifying the program name. This tool enables developers to access and review development artifacts within ABAP environments.
Instructions
Retrieve ABAP program source code
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| program_name | Yes | Name of the ABAP program |
Implementation Reference
- src/handlers/handleGetProgram.ts:4-18 (handler)The main handler function that retrieves the source code of an ABAP program by constructing an ADT API URL and making a GET request to the SAP backend.export async function handleGetProgram(args: any) { try { if (!args?.program_name) { throw new McpError(ErrorCode.InvalidParams, 'Program name is required'); } const encodedProgramName = encodeURIComponent(args.program_name); const url = `${await getBaseUrl()}/sap/bc/adt/programs/programs/${encodedProgramName}/source/main`; const response = await makeAdtRequest(url, 'GET', 30000); return return_response(response); } catch (error) { return return_error(error); } }
- src/index.ts:105-117 (schema)Input schema definition for the GetProgram tool, specifying the required 'program_name' parameter.name: 'GetProgram', description: 'Retrieve ABAP program source code', inputSchema: { type: 'object', properties: { program_name: { type: 'string', description: 'Name of the ABAP program' } }, required: ['program_name'] } },
- src/index.ts:307-308 (registration)Registration of the GetProgram handler in the tool dispatch switch statement within the CallToolRequest handler.case 'GetProgram': return await handleGetProgram(request.params.arguments);