SapGui.Wrapper - strongly-typed SAP GUI scripting for Coded Workflows (feedback welcome!)

Hey everyone :waving_hand:

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, and WithRetry built in - no more copy-pasted timing workarounds
  • LaunchWithSso for fully unattended robots - starts SAP, connects via SSO, handles post-login popups automatically
  • HealthCheck() / EnsureHealthy() for pre-flight validation before the robot does anything
  • ILogger and SapLogAction delegate overloads that plug straight into UiPath’s Log() with one line
  • Targets both net461 (classic UiPath) and net6.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


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!

Hello @AlexRivas!

It seems that you have trouble getting an answer to your question in the first 24 hours.
Let us give you a few hints and helpful links.

First, make sure you browsed through our Forum FAQ Beginner’s Guide. It will teach you what should be included in your topic.

You can check out some of our resources directly, see below:

  1. Always search first. It is the best way to quickly find your answer. Check out the image icon for that.
    Clicking the options button will let you set more specific topic search filters, i.e. only the ones with a solution.

  2. Topic that contains most common solutions with example project files can be found here.

  3. Read our official documentation where you can find a lot of information and instructions about each of our products:

  4. Watch the videos on our official YouTube channel for more visual tutorials.

Hopefully this will let you easily find the solution/information you need. Once you have it, we would be happy if you could share your findings here and mark it as a solution. This will help other users find it in the future.

Thank you for helping us build our UiPath Community!

Cheers from your friendly
Forum_Staff

That’s an impressive GitHub project you have there, @AlexRivas
I starred and forked and will give it a spin!

I absolutely love the IntelliSense and compile-time safety that I achieve with my “coded config”.
That makes your approach immediately attractive!

It is way too early to give any feedback, but I want to share how I approach your project:

  • star, fork and clone
  • explore with my preferred coding agent
  • generate wiki pages in my fork

So Configuration Reference · cprima-forks/SapGui.Wrapper Wiki holds some initial Wiki Pages with findings of my explorations.
Again, these are far from feedback – but maybe interesting for you what functional aspects I immediately interact with.

The wiki pages could then equally be cloned by you and read by your favorite LLM