Closed potcharapon closed 6 years ago
Please try the node-rfc@next release (1.0.0-rc2) with the fix added. The wrapString
logic worked so far with 3 bytes per unicode character, per string in average. That was obviously not enough in this case and the fix added the fallback to 6 bytes, in case 3 bytes not enough.
The fallback should become active in case when 3 bytes in average are not enough and when the unicode strings fills the full, or almost full length, of ABAP field.
Commit: 23a5e922ca15d72124d3947f8cd7dfa2382198c6
node-rfc@next release (1.0.0-rc2) Test wrapString support thai language
function error.
client.close()
client.ping()
ping()
and close()
are now non-blocking and require a callback function as argument. Thanks for finding this, will add to CHANGES.
Using callback API, you could provide a dummy like ping( () => {} )
, like in unit test examples.
Promise API requires no arguments, as in this unit test, or you could also consider async/await.
As a side note, there are two methods to check if the connection is still alive.
isAlive
getter (unit test) indicates if SAP NW RFC library still "considers" the connection open. It is not absolutely reliable because the firewall may silently have closed the connection, without notifying endpoints.
ping()
is the only absolutely reliable method but also the most expensive (slowest) one, because of the full request/response cycle it has to perform, to check if the connection is really open.
In many cases isAlive
is enough and much faster.
@bsrdjan. Thank you for solve this issue. I try it and woking very well.
Trying to display the customer's name on a webpage by calling BAPI_CUSTOMER_GETDETAIL2. The message saved on the record is
ทดสอบสร้างลูกค้าจากภายนอกครั้งที่ 31 วันที่ 20180821 เวลา 15:38
which then concatenated into parts, 35 char each. i.e.name_1: 'ทดสอบสร้างลูกค้าจากภายนอกครั้งที่ 3'
name_2: '1 วันที่ 20180821 เวลา 15:38'
After the record is saved.Viewing the data via SAP GUI calling BAPI_CUSTOMER_CREATEFROMDATA1 to check. The result is correctly displayed:
CUSTOMERADDRESS.NAME: 'ทดสอบสร้างลูกค้าจากภายนอกครั้งที่ 3'
CUSTOMERADDRESS.NAME_2: '1 วันที่ 20180821 เวลา 15:38'
Then we went back and check the record using the function BAPI_CUSTOMER_GETDETAIL2 the error occurs:
CUSTOMERADDRESS.NAME: 'node-rfc internal error: wrapString'
CUSTOMERADDRESS.NAME_2: '1 วันที่ 20180821 เวลา 15:38'
Example
From SAP GUI
From node-rfc
File
sapRFC.js
model_sap.js