-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CHARnn fields gets cut off after the first zero byte #193
Comments
Which SAP NWRFC SDK release is used? Did it work before, with older SDK release? |
No, this never worked for us with node-rfc, we just thought there was a bug in our code that caused the FM to behave differently when called from our two apps - we were literally looking in all the wrong places before we stumbled on this issue. |
The bug was caused by casting SDK CHAR fields to c-strings, before conversion to node strings. CHAR strings containing zero bytes in-between were therefore terminated after the first zero byte found from left. It is now fixed in main branch b4aeaf9, by using std::strings: nwrfcsdk.cc#L421 instead. You can build the main branch from source or use this pre-built and tested Windows binary, with this fix included: node-rfc-v2.3.1-napi-v7-win32-x64.tar.gz The fix does not work with PL7 and will be included in next node-rfc release, soon after the SDK PL8 shipped. After the fix d7f516b, NodeJS strings sent to ABAP CHARnn fields are not terminated after the first zero byte. ABAP statements expecting unicode strings, might not work as expected with such strings. |
Thanks for the fast turnaround! We're not yet on the latest node-rfc version (why does an rfc client need |
The 2.4.0 release with the fix is published, feel free to test. There is no public release plan for PL8 but I expect the release dynamic similar to past years.
Here more info on connector applications authorisations: https://launchpad.support.sap.com/#/notes/460089 |
Apparently fixed, please re-open if needed. |
We're currently experiencing a problem with getting data from a search help.
RECORD_TAB
result entries are defined asCHAR3000
and may contain non-printable characters, the data we are looking for at the moment is placed after those characters.client.invoke
, the string is truncated before the non-printable characters, so we have no access to the part of the data we needWe cannot find any restrictions on ABAP type c, other than UCS-2, neither the Java nor the C connector seem to have problems with this data, and JS can handle non-printable characters in strings just fine, so we think this may be a bug in node-rfc, somewhere between C connector and JS.
The search help is non-standard, so we do not have a reproducable example. Below is a sample entry, as copied from the SAPNWRFC trace (passed through
od -v -t x1z
): the value we get from node-rfc is truncated afterTESTUSER3
, which when trimmed is the last text before the non-printable characters00 00 00 0c
; the data we need would be the1000329
, which would be the the first text after the non-printable characters.That corresponds to what we see in the ABAP debugger for this field around the non-printable characters:

The text was updated successfully, but these errors were encountered: