Hey everyone ![]()
I’ve just released SapGui.Wrapper v1.0.0, a NuGet library I’ve been building to make SAP GUI automation with Coded Workflows feel like proper C# instead of VBScript wrapped in COM.
The problem it solves
When you automate SAP in a Coded Workflow today, you either use classic activities (fragile, image-based) or write raw COM calls against SapROTWr - no IntelliSense, no compile-time checks, errors discovered at runtime.
This library wraps the SAP GUI Scripting API into a typed surface so you can stop guessing and start shipping.
What’s included
- Typed wrappers for 20+ SAP controls -
GuiGridView,GuiTable,GuiTree,GuiComboBox,GuiTabStrip,GuiToolbar,GuiMenu, and more WaitForReadyState,ElementExists,WaitUntilHidden, andWithRetrybuilt in - no more copy-pasted timing workaroundsLaunchWithSsofor fully unattended robots - starts SAP, connects via SSO, handles post-login popups automaticallyHealthCheck()/EnsureHealthy()for pre-flight validation before the robot does anythingILoggerandSapLogActiondelegate overloads that plug straight into UiPath’sLog()with one line- Targets both
net461(classic UiPath) andnet6.0-windows(Studio 23+)
Quick example
using var sap = SapGuiClient.Attach();
var session = sap.Session;
session.WithRetry(maxAttempts: 3, delayMs: 500).Run(() =>
{
session.StartTransaction("/nSE16");
session.WaitForReadyState(timeoutMs: 10_000);
session.TextField("wnd[0]/usr/ctxtDATABROWSE-TABLENAME").Text = "MARA";
session.PressExecute();
session.WaitForReadyState(timeoutMs: 30_000);
});
var grid = session.GridView("wnd[0]/usr/cntlGRID/shellcont/shell");
Log($"Rows: {grid.RowCount}");
Links
NuGet: NuGet Gallery | SapGui.Wrapper 1.0.0
Docs: SapGui.Wrapper | SapGui.Wrapper
GitHub: GitHub - alexrivax/SapGui.Wrapper: Wrapper for SAP GUI Automation using dotnet · GitHub
What I’d love from the community
I’m committed to maintaining this long-term. If you work with SAP automation in UiPath, I’d really appreciate if you:
- Try it on a real workflow and let me know how it goes
- Tell me what’s missing - SAP controls you need that aren’t wrapped, patterns that don’t fit, APIs that feel wrong
- Open an issue or discussion on GitHub if you hit a bug or have an idea
Any feedback - good or bad - is super welcome.
Thanks for reading!