Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WBRIDGE and version 7.4.1
Div
Classe2e-refDiv

Otp
Floatingfalse
maxHLevel1

Rp

The most common use case for tRFC servers is receiving IDocs from SAP. The tRFC server example implements an xUML service that makes the Bridge acting as a tRFC server and shows how to receive IDocs from SAP.

...

The transaction handling is separated from the actual exchange of data and must be handled by implementing all of the following callback operations:

Callback OperationDescriptionReturn Value
 

onCheckTID

This function will be activated, if a transactional RFC is called from an SAP system. The current TID (Transaction ID) has been handed over to the function.

  • The function has to store this TID in permanent storage and return 0.
  • If the same TID is called again later, the function must return a value <> 0.
  • If a transaction with the same TID has already been started by another process, and is not completed yet, the function has to wait until this transaction is completed.
0ok
not 0TID already in use
onCommitThis function is called, if all RFC functions belonging to this transaction are done and the local transaction can be completed. It should be used to locally commit the transaction, if working with database.
onRollbackThis function is called instead of onCommit, if an error occurred in the RFC library while processing the local transaction. This function can be used to roll back the local transaction (working with database).
onConfirmTIDThis function is called, if the local transaction is completed. All information about this TID can be deleted.

Implementing tRFC Operations

...

Figure: IDOC_INBOUND_ASYNCHRONOUS

Noteinfo
iconfalse

Only inbound data flow is allowed for SAP tRFC functions. That is tables and importing parameters. Additionally, when implementing a tRFC function, the modeler can access the current transaction ID via the transactionID input parameter.

tRFC Service Components

...

SingleLinefalse

...

Builder 6

...

Each <<E2ESAPRFCService>> that uses tRFC contains at least two residents:

...

Multiexcerpt
MultiExcerptNametrfc_taggedValues
Tagged ValueDescriptionMandatory/Optional
<<E2EComposite>>
sapDefaultConnectionPoolSize
Multiexcerpt include
MultiExcerptNamesapDefaultConnectionPoolSize
PageWithExcerptFrontend Components
optional
sapPadding
Multiexcerpt include
MultiExcerptNamesapPadding
PageWithExcerptFrontend Components
optional
sapServerWorkerThreads
Multiexcerpt include
MultiExcerptNamesapServerWorkerThreads
PageWithExcerptFrontend Components
optional
<<E2ESAPRFCService>>
host
Multiexcerpt
MultiExcerptNamesap_host

Optional gateway host name. Default is localhost.

optional
gatewayIDThe port number of the SAP gateway.mandatory
programIDThe programID to which the service is registered on the gateway.mandatory
protocol
Multiexcerpt
MultiExcerptNamesap_protocol

Must be trfc when using the tRFC protocol.
Must be rfc when using the RFC protocol.

mandatory
sapTrace
Multiexcerpt
MultiExcerptNamesap_sapTrace

The effect of this flag being true is two fold: First, the SAP RFC libraries will write trace file information (.trc) into the directory the configuration has been deployed to. Second, by using the SAP transaction *SMGW (SAP gateway monitor) we can monitor the dataflow from and to the gateway the server is registered on.

optional
tracePortThe same operations that are called by the SAP system can also be called by SOAP test tool. However, the SOAP test tool requires an HTTP TCP/IP port. This port can be defined in the tracePort tagged value. If this value is not set, the trace port is given by controlPort + 50000.optional
Noteinfo
iconfalse

Multiexcerpt include
MultiExcerptNamesap_padding
nopaneltrue
PageWithExcerptRFC Client

...

The program ID must be defined on the SAP system in transaction SM59. This transaction enables the user to define TCP/IP connections (connection type T). Each such connection has an associated program ID that must be exactly the same string as used for the tagged value programID on the <<E2ESAPRFCService>> component. Note, that this string is case sensitive. On the <<E2ESAPRFCService>> component, you also specify the port number of the SAP gateway the server registers on.

Noteinfo
iconfalse

The Model Compiler throws an error, if a composite service contains more than one <<E2ESAPRFCService>> component. This constraint is given by the very nature of a SAP gateway. Each operating system process must register exactly one program ID at the gateway, otherwise the dispatching of SAP requests to the RFC service is not unique. Now, each xUML service runs in its own Bridge process, thus unique dispatching can only be achieved by allowing only one RFC service - i.e. one program ID - per xUML service.

 tRFC Service Components of

...

Builder Version 5.1

...

Deprecated since Builder 6.0

Expand
titleClick here to read the documentation of the component diagram used in E2E Builder releases before 6.0 ...

Each <<E2ESAPRFCService>> that utilizes tRFC contains at least two residents: One and only one <<E2ESAPTRFCCallbacks>> class holding operations to control transactional behavior (for instance the TRXLogging class beneath) and one or more <<E2ESAPRFCModule>> classes containing operations called by the SAP system to exchange data. For instance, see the IDocInterface class depicted in the deployment diagram beneath. The implementation of these operations is similar to the implementation of standard RFC operations. The only difference results from the asynchronous nature of tRFC operations - they handle input only.

Figure: tRFC Service Component Diagram

The components are manifested by their artifacts, which instantiating the components and annotating all configuration information to run these components on their target systems. The tRFCServiceDeployment has the following tagged values:

Tagged ValueDescriptionMandatory/Optional
protocolmust be trfc when using the tRFC protocolmandatory
tracePortThe same operations that are called by the SAP system can also be called by SOAP test tool if the configuration has been compiled in trace mode. However, the SOAP test tool requires an HTTP TCP/IP port. This port can be defined in the tracePort tagged value. If this value is not set, the trace port is given by controlPort + 50000.optional
sapTraceThe effect of this flag being true is two fold: First, the SAP RFC libraries will write trace file information (.trc) into the directory the configuration has been deployed to. Second, by using the SAP transaction *SMGW (SAP gateway monitor) we can monitor the dataflow from and to the gateway the server is registered on.optiona

Basically, tRFC server components must be registered at the so-called SAP gateway. For example, the artifact tRFCServiceDeployment is registered at the gateway-artifact sapgw00 via the program ID E2E_RFC_ZERTIFI_SERVER_ID.

The program ID must be defined on the SAP system in transaction SM59. This transaction enables the user to define TCP/IP connections (connection type T). Each such connection has an associated program ID that must be exactly the same string as used for the tagged value programID on the <<Register>> dependency. Note, that this string is case sensitive. The <<Register>> dependency points to a component artifact having the name of the SAP gateway the server registers on. This name is given by: sapgw + system number of the SAP system.

Note
iconfalse

The Model Compiler throws an error if a configuration contains more than one SAP RFC service. This constraint is given by the very nature of the SAP gateway. Each operating system process must register exactly one program ID at the gateway if the dispatching of SAP requests to the RFC service shall be unique. Now, each configuration runs in its own Bridge process. Thus, we achieve unique dispatching by allowing only one RFC service - i.e. one program ID - per configuration.