Skip to content

Commit 3eb41a2

Browse files
committed
1.9.7
1 parent b74e1cc commit 3eb41a2

File tree

1 file changed

+85
-89
lines changed

1 file changed

+85
-89
lines changed

README.md

Lines changed: 85 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,87 @@
1-
# PyRFC - The Python RFC Connector
2-
3-
## Description
4-
5-
The _pyrfc_ Python package provides Python bindings for _SAP NetWeaver RFC Library_,
6-
for a comfortable way of calling ABAP modules from Python and Python modules from ABAP,
7-
via SAP Remote Function Call (RFC) protocol.
8-
9-
## Platforms & Prerequisites
10-
11-
The _pyrfc_ has been initially built with Python 2.6 and later enhanced, mostly used and tested with Python 2.7 and Python 3,
12-
on Ubuntu Linux and Windows 64 and 32 bit platforms.
13-
14-
OS X and ARM platforms are currently not supported either, as _SAP NW RFC Library_ is not available for those platforms.
1+
# PyRFC - The Python RFC Connector
2+
3+
## Description
4+
5+
The _pyrfc_ Python package provides Python bindings for _SAP NetWeaver RFC Library_,
6+
for a comfortable way of calling ABAP modules from Python and Python modules from ABAP,
7+
via SAP Remote Function Call (RFC) protocol.
8+
9+
## Platforms & Prerequisites
10+
11+
The _pyrfc_ has been initially built with Python 2.6 and wheels are provided for Python 2.7 and 3.6, on 64 bit Linux and Windows platform.
12+
13+
OS X and ARM platforms are currently not supported either, as _SAP NW RFC Library_ is not available for those platforms.
1514

