cancel
Showing results for 
Search instead for 
Did you mean: 

Stock transfer setBaseType Problem

Former Member
0 Kudos

Hi,

I require that my application store stock transfer based on a stock transfer request. But when the code tries to assign a value to getLines () method. SetBaseType (...) I get an error java virtual machine.

int typeSolicitud = SBOCOMConstants.BoObjectTypes_StockTransfer_oInventoryTransferRequest;
Documents drafts = (Documents) SBOCOMUtil.newDocuments(company, typeSolicitud);

drafts.getByKey(52016);//Id inventory transfer request
IStockTransfer_Lines stLines = st.getLines();

Document_Lines lines = (Document_Lines) drafts.getLines();
for(int i = 0; i < lines.getCount(); i++){
lines.setCurrentLine(i);

if( lines.getRemainingOpenQuantity() != null && lines.getRemainingOpenQuantity() > 0){
st.getLines().setBaseLine(lines.getLineNum());
st.getLines().setBaseEntry(lines.getDocEntry());

st.getLines().setItemCode(lines.getItemCode());
st.getLines().setFromWarehouseCode("CD01");
st.getLines().setWarehouseCode("TRAS_COL");
st.getLines().setQuantity(lines.getQuantity());

st.getLines().setBaseType(typeSolicitud);//Here the ERROR!!!
st.getLines().add();
}
}

st.setCardCode(drafts.getCardCode());
st.setDocDate(new Date());
st.setDueDate(new Date());
st.setFromWarehouse("TRAS_COL");
st.setToWarehouse("SD01");
st.setComments("Prueba 2");
st.setJournalMemo("Prueba");
int add = st.add();

And this is the error message:

#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00ec1830, pid=11524, tid=0x00002f10
#
# JRE version: Java(TM) SE Runtime Environment (8.0_101-b13) (build 1.8.0_101-b13)
# Java VM: Java HotSpot(TM) Client VM (25.101-b13 mixed mode, sharing windows-x86 )
# Problematic frame:
# C [sbojni.dll+0x1830]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\jgutierrez.ELVOLCAN\Google Drive\Proyectos\VOLCAN\PruebaJCO\hs_err_pid11524.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Java Result: 1

My environment:

Windows 7 64bit

Java 1.8.0_101 32bit

Netbeans 7.4

.jars from C:\Program Files (x86)\SAP\SAP Business One DI API\JCO\LIB\

Sap Business One 9.0

Regards.

Accepted Solutions (0)

Answers (0)