Alefair.SAP.API
1.0.2
There is a newer version of this package available.
See the version list below for details.
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Alefair.SAP.API
SAP API based by Interop.SAPFEWSELib.dll and Interop.SapROTWr.dll
Current version 1.0.2
Methods:
- GetConnections
- GetSessions
- Connect
- CloseConnection
- CloseSession
- CreateSession
- GetConnection
- GetSession
- CheckSAP
- SelectorType
- GetTitle (added 1.0.2)
- GetStatus (added 1.0.2)
Examples
class SAPAPI
/// Init SAPAPI object, The sap should open if exist
///
SAPAPI gui = new SAPIPI();
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>>
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>>
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>>
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);
->
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);
->
CreateSession
/// Method creates a new session from the connection
///
object session = gui.CreateSession(object Conn = null);
-> session <COMObject <unknown>>
GetConnection
/// Method gives the instance of the GuiConnection object by ID
///
object connection = gui.GetConnection(int connNumber = 0);
-> connection <COMObject <unknown>>
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>>
CheckSAP
/// Method checks whether the Saplogon is running or not
///
gui.CheckSAP();
-> true
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);
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"...}
ExtractFirstVisibleRows
/// Method gets a List<int> of parameters .FirstVisibleRow
///
List<int> fvrc = tbl.ExtractFirstVisibleRows();
-> List<int> {0, 40, 81, 122}
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"}
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"...}
class EXTENSION
SelectorType
/// Method gets a type name of GuiComponent
///
string selectortype = session.SelectorType("wnd[0]/usr/cntlGRID1/shellcont/shell");
-> selectortype = "GuiGridView"
GetTitle
/// Method gets a title window
string title = session.GetTitle();
-> title = "Transaction Name"
GetStatus
/// Method gets a text from Status Bar
string status = session.GetStatus();
-> status = "Current status"
Product | Versions 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.