Update existing ABAP objects with new source code. Use when modifying, updating, fixing, or refactoring existing ABAP objects. SECURITY: Only modifies objects in $TMP package. Keywords: modify, update, change, fix, refactor, edit code, update program, change class, fix errors
Update existing ABAP objects with new source code using the MCP ChangeAIObject tool.
Use this skill when you need to:
This tool ONLY modifies objects in $TMP package.
Why this restriction:
Same as create-ai-object:
program, class, interface, includefunction_group, function, function_group_includedata_element, table, structurecds_view, dcl, behaviour_definitionservice_definition, metadata_extensionobject_name: Name of existing object (must exist in $TMP)source_code: Updated ABAP source (string or multi-section object)description: Updated description (max 30 characters)object_type: Type from enum (defaults to program)additional_params: Object-specific parameterssource_code: "Updated program code..."
source_code: {
main: "Updated class definition...",
definitions: "Updated type definitions...",
implementations: "Updated local handler classes...",
testclasses: "Updated test classes...",
macros: "Updated macros..."
}
The tool automatically:
Pre-change checks:
If validation fails:
Returns detailed activation status:
{
"success": true,
"object_name": "ZAI_MY_PROGRAM",
"changes_applied": true,
"activation": {
"success": false,
"errors": [
{
"line": 12,
"message": "Unknown variable 'lv_test'",
"severity": "error"
}
],
"warnings": []
}
}
Fix syntax errors:
Fix the syntax error on line 12 in program ZAI_SALES_REPORT
Refactor code:
Refactor class ZAI_CUSTOMER_HANDLER to use the builder pattern
Add functionality:
Add a new method 'validate_email' to class ZAI_VALIDATOR
Update CDS view:
Add association to I_Customer in CDS view ZAI_BOOKING
Apply ATC fixes:
Fix the performance warning in ZAI_DATA_PROCESSOR by removing SELECT in loop
Common workflow for fixing issues:
Get current code:
Show me the code for ZAI_MY_PROGRAM
Check quality:
Run ATC on ZAI_MY_PROGRAM
Fix issues:
Fix the errors in ZAI_MY_PROGRAM [AI generates fix]
Verify fix:
Run ATC again to verify fixes
Common errors and fixes:
| Error | Cause | Fix |
|---|---|---|
| Object not in $TMP | Wrong package | Can't modify - create new version in $TMP |
| Object locked | Another user editing | Wait or break lock (if permitted) |
| Syntax error after change | Bad code generation | Review error, regenerate fix |
| Object not found | Wrong name | Check name with search-object |
| Activation failed | Structural issues | Review activation log |
get-object-info before changingWhen Copilot uses this skill, expect:
Typical workflow:
get-object-info to view current codeget-atc-results to identify issueschange-ai-object to apply fixesget-atc-results again to verify fixesQuality improvement workflow:
get-atc-results → Find issuessap-help-search → Research best practiceschange-ai-object → Apply improvementsget-atc-results → Verify improvementsFor classes with local handler classes:
{
main: "CLASS zcl_travel_handler DEFINITION... ENDCLASS. CLASS zcl_travel_handler IMPLEMENTATION... ENDCLASS.",
implementations: "CLASS lhc_travel DEFINITION... ENDCLASS. CLASS lhc_travel IMPLEMENTATION... ENDCLASS."
}
Benefits:
Before: SELECT in loop
Fix: Single SELECT with FOR ALL ENTRIES
Tool: change-ai-object applies optimization
Before: Concatenated SQL
Fix: Parameters and escaping
Tool: change-ai-object applies security fix
Before: Non-released API
Fix: Released API alternative
Tool: change-ai-object migrates to new API
Built-in safeguards:
❌ Don't use this skill when:
get-object-info)create-ai-object)activate-object)After successful changes in $TMP:
Note: This step is manual - tool doesn't transport objects.