SAP / PyRFC

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

Issue with TIMS data type conversion #336

Closed dbaranasic closed 11 months ago

dbaranasic commented 11 months ago

Describe the bug I am running RFC server with PyRFC. Sometimes, when registered function is triggered I get parse error. From SAP, we are sending the data with structure BAPI_ORDER_HEADER1 to RFC Server.

To Reproduce The error occurs as soon as any of TIMS (time) data type value (for example SCHED_START_TIME) is set to 240000 (24:00:00). If I change the value to 000000, then there is no error.

Screenshots mRemoteNG_ZfaNfUuR0n

Environment

Additional context Tested also with PyRFC 3.1 (in this case there was no error, but also registered function was not called at all)

bsrdjan commented 11 months ago

It is a bug, caused by not passing the date/time handling configuration to server. The standard configuration returns DATE and TIMS ABAP fields as strings. Here the server tries to create the Python datetime object from "240000" and fails. It should just pass the ABAP string as-is, without interpretation. The fix should be available early next week.

bsrdjan commented 11 months ago

Hello @dbaranasic,

new server configuration options are added in release 3.2, so that strict TIMS value check can be disabled. When set to False, like in this example, the Python server will not complain about ABAP TIMS values out of standard range:

server = Server(
    {"dest": "MME_GATEWAY"},
    {"dest": "MME"},
    {"check_time": False, "server_log": True}
)

Could you please test and re-open, if any issues.

dbaranasic commented 11 months ago

@bsrdjan thanks, I will test it out.