Skip to content

Commit 7cabd4b

Browse files
AlejandroPa-panizza_globant
andauthored
- Fix read of Byte fields in SAP Structures (EnterpriseConnect.java) (#922)
Co-authored-by: a-panizza_globant <a.panizza@globant.com>
1 parent 5ca968c commit 7cabd4b

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

java/src/main/java/com/genexus/sap/EnterpriseConnect.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,20 @@ public void setValue(String parameterName, IGxJSONAble value)
217217
String key = (String)keys.next();
218218
int jcoType = jStruct.getMetaData().getType(key);
219219

220-
if( jObj.get(key) instanceof String )
220+
if (jcoType == JCoMetaData.TYPE_BYTE)
221+
{
222+
if ( jStruct.getMetaData().getLength(key) <= 4)
223+
{
224+
jStruct.setValue(key, jObj.getInt(key));
225+
}
226+
else if ( jStruct.getMetaData().getLength(key) <= 8)
227+
{
228+
jStruct.setValue(key, jObj.getLong(key));
229+
}
230+
else
231+
jStruct.setValue(key, jObj.getString(key).getBytes());
232+
}
233+
else if( jObj.get(key) instanceof String )
221234
{
222235
jStruct.setValue(key, jObj.getString(key));
223236
}

0 commit comments

Comments
 (0)