SAP Changes to RFC_READ_TABLE affecting NLINK SAP Query Connector

Background

SAP recently made some changes to RFC_READ_TABLE that affect the NLINK SAP Query Connector. The problems manifest silently, in that you will not see errors in the NLINK Management Module. Depending on your configuration, you may see unexpected empty results from queries to the SAP system.

Diagnosis

The problem occurs if SAP Note 2246160 has been implemented in your SAP system and the NLINK SAP Query Connector returns any packed or decimal fields. Unfortunately, all quantities and currency amounts in SAP are packed fields, so it is a likely situation.

The SAP Note is included in various Support Packages dating from about October 2021:

https://junotsystems.atlassian.net/wiki/spaces/NLINK/pages/2388819982

Depending on your current version of the NLINK Server, you may find specific error messages such as the following in a file called NLINK Trace.log in the Logs folder.

Could not extract value for from SAP result data for 'EBAN' Code '23': Group '5': Key 'RFC_BUFFER_TOO_SMALL': Message 'value with the type RFCTYPE_CHAR does not fit into given buffer with the length 347 required buffer length 351': abapMsgClass '': abapMsgType '': abapMsgNumber '22146750': V1 '': V2 '': V3 '': V4 ''

Resolution

Implement at least one of the following options.

This version has code changes to the NLINK SAP Query Connector that can handle the existing RFC_READ_TABLE or the new RFC_READ_TABLE with no changes needed to config or other settings.

The new RFC_READ_TABLE also throws some new errors, including OPTION_NOT_VALID if you include the client field (MANDT) as criteria, or SAPSQL_DATA_LOSS if you send data that is longer than its defined field length in SAP as criteria. The most common problem here is sending a two-character language code when SAP expects a single-character code.

Consider Using a Customized Copy of RFC_READ_TABLE

In many cases our customers already use a customized copy of RFC_READ_TABLE, generally to apply stricter security settings. If you are already doing this, changes from this or future SAP Support Packages would not affect your custom function module.

Reference

https://launchpad.support.sap.com/#/notes/2246160