pyxecm 1.6__py3-none-any.whl → 2.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyxecm might be problematic. Click here for more details.
- pyxecm/__init__.py +7 -4
- pyxecm/avts.py +727 -254
- pyxecm/coreshare.py +686 -467
- pyxecm/customizer/__init__.py +16 -4
- pyxecm/customizer/__main__.py +58 -0
- pyxecm/customizer/api/__init__.py +5 -0
- pyxecm/customizer/api/__main__.py +6 -0
- pyxecm/customizer/api/app.py +163 -0
- pyxecm/customizer/api/auth/__init__.py +1 -0
- pyxecm/customizer/api/auth/functions.py +92 -0
- pyxecm/customizer/api/auth/models.py +13 -0
- pyxecm/customizer/api/auth/router.py +78 -0
- pyxecm/customizer/api/common/__init__.py +1 -0
- pyxecm/customizer/api/common/functions.py +47 -0
- pyxecm/customizer/api/common/metrics.py +92 -0
- pyxecm/customizer/api/common/models.py +21 -0
- pyxecm/customizer/api/common/payload_list.py +870 -0
- pyxecm/customizer/api/common/router.py +72 -0
- pyxecm/customizer/api/settings.py +128 -0
- pyxecm/customizer/api/terminal/__init__.py +1 -0
- pyxecm/customizer/api/terminal/router.py +87 -0
- pyxecm/customizer/api/v1_csai/__init__.py +1 -0
- pyxecm/customizer/api/v1_csai/router.py +87 -0
- pyxecm/customizer/api/v1_maintenance/__init__.py +1 -0
- pyxecm/customizer/api/v1_maintenance/functions.py +100 -0
- pyxecm/customizer/api/v1_maintenance/models.py +12 -0
- pyxecm/customizer/api/v1_maintenance/router.py +76 -0
- pyxecm/customizer/api/v1_otcs/__init__.py +1 -0
- pyxecm/customizer/api/v1_otcs/functions.py +61 -0
- pyxecm/customizer/api/v1_otcs/router.py +179 -0
- pyxecm/customizer/api/v1_payload/__init__.py +1 -0
- pyxecm/customizer/api/v1_payload/functions.py +179 -0
- pyxecm/customizer/api/v1_payload/models.py +51 -0
- pyxecm/customizer/api/v1_payload/router.py +499 -0
- pyxecm/customizer/browser_automation.py +721 -286
- pyxecm/customizer/customizer.py +1076 -1425
- pyxecm/customizer/exceptions.py +35 -0
- pyxecm/customizer/guidewire.py +1186 -0
- pyxecm/customizer/k8s.py +901 -379
- pyxecm/customizer/log.py +107 -0
- pyxecm/customizer/m365.py +2967 -920
- pyxecm/customizer/nhc.py +1169 -0
- pyxecm/customizer/openapi.py +258 -0
- pyxecm/customizer/payload.py +18228 -7820
- pyxecm/customizer/pht.py +717 -286
- pyxecm/customizer/salesforce.py +516 -342
- pyxecm/customizer/sap.py +58 -41
- pyxecm/customizer/servicenow.py +611 -372
- pyxecm/customizer/settings.py +445 -0
- pyxecm/customizer/successfactors.py +408 -346
- pyxecm/customizer/translate.py +83 -48
- pyxecm/helper/__init__.py +5 -2
- pyxecm/helper/assoc.py +83 -43
- pyxecm/helper/data.py +2406 -870
- pyxecm/helper/logadapter.py +27 -0
- pyxecm/helper/web.py +229 -101
- pyxecm/helper/xml.py +596 -171
- pyxecm/maintenance_page/__init__.py +5 -0
- pyxecm/maintenance_page/__main__.py +6 -0
- pyxecm/maintenance_page/app.py +51 -0
- pyxecm/maintenance_page/settings.py +28 -0
- pyxecm/maintenance_page/static/favicon.avif +0 -0
- pyxecm/maintenance_page/templates/maintenance.html +165 -0
- pyxecm/otac.py +235 -141
- pyxecm/otawp.py +2668 -1220
- pyxecm/otca.py +569 -0
- pyxecm/otcs.py +7956 -3237
- pyxecm/otds.py +2178 -925
- pyxecm/otiv.py +36 -21
- pyxecm/otmm.py +1272 -325
- pyxecm/otpd.py +231 -127
- pyxecm-2.0.1.dist-info/METADATA +122 -0
- pyxecm-2.0.1.dist-info/RECORD +76 -0
- {pyxecm-1.6.dist-info → pyxecm-2.0.1.dist-info}/WHEEL +1 -1
- pyxecm-1.6.dist-info/METADATA +0 -53
- pyxecm-1.6.dist-info/RECORD +0 -32
- {pyxecm-1.6.dist-info → pyxecm-2.0.1.dist-info/licenses}/LICENSE +0 -0
- {pyxecm-1.6.dist-info → pyxecm-2.0.1.dist-info}/top_level.txt +0 -0
pyxecm/customizer/sap.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"""
|
|
2
|
-
|
|
1
|
+
"""SAP RFC Module to implement Remote Function calls to SAP S/4HANA.
|
|
2
|
+
|
|
3
3
|
For documentation of PyRFC see here: https://github.com/SAP/PyRFC
|
|
4
|
-
and here: https://sap.github.io/PyRFC/pyrfc.html
|
|
4
|
+
and here: https://sap.github.io/PyRFC/pyrfc.html
|
|
5
5
|
|
|
6
6
|
RFC typically uses port 3300 to communication with the SAP server.
|
|
7
7
|
Make sure this port is not blocked by your firewall.
|
|
@@ -22,41 +22,36 @@ Connection Parameter:
|
|
|
22
22
|
ending with the root CA certifcate. It should also contain the client certificate
|
|
23
23
|
used for login at the server, if your client program does not use basic
|
|
24
24
|
user & password authentication)
|
|
25
|
-
|
|
26
|
-
Class: SAP
|
|
27
|
-
Methods:
|
|
28
|
-
|
|
29
|
-
__init__ : class initializer
|
|
30
|
-
call: Calls and RFC based on its name and passes parameters.
|
|
31
|
-
|
|
32
25
|
"""
|
|
33
26
|
|
|
34
27
|
__author__ = "Dr. Marc Diefenbruch"
|
|
35
|
-
__copyright__ = "Copyright 2024, OpenText"
|
|
28
|
+
__copyright__ = "Copyright (C) 2024-2025, OpenText"
|
|
36
29
|
__credits__ = ["Kai-Philip Gatzweiler"]
|
|
37
30
|
__maintainer__ = "Dr. Marc Diefenbruch"
|
|
38
31
|
__email__ = "mdiefenb@opentext.com"
|
|
39
32
|
|
|
40
33
|
import logging
|
|
41
34
|
|
|
42
|
-
|
|
35
|
+
default_logger = logging.getLogger("pyxecm.customizer.sap")
|
|
43
36
|
|
|
44
37
|
try:
|
|
45
38
|
import pyrfc
|
|
46
39
|
|
|
47
40
|
_has_pyrfc = True
|
|
48
41
|
|
|
49
|
-
except ModuleNotFoundError
|
|
50
|
-
|
|
42
|
+
except ModuleNotFoundError:
|
|
43
|
+
default_logger.debug("pyrfc not installed, SAP integration impacted")
|
|
51
44
|
_has_pyrfc = False
|
|
52
45
|
|
|
53
|
-
except ImportError
|
|
54
|
-
|
|
46
|
+
except ImportError:
|
|
47
|
+
default_logger.debug("pyrfc could not be loaded, SAP integration impacted")
|
|
55
48
|
_has_pyrfc = False
|
|
56
49
|
|
|
57
50
|
|
|
58
|
-
class SAP
|
|
59
|
-
"""
|
|
51
|
+
class SAP:
|
|
52
|
+
"""Implement Remote Function Calls (RFC) to SAP S/4HANA."""
|
|
53
|
+
|
|
54
|
+
logger: logging.Logger = default_logger
|
|
60
55
|
|
|
61
56
|
_connection_parameters = {}
|
|
62
57
|
|
|
@@ -74,11 +69,17 @@ class SAP(object):
|
|
|
74
69
|
system_number: str = "00",
|
|
75
70
|
lang: str = "EN",
|
|
76
71
|
trace: str = "3",
|
|
77
|
-
|
|
72
|
+
logger: logging.Logger = default_logger,
|
|
73
|
+
) -> None:
|
|
78
74
|
"""Initialize the SAP object."""
|
|
79
75
|
|
|
80
|
-
logger
|
|
81
|
-
|
|
76
|
+
if logger != default_logger:
|
|
77
|
+
self.logger = logger.getChild("sap")
|
|
78
|
+
for logfilter in logger.filters:
|
|
79
|
+
self.logger.addFilter(logfilter)
|
|
80
|
+
|
|
81
|
+
self.logger.info("Initializing SAP object...")
|
|
82
|
+
self.logger.info("Using PyRFC version -> %s", pyrfc.__version__)
|
|
82
83
|
|
|
83
84
|
# Set up connection parameters
|
|
84
85
|
self._connection_parameters = {
|
|
@@ -91,13 +92,15 @@ class SAP(object):
|
|
|
91
92
|
|
|
92
93
|
# see https://sap.github.io/PyRFC/pyrfc.html#connection
|
|
93
94
|
if ashost:
|
|
94
|
-
logger.info(
|
|
95
|
+
self.logger.info(
|
|
96
|
+
"Logon with application server logon: requiring ashost, sysnr",
|
|
97
|
+
)
|
|
95
98
|
self._connection_parameters["ashost"] = ashost
|
|
96
99
|
self._connection_parameters["sysnr"] = system_number
|
|
97
100
|
self._connection_parameters["sysid"] = system_id
|
|
98
101
|
elif mshost:
|
|
99
|
-
logger.info(
|
|
100
|
-
"Logon with load balancing: requiring mshost, msserv, sysid, group"
|
|
102
|
+
self.logger.info(
|
|
103
|
+
"Logon with load balancing: requiring mshost, msserv, sysid, group",
|
|
101
104
|
)
|
|
102
105
|
self._connection_parameters["mshost"] = mshost
|
|
103
106
|
self._connection_parameters["sysid"] = system_id
|
|
@@ -110,35 +113,49 @@ class SAP(object):
|
|
|
110
113
|
# end method definition
|
|
111
114
|
|
|
112
115
|
def call(self, rfc_name: str, options: dict, rfc_parameters: dict) -> dict | None:
|
|
113
|
-
"""Do an RFC Call.
|
|
116
|
+
"""Do an RFC Call.
|
|
117
|
+
|
|
118
|
+
See http://sap.github.io/PyRFC/pyrfc.html#pyrfc.Connection.call
|
|
114
119
|
|
|
115
120
|
Args:
|
|
116
|
-
rfc_name (str):
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
121
|
+
rfc_name (str):
|
|
122
|
+
This is the name of the RFC (typical in capital letters), e.g. SM02_ADD_MESSAGE.
|
|
123
|
+
options (dictionary, optional):
|
|
124
|
+
The call options for the RFC call. Defaults to {}. Potential options (keys):
|
|
125
|
+
* not_requested:
|
|
126
|
+
Allows to deactivate certain parameters in the function module interface.
|
|
127
|
+
This is particularly useful for BAPIs which have many large tables, the Python client is not interested in.
|
|
128
|
+
Deactivate those, to reduce network traffic and memory consumption in your application considerably.
|
|
129
|
+
This functionality can be used for input and output parameters. If the parameter is an input,
|
|
130
|
+
no data for that parameter will be sent to the backend. If it's an output, the backend will be
|
|
131
|
+
informed not to return data for that parameter.
|
|
132
|
+
* timeout:
|
|
133
|
+
Cancel RFC connection if ongoing RFC call not completed within timeout seconds.
|
|
134
|
+
Timeout can be also set as client connection configuration option, in which case is valid
|
|
135
|
+
for all RFC calls.
|
|
136
|
+
rfc_parameters (dict, optional):
|
|
137
|
+
The actual RFC parameters that are specific for the type of the call. Defaults to {}.
|
|
138
|
+
|
|
128
139
|
Returns:
|
|
129
|
-
dict
|
|
140
|
+
dict | None:
|
|
141
|
+
Result of the RFC call or None if the call fails or timeouts.
|
|
142
|
+
|
|
130
143
|
"""
|
|
131
144
|
|
|
132
145
|
# Create the connection object and call the RFC function
|
|
133
146
|
params = self._connection_parameters
|
|
134
|
-
logger.debug("Connection Parameters -> %s", params)
|
|
147
|
+
self.logger.debug("Connection Parameters -> %s", params)
|
|
135
148
|
|
|
136
149
|
try:
|
|
137
150
|
with pyrfc.Connection(**params) as conn:
|
|
138
151
|
result = conn.call(rfc_name, options=options, **rfc_parameters)
|
|
139
152
|
return result
|
|
140
|
-
except pyrfc.RFCError as
|
|
141
|
-
logger.error(
|
|
153
|
+
except pyrfc.RFCError as sap_error:
|
|
154
|
+
self.logger.error(
|
|
155
|
+
"Failed to call RFC -> '%s'; error -> %s",
|
|
156
|
+
rfc_name,
|
|
157
|
+
str(sap_error),
|
|
158
|
+
)
|
|
142
159
|
return None
|
|
143
160
|
|
|
144
161
|
# end method definition
|