From 98cc68ddea54188d718f6db07d82209a32b1234f Mon Sep 17 00:00:00 2001 From: a-panizza_globant Date: Wed, 11 Dec 2024 16:35:31 -0300 Subject: [PATCH] - Fix read of Byte fields in SAP Structures (EnterpriseConnect.java) --- .../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)); }