'SAP Gui Scripting | .NET | Start transaction with parameters

I have the following script, which allows me to to control the SAP Gui with .NET (C#)

SapROTWr.CSapROTWrapper sapROT = new SapROTWr.CSapROTWrapper();
object objSapGui = sapROT.GetROTEntry("SAPGUI");
object objEngine = objSapGui.GetType().InvokeMember("GetScriptingEngine", System.Reflection.BindingFlags.InvokeMethod, null, objSapGui, null);
GuiConnection connection = (GuiConnection)(objEngine as GuiApplication).Connections.Item(0);
SapSession = (GuiSession)connection.Sessions.Item(0);
SapSession.SendCommand("/nN204");

As i figured out, i can start a transaction within the SAP Gui with GuiSession.StartTransaction("N204") or with GuiSession.SendCommand("/nN204")

Now I want to start the transaction with a parameter structure to go directly into a specific for example document at this point. How can I achieve this?

My first thought was the GuiApplication.CreateGuiCollection() but as I do not found any examples, I do not now what to do with it.

It would be nice if someone could share a approach to achieve my goal.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source