feat(adt): SAP Enhancement Framework (ENHO) read support#130
Open
barkow15 wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the ability to read SAP enhancement implementations (ENHO objects) through the MCP surface — bridging the gap between what the ADT REST API exposes and what a developer actually sees in SE80.
Background
SAP's enhancement framework stores plug-in implementations as independent ADT objects (
ENHO/XH,ENHO/XC, etc.). SE80 merges these into the host include's displayed source at render time, but the raw ADT source endpoint never returns them. On classic ECC systems, the REST surface is missing entirely forHOOK_IMPLplug-ins — making them invisible to any tool that only speaks ADT REST.What's new
GetEnhancement(name)— resolves an ENHO by name viaSearchObject, then fetches its source through a 3-step fallback chain:/sap/bc/adt/enhancements/enhoxh/<name>/source/main)READ REPORT— the only reliable path on classic ECC, whereRPY_PROGRAM_READraisesCANCELLEDinside RFC contextsGetEnhancementByRef(ref)— same fetch logic, but skips re-resolution so that callers who obtained their ref via the table fallback retain theEnhIncludefield (the realREPOSRCentry name with=-padding), rather than falling back to the lossy<name>Econvention.ListEnhancementsForInclude(includeName)— lists all ENHO implementations attached to a given include, also with a 3-step fallback:/sap/bc/adt/enhancements/enhoxhs?enhancedObjectUri=…)D010INC ⨝ ENHINCINX) for ECC / older NetWeaver — the only path that works forHOOK_IMPLplug-ins on those systemsGetIncludeMerged(includeName)— returns an include's source with each referenced ENHO spliced in at its$*$\SE:(N)anchor, matching what SE80 shows with "Display Source (Modified)". Unresolvable anchors are appended with an explanatory header rather than dropped.WebSocket:
ReadSourceaction — added toDebugWebSocketClientalongside the existingCallRFC. Uses server-sideREAD REPORTinstead ofRPY_PROGRAM_READto avoid the authorization dialog that blocks RFC-context reads on classic ECC.Regex compatibility — fixed embedded ABAP (
ZCL_VSP_*) to use onlyPOSIXcharacter classes and syntax supported on SAP versions older than 7.55, where Perl-style patterns aren't available.Compatibility
The feature degrades gracefully at every step. When neither REST endpoint nor the ZADT_VSP bridge is available, the caller receives a structured error with enough metadata (package, include name) to navigate to the object in SE80 manually. No existing tool behavior is changed.