From 7cabd4b46dd80322ce2a89dc6a71da1320d481e6 Mon Sep 17 00:00:00 2001 From: Alejandro Panizza Carve Date: Thu, 12 Dec 2024 16:26:38 -0300 Subject: [PATCH] - Fix read of Byte fields in SAP Structures (EnterpriseConnect.java) (#922) Co-authored-by: a-panizza_globant --- .../java/com/genexus/sap/EnterpriseConnect.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/java/src/main/java/com/genexus/sap/EnterpriseConnect.java b/java/src/main/java/com/genexus/sap/EnterpriseConnect.java index 0c1aec521..fb4815b46 100644 --- a/java/src/main/java/com/genexus/sap/EnterpriseConnect.java +++ b/java/src/main/java/com/genexus/sap/EnterpriseConnect.java @@ -217,7 +217,20 @@ public void setValue(String parameterName, IGxJSONAble value) String key = (String)keys.next(); int jcoType = jStruct.getMetaData().getType(key); - if( jObj.get(key) instanceof String ) + if (jcoType == JCoMetaData.TYPE_BYTE) + { + if ( jStruct.getMetaData().getLength(key) <= 4) + { + jStruct.setValue(key, jObj.getInt(key)); + } + else if ( jStruct.getMetaData().getLength(key) <= 8) + { + jStruct.setValue(key, jObj.getLong(key)); + } + else + jStruct.setValue(key, jObj.getString(key).getBytes()); + } + else if( jObj.get(key) instanceof String ) { jStruct.setValue(key, jObj.getString(key)); }