1615
On Windows platforms the Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package (KB973544), or [newer](https://www.microsoft.com/en-us/download/details.aspx?id=48145), must be installed, per [SAP Note 1375494 - SAP system does not start after applying SAP kernel patch](https://launchpad.support.sap.com/#/notes/1375494).
17-
18-
To start using _pyrfc_ you need to obtain _SAP NW RFC Library_ from _SAP Service Marketplace_,
19-
following [these instructions](http://sap.github.io/PyRFC/install.html#install-c-connector).
20-
21-
A prerequisite to download is having a **customer or partner account** on _SAP Service Marketplace_ and if you
22-
are SAP employee please check [SAP Note 1037575 - Software download authorizations for SAP employees](https://launchpad.support.sap.com/#/notes/1037575).
23-
24-
_SAP NW RFC Library_ is fully backwards compatible, supporting all NetWeaver systems, from today, down to release R/3 4.0.
25-
You can therefore always use the newest version released on Service Marketplace and connect to older systems as well.
26-
27-
28-
## Usage examples
29-
30-
In order to call remote enabled ABAP function module (ABAP RFM), first a connection must be opened.
31-
32-
```python
33-
>>> from pyrfc import Connection
34-
>>> conn = Connection(ashost='10.0.0.1', sysnr='00', client='100', user='me', passwd='secret')
35-
```
36-
37-
Using an open connection, we can invoke remote function calls (RFC).
38-
39-
```python
40-
>>> result = conn.call('STFC_CONNECTION', REQUTEXT=u'Hello SAP!')
41-
>>> print result
42-
{u'ECHOTEXT': u'Hello SAP!',
43-
u'RESPTEXT': u'SAP R/3 Rel. 702 Sysid: ABC Date: 20121001 Time: 134524 Logon_Data: 100/ME/E'}
44-
```
45-
46-
Finally, the connection is closed automatically when the instance is deleted by the garbage collector. As this may take some time, we may either call the close() method explicitly or use the connection as a context manager:
47-
48-
```python
49-
>>> with Connection(user='me', ...) as conn:
50-
conn.call(...)
51-
# connection automatically closed here
52-
```
53-
54-
Alternatively, connection parameters can be provided as a dictionary,
55-
like in a next example, showing the connection via saprouter.
56-
57-
```python
58-
>>> def get_connection(connmeta):
59-
... """Get connection"""
60-
... print 'Connecting ...', connmeta['ashost']
61-
... return Connection(**connmeta)
62-
63-
>>> from pyrfc import Connection
64-
65-
>>> SAPROUTER = '/H/111.22.33.44/S/3299/W/e5ngxs/H/555.66.777.888/H/'
66-
67-
>>> TEST = {
68-
... 'user' : 'me',
69-
... 'passwd' : 'secret',
70-
... 'ashost' : '10.0.0.1',
71-
... 'saprouter' : SAPROUTER,
72-
... 'sysnr' : '00',
73-
... 'client' : '100',
74-
... 'trace' : '3', #optional, in case you want to trace
75-
... 'lang' : 'EN'
76-
... }
77-
78-
>>> conn = get_connection(TEST)
79-
Connecting ... 10.0.0.1
80-
81-
>>>c.alive
82-
True
83-
```
84-
85-
Installation & Documentation
86-
----------------------------
87-
88-
For further details on connection parameters, _pyrfc_ installation and usage,
89-
please refer to [_pyrfc_ documentation](http://sap.github.io/PyRFC),
90-
complementing _SAP NW RFC Library_ [programming guide and documentation](http://service.sap.com/rfc-library)
91-
provided on SAP Service Marketplace.
16+
17+
To start using _pyrfc_ you need to obtain _SAP NW RFC Library_ from _SAP Service Marketplace_,
18+
following [these instructions](http://sap.github.io/PyRFC/install.html#install-c-connector).
19+
20+
A prerequisite to download is having a **customer or partner account** on _SAP Service Marketplace_ and if you
21+
are SAP employee please check [SAP Note 1037575 - Software download authorizations for SAP employees](https://launchpad.support.sap.com/#/notes/1037575).
22+
23+
_SAP NW RFC Library_ is fully backwards compatible, supporting all NetWeaver systems, from today, down to release R/3 4.0.
24+
You can therefore always use the newest version released on Service Marketplace and connect to older systems as well.
25+
26+
## Usage examples
27+
28+
In order to call remote enabled ABAP function module (ABAP RFM), first a connection must be opened.
29+
30+
```python
31+
>>> from pyrfc import Connection
32+
>>> conn = Connection(ashost='10.0.0.1', sysnr='00', client='100', user='me', passwd='secret')
33+
```
34+
35+
Using an open connection, we can invoke remote function calls (RFC).
36+
37+
```python
38+
>>> result = conn.call('STFC_CONNECTION', REQUTEXT=u'Hello SAP!')
39+
>>> print result
40+
{u'ECHOTEXT': u'Hello SAP!',
41+
u'RESPTEXT': u'SAP R/3 Rel. 702 Sysid: ABC Date: 20121001 Time: 134524 Logon_Data: 100/ME/E'}
42+
```
43+
44+
Finally, the connection is closed automatically when the instance is deleted by the garbage collector. As this may take some time, we may either call the close() method explicitly or use the connection as a context manager:
45+
46+
```python
47+
>>> with Connection(user='me', ...) as conn:
48+
conn.call(...)
49+
# connection automatically closed here
50+
```
51+
52+
Alternatively, connection parameters can be provided as a dictionary,
53+
like in a next example, showing the connection via saprouter.
54+
55+
```python
56+
>>> def get_connection(connmeta):
57+
... """Get connection"""
58+
... print 'Connecting ...', connmeta['ashost']
59+
... return Connection(**connmeta)
60+
61+
>>> from pyrfc import Connection
62+
63+
>>> TEST = {
64+
... 'user' : 'me',
65+
... 'passwd' : 'secret',
66+
... 'ashost' : '10.0.0.1',
67+
... 'saprouter' : '/H/111.22.33.44/S/3299/W/e5ngxs/H/555.66.777.888/H/',
68+
... 'sysnr' : '00',
69+
... 'client' : '100',
70+
... 'trace' : '3', #optional, in case you want to trace
71+
... 'lang' : 'EN'
72+
... }
73+
74+
>>> conn = get_connection(TEST)
75+
Connecting ... 10.0.0.1
76+
77+
>>>c.alive
78+
True
79+
```
80+
81+
Installation & Documentation
82+
----------------------------
83+
84+
For further details on connection parameters, _pyrfc_ installation and usage,
85+
please refer to [_pyrfc_ documentation](http://sap.github.io/PyRFC),
86+
complementing _SAP NW RFC Library_ [programming guide and documentation](http://service.sap.com/rfc-library)
87+
provided on SAP Service Marketplace.

0 commit comments

Comments
 (0)