Skip to content

Commit 76794d9

Browse files
authored
Merge branch 'master' into Issue-108639-WEB-request-tabId
2 parents 093c136 + 0a3be17 commit 76794d9

File tree

3 files changed

+29
-13
lines changed

3 files changed

+29
-13
lines changed

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

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ public class EnterpriseConnect
3333

3434
public EnterpriseConnect(ModelContext context)
3535
{
36-
Object destination = context.getContextProperty("SAPSessionName");
37-
if (destination !=null)
38-
{
39-
destinationName = (String)destination;
36+
if (context !=null) {
37+
Object destination = context.getContextProperty("SAPSessionName");
38+
if (destination !=null)
39+
{
40+
destinationName = (String)destination;
41+
}
4042
}
4143
}
4244

@@ -171,8 +173,11 @@ else if (jcoType == JCoMetaData.TYPE_DATE)
171173
{
172174
jTable.setValue(key, jObj.getString(key));
173175
}
174-
else if (jcoType == JCoMetaData.TYPE_INT2 || jcoType == JCoMetaData.TYPE_INT1
175-
|| jcoType == JCoMetaData.TYPE_BYTE)
176+
else if (jcoType == JCoMetaData.TYPE_BYTE)
177+
{
178+
jTable.setValue(key, jObj.getString(key));
179+
}
180+
else if (jcoType == JCoMetaData.TYPE_INT2 || jcoType == JCoMetaData.TYPE_INT1)
176181
{
177182
jTable.setValue(key, jObj.getInt(key));
178183
}
@@ -228,8 +233,11 @@ else if (jcoType == JCoMetaData.TYPE_DATE)
228233
{
229234
jStruct.setValue(key, jObj.getString(key));
230235
}
231-
else if (jcoType == JCoMetaData.TYPE_INT2 || jcoType == JCoMetaData.TYPE_INT1
232-
|| jcoType == JCoMetaData.TYPE_BYTE)
236+
else if (jcoType == JCoMetaData.TYPE_BYTE)
237+
{
238+
jStruct.setValue(key, jObj.getString(key));
239+
}
240+
else if (jcoType == JCoMetaData.TYPE_INT2 || jcoType == JCoMetaData.TYPE_INT1)
233241
{
234242
jStruct.setValue(key, jObj.getInt(key));
235243
}
@@ -275,8 +283,11 @@ public void getValue(String parameterName, GXSimpleCollection<?>[] value)
275283
{
276284
jRow.put(field.getName(), field.getLong());
277285
}
278-
else if (field.getType() == JCoMetaData.TYPE_INT2 || field.getType() == JCoMetaData.TYPE_INT1
279-
|| field.getType() == JCoMetaData.TYPE_BYTE )
286+
else if (field.getType() == JCoMetaData.TYPE_BYTE )
287+
{
288+
jRow.put(field.getName(), new String(field.getByteArray()));
289+
}
290+
else if (field.getType() == JCoMetaData.TYPE_INT2 || field.getType() == JCoMetaData.TYPE_INT1)
280291
{
281292
jRow.put(field.getName(), field.getInt());
282293
}
@@ -340,6 +351,11 @@ public void getValue(String parameterName, java.util.Date[] value)
340351
value[0] = function.getExportParameterList().getDate(parameterName);
341352
}
342353

354+
public void getValue(String parameterName, byte[] value)
355+
{
356+
value[0] = function.getExportParameterList().getByte(parameterName);
357+
}
358+
343359
public void getValue(String parameterName, int[] value)
344360
{
345361
value[0] = function.getExportParameterList().getInt(parameterName);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public void TransactionBegin()
156156
scopeName = String.valueOf( scopeObj);
157157
Log.info("GX SAP - Begin Transaction " + destinationName);
158158
JCoDestination destination = null;
159-
if (scopeName.isEmpty())
159+
if (scopeName.isEmpty() || scopeName.equals("null"))
160160
destination = JCoDestinationManager.getDestination(destinationName);
161161
else
162162
destination = JCoDestinationManager.getDestination(destinationName, scopeName);
@@ -182,7 +182,7 @@ public void TransactionCommit()
182182
JCoDestination destination = null;
183183
destinationName = (String)destinationObj;
184184
scopeName = String.valueOf(scopeObject);
185-
if ( scopeName.isEmpty() ) {
185+
if ( scopeName.isEmpty() || scopeName.equals("null") ) {
186186
destination = JCoDestinationManager.getDestination(destinationName);
187187
}
188188
else {

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<url>https://github.com/genexuslabs/JavaClasses</url>
1515

1616
<properties>
17-
<revision>4.6</revision>
17+
<revision>4.7</revision>
1818
<changelist>-SNAPSHOT</changelist>
1919
<sha1/>
2020

0 commit comments

Comments
 (0)