Skip to content

Commit

Permalink
Merge 1.9.8 release
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrdjan committed Nov 26, 2017
2 parents 3eb41a2 + e027ca9 commit 7b4601e
Show file tree
Hide file tree
Showing 15 changed files with 62 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Change log
==========

1.9.8
-----
- Fix array fill
- Fix float values handling

1.9.7
-----
- Cython 0.27.3
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.9.7
1.9.8
Binary file modified dist/pyrfc-1.9.7-cp27-cp27m-win_amd64.whl
Binary file not shown.
Binary file modified dist/pyrfc-1.9.7-cp27-cp27mu-linux_x86_64.whl
Binary file not shown.
Binary file modified dist/pyrfc-1.9.7-cp36-cp36m-linux_x86_64.whl
Binary file not shown.
Binary file modified dist/pyrfc-1.9.7-cp36-cp36m-win_amd64.whl
Binary file not shown.
Binary file added dist/pyrfc-1.9.8-cp27-cp27m-win_amd64.whl
Binary file not shown.
Binary file added dist/pyrfc-1.9.8-cp27-cp27mu-linux_x86_64.whl
Binary file not shown.
Binary file added dist/pyrfc-1.9.8-cp36-cp36m-linux_x86_64.whl
Binary file not shown.
Binary file added dist/pyrfc-1.9.8-cp36-cp36m-win_amd64.whl
Binary file not shown.
47 changes: 47 additions & 0 deletions material/issue38.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
connection_info = {
'user': 'demo',
'passwd': 'Welcome',
'ashost': '10.117.19.101',
'saprouter': '/H/203.13.155.17/W/xjkb3d/H/172.19.138.120/H/',
'sysnr': '00',
'lang': 'EN',
'client': '100',
'sysid': 'S16'
}

import datetime

from pyrfc import *

conn = Connection(**connection_info)

float_value1 = 1.23456789
float_value2 = 9.87

i = 1

fv = float_value2
if i != 2:
imp = dict(RFCFLOAT=fv,
RFCINT2=0x7ffe, RFCINT1=0x7f,
RFCCHAR4=u'bcde', RFCINT4=0x7ffffffe,
RFCHEX3=str.encode('fgh'),
RFCCHAR1=u'a', RFCCHAR2=u'ij',
RFCTIME='123456', #datetime.time(12,34,56),
RFCDATE='20161231', #datetime.date(2011,10,17),
RFCDATA1=u'k'*50, RFCDATA2=u'l'*50
)
print 'rfc'
result = conn.call('STFC_STRUCTURE', IMPORTSTRUCT=imp, RFCTABLE=[imp])
print (fv, result['ECHOSTRUCT']['RFCFLOAT'])


if i == 2:
print 'coe'

#imp = dict(ZACCP='196602', ZCHAR='ABC', ZCLNT='000', ZCURR=0, ZDATS='', ZDEC=0, ZFLTP=fv, ZSHLP_MAT1='ELIAS')
imp = dict(ZACCP='196602', ZCHAR='ABC', ZCLNT='620', ZCURR=0, ZDEC=0, ZDATS='19570321', ZFLTP=fv)

result = conn.call('/COE/RBP_FE_DATATYPES', IV_COUNT=0, IS_INPUT=imp) # ['ES_OUTPUT']
print (fv, result['ES_OUTPUT']['ZFLTP'])

3 changes: 3 additions & 0 deletions material/reload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pip uninstall -y pyrfc
python setup.py bdist_wheel
pip install dist/pyrfc-1.9.8-cp27-cp27m-win_amd64.whl
File renamed without changes.
11 changes: 5 additions & 6 deletions src/pyrfc/_pyrfc.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1630,8 +1630,7 @@ cdef fillTable(RFC_TYPE_DESC_HANDLE typeDesc, RFC_TABLE_HANDLE container, lines)
for name, value in line.iteritems():
fillStructureField(typeDesc, lineHandle, name, value)
else:
for value in line:
fillStructureField(typeDesc, lineHandle, '', value)
fillStructureField(typeDesc, lineHandle, '', line)

cdef fillVariable(RFCTYPE typ, RFC_FUNCTION_HANDLE container, SAP_UC* cName, value, RFC_TYPE_DESC_HANDLE typeDesc):
cdef RFC_RC rc
Expand Down Expand Up @@ -1673,11 +1672,11 @@ cdef fillVariable(RFCTYPE typ, RFC_FUNCTION_HANDLE container, SAP_UC* cName, val
rc = RfcSetNum(container, cName, cValue, strlenU(cValue), &errorInfo)
free(cValue)
elif typ == RFCTYPE_BCD:
cValue = fillString(str(value)) # cast to string; works for float and Decimal
rc = RfcSetString(container, cName, cValue, strlenU(cValue), &errorInfo)
free(cValue)
#cValue = fillString(str(value)) # cast to string; works for float and Decimal
#rc = RfcSetString(container, cName, cValue, strlenU(cValue), &errorInfo)
#free(cValue)
# Setting the value if passed as float.
#rc = RfcSetFloat(container, cName, value, &errorInfo)
rc = RFC_OK # RfcSetFloat(container, cName, value, &errorInfo)
elif typ == RFCTYPE_FLOAT:
rc = RfcSetFloat(container, cName, value, &errorInfo)
elif typ in (RFCTYPE_INT, RFCTYPE_INT1, RFCTYPE_INT2):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_issue38(self):
]

for s in test:
is_input = {'ZSHLP_MAT1': s}
is_input = {'ZSHLP_MAT1': s, 'ZFLTP': 123.45}
result = self.conn.call('/COE/RBP_FE_DATATYPES', IS_INPUT = is_input)['ES_OUTPUT']
assert is_input['ZSHLP_MAT1'] == result['ZSHLP_MAT1']

Expand Down

0 comments on commit 7b4601e

Please sign in to comment.