Modeling tRFC clients is explained by an example showing how the Bridge can send IDocs to SAP. This is the most common use case for tRFC clients. The difference between tRFC and RFC is the additional transaction handling. This transaction handling must guarantee that one transaction can be executed only once.
...
Accessing SAP via tRFC requires the following adapters:
Adapter | Description |
---|
<<SAPTRFCCreateTransaction>> | This adapter tries to get a transaction ID from the SAP system. - In case of error, the RFC client must reconnect later and try to repeat this call.
- In case of success, the following adapter can use the resulting transaction ID as input.
In this case, the transaction ID will be logged as correlation ID to the transaction log (see Contents of the Transaction Log)
|
<<SAPTRFCAdapter>> | The tRFC Adapter takes all input data and the current transaction ID and sends them to the SAP system using the tRFC protocol. Possible input parameters are import and tables. Output parameters are not support because the tRFC protocol is asynchronous. In all other respects, the <<SAPTRFCAdapter>> works like the <<SAPRFCAdapter>>. This adapter is used in the TestSimpleTypes activity diagram of the example (see Calling_ABAP_Functions_via_RFC). In this diagram, the general RFC interface is explained and the possible tagged values of such adapters. These adapters have import and tables input parameters. The import and tables input parameters must have base types of stereotype <<SAPParameters>> respectively <<SAPTables>>. For details see the class diagram describing the input tables for IDOC_INBOUND_ASYNCHRONOUS. - If an error occurs, the tRFC adapter has to reconnect later and must try to repeat the call. In this case, it has to use the old transaction ID and must not get a new transaction ID using the <<SAPTRFCreateTransaction>> adapter. Otherwise, it is not guaranteed that the RFC function call will be executed exactly once in the SAP system.
- After a successful execution of this call, the transaction is completely terminated in the SAP system. The tRFC client must update its own transaction ID management and call <<SAPTRFCConfirmTransaction>>. However, this logic is not implemented in the current simple example but in the E2E SAP module.
|
<<SAPTRFCConfirmTransaction>> | This adapter confirms the successful termination of a transaction. It must be called only if no errors occurred during execution of the <<SAPTRFCAdapter>>. The transaction ID will be logged as correlation ID to the transaction log (see Contents of the Transaction Log) |
Note |
---|
|
In contrast to tRFC between SAP systems, a transaction from an RFC client must contain only one RFC function. |
...
Figure: Activity Diagram Example Of Calling tRFC Functions
Noteinfo |
---|
|
If you drag and drop the operation from the containment tree to the diagram pane, it will get the stereotype <<SAPRFCAdapter>>. To replace this with the desired stereotype <<SAPTRFCAdapter>> you have to remove the old stereotype first and then select the new one from the list, because <<SAPTRFCAdapter>> will not show up on the list of available stereotypes as long as <<SAPRFCAdapter>> is still selected. |
...
Multiexcerpt include |
---|
MultiExcerptName | sap_tagged_values |
---|
PageWithExcerpt | SAP |
---|
|
Noteinfo |
---|
|
systemNumber and routerString can be found in the SAP GUI logon panel. |
Noteinfo |
---|
|
Multiexcerpt include |
---|
MultiExcerptName | sap_padding |
---|
nopanel | true |
---|
PageWithExcerpt | RFC Client |
---|
|
|
...
Following options are available :
Name | Description | Values | Default |
---|
ABAP_DEBUG | RFC with ABAP debugger | 0 | without Debugger | 0 |
1 | with Debugger |
ASHOST | Host name of a specific application server (R/3, No Load Balancing) |
| | |
|
|
|
CFIT | Conversion Fault Indicator Token. This flag determines substitute symbol for received Unicode characters, which could not be converted by the RFC library. |
| |
|
| non Unicode systems 0x23, Unicode systems 0xfffd, or defined by environment variable RFC_REPL_CHAR |
CODEPAGE | The given codepage is to be used for this connection (Default is either 1100 or set by RfcSetSystemCodepage or is set by SAP_CODEPAGE environment variable). Could be rather useful if the sapgui should be started with codepage differs from 1100. |
| |
|
|
|
COMM_CP | When communication has to be established between an Unicode Library and a Non Unicode system, all char like data will be converted into codepage which matched to logon language before send them. This codepage is called communication codepage. The effect of this method is that the Non Unicode System is sure to talk an system with communication codepage and not with an Unicode system. Usually the RFC Library determines automatically the communication codepage. Using this option it is possible for the programmer to set the communication codepage directly. This option is only active in the Unicode version of the RFC library. |
| |
|
|
|
DEST | Destination in saprfc.ini if working with saprfc.ini. If the RFC server is an R/2 system this destination must also be defined in the 'sideinfo' for the SAP gateway. |
| | |
|
|
|
GROUP | Name of the group of application servers (if using Load Balancing) |
| | |
|
|
|
GRT_DATA | SAProuter connect data for SAPGUI when using RFC with SAPGUI. /H/...... : the whole router string for SAPGUI. /P/password: If the password for the SAPGUI connection is not the same as the one for the RFC connection. |
| | |
|
|
|
GWHOST | Host name of the SAP gateway (if server is R/2 or External) |
| |
|
|
|
GWSERV | Service of the SAP gateway (if server is R/2 or External) |
| | |
|
|
|
ICCE | Ignore Character Conversion Errors. This flag determines the runtime behavior of the RFC library concerning character conversion. If this flag is 1, the concerned API will not exit with error, but replace the character which could not be converted with CFIT defined token. | 0 | not ignore | 0 or defined by environment variable RFC_IGNORE_CONV_ERROR |
1 | ignore |
IDLE_TIMEOUT | Inform the Web Application Server to close the connection after idle time in seconds. |
| |
|
|
|
LCHECK | Logon check at OPEN time | 0 | without check | 1 |
1 | with check |
MSHOST | Host name of the Message Server (if using Load Balancing) |
| | |
|
|
|
MSSERV | Service of the Message Server (if using Load Balancing) |
| | |
|
|
|
NEWPASS | Changes the password during logon Note |
---|
| On SAP system kernel older than 46C the password is sent in clear text on the network! |
|
| | |
|
|
|
PCS | Partner's Char Size. The RFC-library determines automatically the partner's char size at open time (using logon check) or at first call time (without logon check). This flag tells directly the Unicode RFC library to open a connection to a system with size of char given by this value. - If the partner is not an Unicode system but the value of the PCS flag is 2 an error will occur (runtime exception in the remote system).
- If the partner is a Unicode system but the value of the PCS flag is 1 the connection kind will be switched automatically. This field works only with Unicode library.
| 1 | Non Unicode | 1 |
2 | Unicode |
R3NAME | Name of the SAP system (if using Load Balancing) |
| |
|
|
|
SAPLOGON_ID | String defined for SAPLOGON on 32-bit Windows |
| | |
|
|
|
SNC_LIB | Path and name of the SNC-library |
| | |
|
|
|
SNC_MODE | Working with SNC | 0 | without SNC | 0 (see RFC_SNC_MODE) |
1 | with SNC |
SNC_MYNAME | Own SNC name if you don't want to use the default SNC name |
| | |
|
|
|
SNC_PARTNERNAME | SNC name of the SNC partner (RFC server) or SNC name of the message server (Load Balancing) |
| | |
|
|
|
SNC_QOP | SNC Quality of service |
|
|
| 8 (RFC_SNC_QOP_DEFAULT, see RFC_SNC_QOP) |
SYSNR | SAP system number (R/3, No Load Balancing) |
| | |
|
|
|
TOUPPER | conversion of user and password to upper case for sending to Web Application Server | 0 | do not convert password to upper | 1, i.e. convert to upper case |
1 | convert password to upper |
TPHOST | Host name of the external RFC server program |
| | |
|
|
|
TPNAME | Path and name of the external RFC server program or Program ID of an registered RFC server program. |
| | |
|
|
|
TRACE | RFC trace | 0 | without trace | 0 |
1 | with trace |
TYPE | RFC server type, 2/3/E: R/2 or R/3 or External System |
| |
|
| 3 |
USE_SAPGUI | RFC with SAPGUI. If the sapgui is to be started with codepage differs from 1100, please use option CODEPAGE to define the codepage you need. | 0 | without SAPGUI | 0 |
1 | with SAPGUI |
2 | invisible SAPGUI |
WAN_CONN | RFC via Wide Area Network. - If LAN is used, all tables bigger than 8000 Bytes will be compressed before sent.
- If WAN is used, all tables bigger than 250 Bytes (or value defined by environment variable RFC_WAN_THRESHOLD) will be compressed before sent. The table size will be calculated as follows: table_length * number_of_rows.
| 0 | LAN | 0 |
1 | WLAN |
Alternative login possibilities:
Name | Description |
---|
ALIAS_USER | An alias user name, could used instead of user or even together with USER. If both USER and ALIAS_USER are used, than they have to be match. |
EXTIDDATA | Contains valid external user's ID of an external authentification system. User name is optional. External ID is to be defined in the backend (SAP-System). |
EXTIDTYPE | Defines the kind of external identity. Valid only with EXTIDDATA. Follow values are not allowed: ID, NT; DN, CA, X, HX. Additionally, RFC Library provides the feature to retrieve MYSAPSSO2 certificate from the backend after successful logon. |
GETSSO2 | Request to create a cookie version 2 using given password and user name. If the value is 1, the cookie will be generated from user and password values given by USER=user and PASSWORD=password in the same connect_param string. Instead, user and password X.509 certificate could be used. If the RfcOpenEx call ended successfully, the generated SAP cookie version 2 can be retrieved via RfcGetTicket API. |
MYSAPSSO | SAP Cookie Version 1. Will be used instead of user and password for logon to backend |
MYSAPSSO2 | SAP Cookie Version 2. Will be used instead of password for logon to backend. In this case, user name is optional. |
X509CERT | An X.509 certificate will be used instead of password to logon to SAP System. In this case, user name is optional. |
tRFC Client Components of E2E Builder Version 5.1
...
Deprecated since E2E Builder 6.0
Expand |
---|
title | Click here to read the documentation of the component diagram used in E2E Builder releases before 6.0 ... |
---|
|
The components depicted in the figure below send IDocs from the frontend via tRFC to SAP. The frontend interface is SOAP. Therefore, the configuration holds a SOAP service component, namely tRFCClientService. This component contains a SOAP IDocInterface whose operations do the actual calling of the SAP tRFC interface. This interface (IDocInterface) has the stereotype <<SAPRFCModuleInterface>> and it is resident in a <<SAPRFCService>> component (tRFCService). Figure: tRFC Client 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 component instance contained in the tRFCClientExample artifact contains a SOAP service accessing the SAP system. This SAP system is modeled as component artifact tRFCServiceDeployment having the base type tRFCService and holding the following tagged values: Name | Description | Mandatory /Optional |
---|
protocol | The tRFC protocol requires trfc as value. | mandatory | systemNumber | The system number of the SAP system. | optional, default = "00" | language | SAP logon language (1-byte SAP language like E for English, D for German, or 2-byte ISO language like EN for English, DE for German) | optional | routerString |
Noteinfo |
---|
| systemNumber and routerString are found in the SAP GUI logon panel. |
Like for every other adapter there must be a dependency between the composite using the tRFC adapter and the interface accessed by the adapter. This dependency must have the following tagged values: Name | Description | Mandatory /Optional |
---|
alias | Reference to the alias used by the tRFC adapter. | mandatory | client | The SAP logon client. | mandatory | user | user/password | mandatory | options | A blank separated list of name value pairs: name1="value1" name2="value2", and so forth. The possible name value pairs are found in the appendix beneath. | optional |
|