Alefair.SAP.API 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Alefair.SAP.API --version 1.0.2
NuGet\Install-Package Alefair.SAP.API -Version 1.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Alefair.SAP.API" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Alefair.SAP.API --version 1.0.2
#r "nuget: Alefair.SAP.API, 1.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Alefair.SAP.API as a Cake Addin
#addin nuget:?package=Alefair.SAP.API&version=1.0.2

// Install Alefair.SAP.API as a Cake Tool
#tool nuget:?package=Alefair.SAP.API&version=1.0.2

Alefair.SAP.API

SAP API based by Interop.SAPFEWSELib.dll  and  Interop.SapROTWr.dll

Current version 1.0.2

Methods:

class SAPAPI

class SAPTABLE

class EXTENSION

Examples

class SAPAPI

/// Init SAPAPI object, The sap should open if exist
///
SAPAPI gui = new SAPIPI();

back |

GetConnections
/// Method get a Dictionary of open connections
/// Key is an Id of connection
/// Value is an instance of GuiConnection
///
Dictionary<string, object> connections = gui.GetConnections();

-> connections["/app/con[0]"] = <COMObject <unknown>>

back |

GetSessions
/// Method get a Dictionary of open sessions
/// Key is an Id of session
/// Value is an instance of GuiSession
///
Dictionary<string, object> sessions = gui.GetSessions();

-> sessions["/app/con[0]/ses[0]"] = <COMObject <unknown>>

back |

Connect
/// Method create new Connection of GuiConnection object with username, password and base name
///
object connection = gui.Connect(string Login, SecureString Pswd, string Basename);

-> connection <COMObject <unknown>>

back |

CloseConnection
/// Method closes an open connection(-s)
/// by connection           - Conn:connection
/// by id                   - Id:"/app/con[0]"
/// by number of connection - Child:0
/// close all connections   - All:true
///
gui.CloseConnection(object Conn = null, string Id = "", int Child = -1, bool All = false);

///gui.CloseConnection(connection);
///gui.CloseConnection(Id:id_conn);
///gui.CloseConnection(Child:child_conn);
///gui.CloseConnection(All:true);

-> 

back |

CloseSession
/// Method closes an open session(-s)
/// by connection, session           - Conn:connection, Sess:session
/// by id                            - Id:"/app/con[0]"
/// by connection, number of session - Conn:connection, Child:0
/// close all session                - All:true
///
gui.CloseSession(object Conn = null, object Sess = null, string Id = "", int Child = -1, bool All = false);

///gui.CloseSession(connection, session);
///gui.CloseSession(Id:id_sess);
///gui.CloseSession(connection, Child:child_sess);
///gui.CloseSession(connection, All:true);
///gui.CloseSession(All:true);

-> 

back |

CreateSession
/// Method creates a new session from the connection
/// 
object session = gui.CreateSession(object Conn = null);

-> session <COMObject <unknown>>

back |

GetConnection
/// Method gives the instance of the GuiConnection object by ID
/// 
object connection = gui.GetConnection(int connNumber = 0);

-> connection <COMObject <unknown>>

back |

GetSession
/// Method gives the instance of the GuiSession object by ID and connection
/// 
object session = gui.GetSession(object Conn, int SessNumber = 0);

-> session <COMObject <unknown>>

back |

CheckSAP
/// Method checks whether the Saplogon is running or not
/// 
gui.CheckSAP();

-> true

back |

class SAPTABLE

/// Init SAPTABLE object, read GuiGridView table to DataTable
/// selector is an id of GuiGridView table, for example: "wnd[0]/usr/cntlGRID1/shellcont/shell"
/// autodouble is an option, parse value to double, for example: 0,123- -> double -0.123
///
SAPTABLE tbl = new SAPTABLE(GuiSession session, string selector, bool autodouble = true);

back |

ExtractTable
/// Method gets a DataTable with columns type by default
/// ColumnsType.type_default -> Column_1, Column_2...
/// ColumnsType.type_1       -> column name as is
/// ColumnsType.type_2       -> column name as name in report of sap
/// ColumnsType.type_3       -> column name as name of tooltip
///
DataTable table = tbl.ExtractTable(ColumnsType clmntype = ColumnsType.type_default);

-> DataTable(){"Column_1", "Column_2"...}

back |

ExtractFirstVisibleRows
/// Method gets a List<int> of parameters .FirstVisibleRow
///
List<int> fvrc = tbl.ExtractFirstVisibleRows();

-> List<int> {0, 40, 81, 122}

back |

GetTechNamesColumns
/// Method gets a DataTable of only tech columns names
/// Option clmntype gets a real column name
///
/// ColumnsType.type_default -> Column_1, Column_2...
/// ColumnsType.type_1       -> column name as is
/// ColumnsType.type_2       -> column name as name in report of sap
/// ColumnsType.type_3       -> column name as name of tooltip
DataTable dtTech = tbl.GetTechNamesColumns(ColumnsType clmntype = ColumnsType.type_default);

-> DataTable() {"Column Number", "Name", "Value"}

back |

OnlyColumns
/// Method gets a DataTable of only columns names
/// ColumnsType.type_default -> Column_1, Column_2...
/// ColumnsType.type_1       -> column name as is
/// ColumnsType.type_2       -> column name as name in report of sap
/// ColumnsType.type_3       -> column name as name of tooltip
DataTable dtClone = tbl.OnlyColumns(ColumnsType clmntype = ColumnsType.type_default);

-> DataTable(){"Column_1", "Column_2"...}

back |

class EXTENSION

SelectorType
/// Method gets a type name of GuiComponent
///
string selectortype = session.SelectorType("wnd[0]/usr/cntlGRID1/shellcont/shell");

-> selectortype = "GuiGridView"

back |

GetTitle
/// Method gets a title window
string title = session.GetTitle();

-> title = "Transaction Name"

back |

GetStatus
/// Method gets a text from Status Bar
string status = session.GetStatus();

-> status = "Current status"

back |

Product Compatible and additional computed target framework versions.
.NET Framework net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Alefair.SAP.API:

Package Downloads
Primo.Alefair.SAP

SAP Activities for Primo RPA platform based of Alefair.SAP.API powered by Alefair

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.7 1,886 9/20/2022
1.0.6 638 9/7/2022
1.0.5 618 9/2/2022
1.0.4 710 8/18/2022
1.0.3 829 8/14/2022
1.0.2 372 8/13/2022