cancel
Showing results for 
Search instead for 
Did you mean: 

Basic explanation of Connection, Session and Children

Former Member
0 Kudos

Hello,

I started doing scripts to connect to SAP automatically and I wish to better understand Connection, Session, and Children.

How are they related to each others, counted, etc?

example with the classic begenning before connection:

'Connection-------------------------------------------- 
Set SapGuiAuto = GetObject("SAPGUI")   'Get the SAP GUI Scripting object
Set SAPApp = SapGuiAuto.GetScriptingEngine     'Get the currently running SAP GUI
Set SAPCon = SAPApp.OpenConnectionByConnectionString("/SAP_CODEPAGE=1100  /FULLMENU  /M/peadbe0.eu.corp/S/3690/G/SAP_LAN /UPDOWNLOAD_CP=2", True)
Set Session = SAPCon.Children(0)

So it seems:

  • Upper level is the connection to a server. There can be multiple connection to same server by multiple users.

  • These users create always one session at minimum but can open parallel SAP windows to run parallel transaction for example. Hence they create more session.

Am I right? And then, what about the children? What means the "Set Session = SAPCon.Children(0)"?

Thanks for the help

Accepted Solutions (1)

Accepted Solutions (1)

holger_khn
Contributor
0 Kudos

Hello.

SAPCon is the Connection to an server

This Connection can have multiple sessions (children).

"Set Session = SAPCon.Children(0)" => this is the first session to binded SAP Server

"Set Session = SAPCon.Children(1)" => this is the second (parallel) session to binded SAP Server

Former Member
0 Kudos

Thanks for the clarification Holger.

Former Member
0 Kudos

Hello,

   This image shows the hierarchy of sapgui object model.

For more details, see the document compartilahdo the link below.

TheSAPGUI Scripting API.pdf - Google Drive

Evando

Answers (0)