Skip to content

About

Pure-Go SAP GUI DIAG protocol library — read the wire, describe screens, draw them on a real SAP GUI. Powers a live demoscene light-show at demo.desude.su. Research/interop, not affiliated with SAP.

Resources

Stars

7 stars

Watchers

0 watching

Forks

Latest commit

 

History

169 Commits

Folders and files

Repository files navigation

open-diag-go (odg)

SAP GUI as a display. A server that speaks DIAG — the protocol between SAP GUI and the dispatcher — well enough for a real SAP GUI to connect to it and draw one dynpro after another from our own description, at our own cadence. No SAP system behind it: the frames come from a demo engine.

Pure Go, no SAP libraries, MIT-licensed. Built on open-rfc-go for the NI transport and the framing-aware proxy, and on vibing-steampunk's sapcompress for the LZH and LZC that DIAG uses on the wire.

Try it live: point a SAP GUI at demo.desude.su (Instance Number 00, no SNC), or watch in your terminal with sap-tui: sap-tui demo.desude.su:3200. The light-show it draws is sap-lsd, built on this library.

📺 See it in action (watch on YouTube):

open-diag-go — a demoscene light-show drawn over SAP DIAG

The one thing everything hangs on

A dynpro is redrawn only when the GUI does a roundtrip, and a roundtrip happens on user input. A server-driven animation needs the server to ask the GUI for a roundtrip. A report on a live system does that today with an asynchronous RFC timer — STARTING NEW TASK … PERFORMING … ON END OF TASK — and the GUI obliges: something in the DIAG stream tells it to send a PAI. That item is the kick. Phase 0 puts such a report on a sandbox, captures the traffic with tap, and finds the kick with lens. Its exact encoding is what Phase 0 delivers; that it exists is inferred from the report working, not known.

Our own server never needs RFC: it sends the kick on its own timer.

Tools

cmd/tap Proxy between a real SAP GUI and a sandbox's dispatcher port; writes every NI frame of both directions to JSONL with timestamps. Works without SNC only.
cmd/lens Reads a tap capture: DIAG header, decompression, items; diffs neighbouring frames. Unknown items stay raw.
pkg/diag The item catalog — each entry confirmed, inferred or raw — and, later, the serializer.
pkg/frame The canvas: a grid of character cells with attributes, widget placements, title, status.
pkg/runtime Effects and the timeline, ported from bytebeat-abap's ZIF_O4D_EFFECT.
abap/ The Phase 0 probe: a report that redraws itself on an aRFC timer.
captures/ Captures from the sandbox.
go build ./cmd/tap ./cmd/lens
./tap -listen :3200 -target sandbox.example:3200 -dump captures/probe.jsonl   # then point SAP GUI at localhost:3200
./lens captures/probe.jsonl                                                  # what went by, item by item

Standalone DIAG stub

go run ./cmd/lsd -stub tape -sid QRS serves the tape screen with system ID QRS. Library callers set lsd.Options{Stub: "tape", SID: "QRS"} when calling lsd.Serve. An empty SID keeps the default LSD; identity fields retain their wire widths, with space padding or truncation as needed. The SID applies to all embedded screen, list, logon and popup shells.

The first non-keepalive NI frame must contain a 200-byte dispatcher header starting with ffffffff, an uncompressed DIAG header with INI set, and at least one complete, recognized item. Malformed hellos close the connection immediately without a screen or error frame, matching open-steamgate's JS tape server.

License & disclaimer

MIT — see LICENSE.

This is an independent interoperability / research project. It is not affiliated with, authorized, or endorsed by SAP SE. "SAP" and related marks are trademarks of SAP SE, used here only to name the protocol this speaks. Point it at systems you are allowed to test; the public light-show at demo.desude.su:3200 is there to play with.

osd-up: the local ABAP system as one command

cmd/osd-up brings up open-steamgate — the ADT façade with the transpiled system in a child it supervises — and mounts, in the same process, the RFC bridge from open-rfc-go (pkg/adtbridge) on the gateway port and this repository's DIAG stub (pkg/lsd) on the dispatcher port. Three terminals become one:

go run ./cmd/osd-up -root ../open-steamgate -instance 6
#   Eclipse: Custom Application Server, host <your IP>, instance 06 (RFC on 3306)
#   SAP GUI: the same three values (DIAG on 3206)
#   Ctrl-C stops all of it

-dev adds the workbench's dev loop (a save on disk is a check, a build and a recycle), -stub picks the still screen SAP GUI gets on F8, -no-rfc / -no-diag leave a door unmounted. The workbench runs under Node until its Bun binary exists; the two Go halves are already libraries here.

About

Pure-Go SAP GUI DIAG protocol library — read the wire, describe screens, draw them on a real SAP GUI. Powers a live demoscene light-show at demo.desude.su. Research/interop, not affiliated with SAP.

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages