SAP / PyRFC

Asynchronous, non-blocking SAP NW RFC SDK bindings for Python
http://sap.github.io/PyRFC
Apache License 2.0
510 stars 137 forks source link

Error after adding tables #144

Closed li2575250 closed 4 years ago

li2575250 commented 4 years ago

Error after adding tables T_BUKRS type is table

>>> d = [{'BUKRS':'1270'}]
>>> result = conn.call('ZFI_ACCOUNT_STATEMENT_RFC', 'I_FDATE'='20190101', 'I_TDATE'='20190701', 'I_RFC'='RFC',T_BUKRS=d)
  File "<stdin>", line 1
SyntaxError: keyword can't be an expression

Ask everybody elder brother to help have a look. tks...

bsrdjan commented 4 years ago

SyntaxError: keyword can't be an expression indicates a syntax error in your python script -> quotes around T_BUKRS

li2575250 commented 4 years ago

I tried many times... Adding quotes is still an error

>>> from pyrfc import Connection
>>> conn = Connection(ashost='xxxxx', sysnr='00', client='290', user='xxxxx', passwd='xxxxx')
>>> d = [{'BUKRS':'1270'}]
>>> result = conn.call('ZFI_ACCOUNT_STATEMENT_RFC', 'I_FDATE'='20190101', 'I_TDATE'='20190701', 'I_RFC'='RFC','T_BUKRS'=d)
  File "<stdin>", line 1
SyntaxError: keyword can't be an expression

pyrfc version (1.9.93)

bsrdjan commented 4 years ago

Connection call arguments are keyword arguments, quotes not needed. Please check the documentation: http://sap.github.io/PyRFC/client.html

li2575250 commented 4 years ago

I use the following code is no problem, it is very annoying

imp = dict(I_GJAHR='2019',I_F_MONAT='01', I_T_MONAT='12', I_RFC='RFC')
result = conn.call('ZFI_ZFI159_RFC', **imp,T_BUKRS=[{'BUKRS':'1030'}],T_LIFNR=[{'LIFNR':'1030'}])

Thank you very much for your answer Thanks♪(・ω・)ノ