SAP
SAP RFC Module to implement Remote Function calls to SAP S/4HANA.
For documentation of PyRFC see here: https://github.com/SAP/PyRFC and here: https://sap.github.io/PyRFC/pyrfc.html
RFC typically uses port 3300 to communication with the SAP server. Make sure this port is not blocked by your firewall.
Connection Parameter: * ashost (hostname or IP address of the application server - this should NOT be a full URL!) * sysnr (the backend's system number, e.g. 00) * client (the client or "Mandant" to which to logon, e.g. 100) * user (e.g. "nwheeler") * passwd (password of the user) * lang (logon language as two-character ISO-Code, e.g. EN) * trace (on of 0(off), 1(brief), 2(verbose), 3(detailed), 4(full)) * use_tls (activates SSL/TLS encryption. Set to 0 or 1. By default TLS is turned on (1)) * tls_client_pse (Specifies the PSE file containing the necessary certificates for TLS communication. A PSE file is a SAP proprietary certificate store, similar to a p12 file, containing the private key and the certificate chain to be used in the TLS handshake with the server, beginning with the server's public certificate and ending with the root CA certifcate. It should also contain the client certificate used for login at the server, if your client program does not use basic user & password authentication)
SAP
Implement Remote Function Calls (RFC) to SAP S/4HANA.
Source code in packages/pyxecm/src/pyxecm_customizer/sap.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
|
__init__(username, password, system_id, ashost='', mshost='', msport='3601', group='PUBLIC', destination='', client='100', system_number='00', lang='EN', trace='3', logger=default_logger)
Initialize the SAP object.
Source code in packages/pyxecm/src/pyxecm_customizer/sap.py
call(rfc_name, options, rfc_parameters)
Do an RFC Call.
See http://sap.github.io/PyRFC/pyrfc.html#pyrfc.Connection.call
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rfc_name
|
str
|
This is the name of the RFC (typical in capital letters), e.g. SM02_ADD_MESSAGE. |
required |
options
|
dictionary
|
The call options for the RFC call. Defaults to {}. Potential options (keys): * not_requested: Allows to deactivate certain parameters in the function module interface. This is particularly useful for BAPIs which have many large tables, the Python client is not interested in. Deactivate those, to reduce network traffic and memory consumption in your application considerably. This functionality can be used for input and output parameters. If the parameter is an input, no data for that parameter will be sent to the backend. If it's an output, the backend will be informed not to return data for that parameter. * timeout: Cancel RFC connection if ongoing RFC call not completed within timeout seconds. Timeout can be also set as client connection configuration option, in which case is valid for all RFC calls. |
required |
rfc_parameters
|
dict
|
The actual RFC parameters that are specific for the type of the call. Defaults to {}. |
required |
Returns:
Type | Description |
---|---|
dict | None
|
dict | None: Result of the RFC call or None if the call fails or timeouts. |