-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Chaohui Zhang
committed
Mar 7, 2017
0 parents
commit a4d936f
Showing
19 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM python:2.7 | ||
|
||
ADD scripts/ /usr/local/cbpython/scripts/ | ||
ADD libs/ /usr/local/cbpython/libs/ | ||
ADD pyrfc/ /usr/local/cbpython/pyrfc/ | ||
|
||
RUN cp -r /usr/local/cbpython/libs/* /usr/lib/ | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y python-setuptools | ||
|
||
RUN cd /usr/local/cbpython/pyrfc; easy_install pyrfc-1.9.3-py2.7-linux-x86_64.egg | ||
|
||
#CMD ["python", "/usr/local/cbpython/scripts/pythonscript.py"] | ||
CMD ["python2"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# SAPPyRFC-Docker | ||
|
||
How to run this docker | ||
--- | ||
|
||
1. Run `docker build -t my-python-app .` to build your image | ||
2. Start docker with `docker run -itd --name my-running-app my-python-app` | ||
3. Go to docker container with `docker exec -it container-id bash` | ||
4. Connection to SAP with `python /usr/local/cbpython/scripts/pythonscript.py` |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
**** Trace file opened at 2017-03-06, 16:37:19 GMT | ||
RFC library: 721, Current working directory: /home/zhang333/Downloads/PyRFC/dist, Program: python | ||
Hardware: AMD/Intel x86_64 with Linux x86_64, Operating_system: Linux 3.13.0-101-generic, Kernel_release: 721 patchlevel 42 | ||
Hostname: ubuntu, IP address: 127.0.1.1, IP address_v6: 127.0.1.1 | ||
|
||
ERROR The UUID daemon (uuidd) is not active. | ||
|
||
Please ask your system administrator to activate | ||
uuidd according to SAP note 1391070. | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
print "100 + 200 = ", 100+200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from pyrfc import Connection | ||
from pprint import PrettyPrinter | ||
conn = Connection(user='USER_RFC', passwd='password', ashost='sap.com', sysnr='15', client='700') | ||
|
||
function_name = 'Z_ECATT_DEVOPS_AUTO_EXTRACT' | ||
imp = dict( | ||
START_LNR='000001', | ||
OBJ_LNR='000001', | ||
OBJ_VER='00000001', | ||
OBJ_TYPE=u'ECSC', | ||
OBJ_NAME=u'ZCRM_AO_PROCESS', | ||
) | ||
|
||
result = conn.call(function_name, TO_EXECUTE=[imp]) | ||
|
||
#INPUT: | ||
#TO_EXECUTE | ||
#START_LNR 000001 NUMC 6 | ||
#OBJ_LNR 000001 NUMC 6 | ||
#OBJ_TYPE 'ECSC' CHAR 4 | ||
#OBJ_NAME 'ZCRM_AO_PROCESS' CHAR 30 | ||
#OBJ_VER 00000001 NUMC 8 | ||
|
||
#OUTPUT: | ||
#lt_execute | ||
#lv_status CHAR 120 | ||
|
||
|
||
#print result | ||
pp = PrettyPrinter(indent=4) | ||
pp.pprint(result) | ||
print "ERR_MSG: ", result["EXECUTED"][0]["ERR_MSG"] | ||
print "EV_STATUS: ", result["EV_STATUS"] | ||
print "LOGID: ", result["LOGID"]["LOGID"] | ||
|