class EnsLib.SAP.Operation
extends Ens.BusinessOperation
SAP connectivity through SAPJCo. Supporting SAPJCo 3.07+
This is a Business Operation class.
parameter DOMAIN = "EnsSAP";
Domain for $$$Text()
parameter INVOCATION = "Queue";
2 modes: Queue, InProc
parameter SETTINGS = "SAPType:Connect,SAPHost:ConnectA,SAPClient:Connect,SAPSystemNumber:ConnectA,SAPCredentials:Connect,SAPLanguage:Connect,SAPTraceLevel:Connect,SAPTracePath:Connect,SAPMSHost:ConnectB,SAPGWHost:ConnectB,SAPGWServ:ConnectB,SAPGroup:ConnectB,SAPR3Name:ConnectB,JavaGatewayConfigItemName:Basic,SAPTransactionAutoCommit:Basic,SAPResponseHandler:Basic";
MM 20130917 added to allow Type B+D connection
Settings
property JavaGatewayAddress
as %String(TRUNCATE=1);
Java gateway address is the server (name or IP address) where the java gateway runs on,
derived during initialization from the JavaGateway named configuration item in the containing
production
property JavaGatewayConfigItemName
as %String(MAXLEN=100);
This is the name of the (required) configuration item which hosts the JavaGateway.
property JavaGatewayPort
as %String(TRUNCATE=1);
The port on which the javagateway listens, derived during initialization from the
JavaGateway named configuration item in the containing production
property SAPClient
as %String(TRUNCATE=1);
SAP Client e.g 000
property SAPCredentials
as %String;
This is the ID name of the set of credentials values to be used to access the external system
property SAPGWHost
as %String(MAXLEN=1024);
MM 20130917
Used for loadbalanced Type "B" connect. Gateway Host (jco.client.gwhost).
property SAPGWServ
as %String(TRUNCATE=1);
MM 20130917
Used for loadbalanced Type "B" connect. Gateway Service (jco.client.gwserv).
property SAPGroup
as %String(TRUNCATE=1);
MM 20130917
Used for loadbalanced Type "B" connect. SAP Group (jco.client.group).
property SAPHost
as %String(MAXLEN=1024);
MM 20130917
SAPHost is the SAP server's network name or IP address (jco.client.ashost).
property SAPLanguage
as %String(TRUNCATE=1);
property SAPMSHost
as %String(MAXLEN=1024);
MM 20130917
Used for loadbalanced Type "B" connect. Message Server Host (jco.client.mshost).
property SAPPassword
as %String(TRUNCATE=1);
Derived during initialization from SAPCredentials (Not A Setting)
property SAPR3Name
as %String(TRUNCATE=1);
MM 20130917
Used for loadbalanced Type "B" connect. SAP Group (jco.client.r3name).
property SAPResponseHandler
as %String(MAXLEN=100);
Errorhandler, typically a BO or BP. The Errorhandler will get the SAP Response.
property SAPSystemNumber
as %String(TRUNCATE=1);
SAP SystemNumber e.g 00
property SAPTraceLevel
as %String(VALUELIST=",0,1,2,3,4,5,6,7,8,9,10") [ InitialExpression = 0 ];
MM20131001
Typical tracelevels for SAPJCO are:
- 0 - nothing
- 1 - errors and warnings
- 2 - execution path, errors and warnings
- 3 - full execution path, errors and warnings
- 4 - execution path, info messages, errors and warnings
- 6 - full execution path, info messages, errors and warnings
- 7 - debug messages, full execution path, info messages, errors and warnings
- 8 - verbose debug messages, full execution path, info messages, errors and warnings
property SAPTracePath
as %String [ InitialExpression = $system.Util.DataDirectory() ];
MM20171219
Directory path for output of SAPJCO trace.
property SAPTransactionAutoCommit
as %Boolean [ InitialExpression = 1 ];
After a successful BAPI/RFC-call this setting decides if
automatically the BAPI "BAPI_TRANSACTION_COMMIT" will be executed.
property SAPType
as %String(VALUELIST=",A,B") [ InitialExpression = "A",Required ];
MM 20130917
SAP Type for connect: "A" means direct connect, "B" means load balanced connect
property SAPUser
as %String(TRUNCATE=1);
Derived during initialization from SAPCredentials (Not A Setting)
property connJCoDestination
as %RegisteredObject;
MM20171201 Fix Session-Handling
property connJCoRespository
as %RegisteredObject;
MM20171201 Fix Session-Handling
property connJavaGateway
as %RegisteredObject;
MM20171201 Fix Session-Handling
method %OnNew(pConfigName As %String)
as %Status
initialize Business Host object
method Connect(ByRef pGateway As EnsLib.JavaGateway.JavaGateway, ByRef pConnection As %ObjectHandle, ByRef pRepository As %ObjectHandle)
as %Status
Create and initialize a Connection and Repositiory
method DisconnectJavaGateway(pJavaGateway, tSC)
as %Status
MM20171201 Fix Session-Handling
method EasyConnect(ByRef tJavaGateway, ByRef tJCoDestination, ByRef tJCoRespository)
MM20171201 Fix Session-Handling
classmethod GetMessageList()
as %String
This list will appear in the testing wizard facility in the Management Portal
classmethod GetTableFieldCount(pJCoFunction As %ObjectHandle, Output pCount As %Integer)
as %Status
Determine the number of fields in a SAP Table
classmethod HaveSapFieldNamed(pJCoParameterList As %ObjectHandle, pSapFieldName As %String, Output pFound As %Boolean, pSapFieldType As %String)
as %Status
Search the supplied parameter list for a named field.
method OnInit()
as %Status
This user callback method is called just after %OnNew()
method OnMessage(pRequest As %Library.Persistent, Output pResponse As %Library.Persistent)
as %Status
This is the default message handler. All request types not declared in the message map are delivered here
classmethod ProcessError(pJCoFunction As %ObjectHandle, pResponse As Ens.Response)
as %Status
Process Return Value From SAP and derive any error message
method StartTransactionIfNotAlready()
MM20171201 Fix Session-Handling
method Transaction(pCommitOrRollback="")
as %Status
MM20171201 Fix Session-Handling