Skip to content

Commit

Permalink
- Fix read of Byte fields in SAP Structures (EnterpriseConnect.java) (#…
Browse files Browse the repository at this point in the history
…922)

Co-authored-by: a-panizza_globant <[email protected]>
  • Loading branch information
AlejandroP and a-panizza_globant authored Dec 12, 2024
1 parent 5ca968c commit 7cabd4b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion java/src/main/java/com/genexus/sap/EnterpriseConnect.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit 7cabd4b

Please sign in to comment.