-
Notifications
You must be signed in to change notification settings - Fork 45
Description
Summary
SyntaxCheck and UpdateClassInclude fail for classes with long namespaced names because VSP appends unnecessary URL suffixes (/source/main, /includes/ccimp) that push the total URI length over SAP's limit.
Related issue: #18 (WriteSource URL encoding fix)
Steps to Reproduce
- Create or use a class with a long namespaced name, e.g.,
/USE/CL_PCF2_VECN_DL_CTRL(26 chars) - Attempt
SyntaxCheckon the class - Result: 500 error with URI truncation
URI-Mapping cannot be performed due to invalid URI:
/sap/bc/adt/oo/classes/%2fuse%2fcl_pcf2_vecn_dl_ct
^^^^ missing "RL"
Root Cause Analysis
The Problem
VSP constructs the URL for /checkruns with the full source path:
/sap/bc/adt/oo/classes/%2FUSE%2FCL_PCF2_VECN_DL_CTRL/source/main
SAP's URI mapper has a character limit and truncates this URL, causing the request to fail.
Test Results
| URL Format | Length | Result |
|---|---|---|
/sap/bc/adt/oo/classes/%2FUSE%2FCL_PCF2_VECN_DL_CTRL |
52 chars | ✅ Works |
/sap/bc/adt/oo/classes/%2FUSE%2FCL_PCF2_VECN_DL_CTRL/source/main |
64 chars | ❌ Truncated |
/sap/bc/adt/oo/classes/%2FUSE%2FCL_PFCF_TEST |
45 chars | ✅ Works |
/sap/bc/adt/oo/classes/%2FUSE%2FCL_PFCF_TEST/source/main |
57 chars | ❌ Truncated |
Key finding: The /source/main suffix is unnecessary for syntax checks. The base class URL works correctly.
Verified via Direct MCP Call
# This FAILS (URL too long):
SyntaxCheck(
content: "CLASS /use/cl_pcf2_vecn_dl_ctrl DEFINITION PUBLIC. ENDCLASS. ...",
object_url: "/sap/bc/adt/oo/classes/%2FUSE%2FCL_PCF2_VECN_DL_CTRL/source/main"
)
→ Error: URI-Mapping cannot be performed
# This WORKS (base class URL):
SyntaxCheck(
content: "CLASS /use/cl_pcf2_vecn_dl_ctrl DEFINITION PUBLIC. ENDCLASS. ...",
object_url: "/sap/bc/adt/oo/classes/%2FUSE%2FCL_PCF2_VECN_DL_CTRL"
)
→ null (no errors)
Affected Operations
| Tool | Current URL | Should Use | Status |
|---|---|---|---|
SyntaxCheck |
.../class/source/main → /checkruns |
.../class → /checkruns |
❌ Broken |
UpdateClassInclude |
.../class/includes/ccimp |
.../class (maybe) |
❌ Broken |
WriteClass |
.../class/source/main |
.../class/source/main |
✅ Works |
Suggested Fix
For SyntaxCheck: When constructing the URL for the /checkruns endpoint, use the base class URL without the /source/main suffix:
// Before (broken for long names):
checkRunURL := objectURL + "/source/main" // e.g., .../classes/%2FUSE%2FCL_.../source/main
// After (works):
checkRunURL := objectURL // e.g., .../classes/%2FUSE%2FCL_...For UpdateClassInclude: Investigate whether the /includes/ccimp suffix can be avoided similarly, or if a different ADT endpoint should be used.
Environment
- VSP version: Latest (post-WriteSource fails for namespaced objects (URL encoding & truncation) #18 fix)
- SAP system: S/4HANA (EDV)
- Namespace:
/USE/ - Class name length: 26 characters (
/USE/CL_PCF2_VECN_DL_CTRL)
Workarounds
Current workarounds for users:
- Use
WriteClassinstead ofUpdateClassInclude(works) - Use
syntax_check=falseparameter for long class names - Verify syntax manually in SE24/ADT after write