Skip to content

Commit

Permalink
add all files
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaohui Zhang committed Mar 7, 2017
0 parents commit a4d936f
Show file tree
Hide file tree
Showing 19 changed files with 71 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Dockerfile
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"]
9 changes: 9 additions & 0 deletions README.md
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 added libs/libicudata.so.34
Binary file not shown.
Binary file added libs/libicudecnumber.so
Binary file not shown.
Binary file added libs/libicui18n.so.34
Binary file not shown.
Binary file added libs/libicuuc.so.34
Binary file not shown.
Binary file added libs/libsapnwrfc.so
Binary file not shown.
Binary file added libs/libsapucum.so
Binary file not shown.
11 changes: 11 additions & 0 deletions pyrfc/dev_rfc.trc
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 added pyrfc/pyrfc-1.9.3-py2.7-linux-x86_64.egg
Binary file not shown.
Binary file added pyrfc/pyrfc-1.9.4-py2.6-linux-x86_64.egg
Binary file not shown.
Binary file added pyrfc/pyrfc-1.9.4-py2.7-linux-x86_64.egg
Binary file not shown.
Binary file added pyrfc/pyrfc-1.9.4-py3.4-linux-x86_64.egg
Binary file not shown.
Binary file added pyrfc/pyrfc-1.9.5-cp27-cp27mu-linux_x86_64.whl
Binary file not shown.
Binary file added pyrfc/pyrfc-1.9.5-cp35-cp35m-linux_x86_64.whl
Binary file not shown.
Binary file added pyrfc/pyrfc-1.9.5-py2.7-linux-x86_64.egg
Binary file not shown.
Binary file added pyrfc/pyrfc-1.9.5-py3.5-linux-x86_64.egg
Binary file not shown.
1 change: 1 addition & 0 deletions scripts/pythondemo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print "100 + 200 = ", 100+200
35 changes: 35 additions & 0 deletions scripts/pythonscript.py
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"]

0 comments on commit a4d936f

Please sign in to comment.