Hello Gurus,
I try to create two Objects, PurchaseOrder and PurchaseItem. Each PurchaseOrder has a collection of PurchaseItems. I create a Items array in PurchaseOrder object and fetch the PurchaseOrders and PurchaseItems in fetchPurchaseOrder Bapi.
Then I face issue
com.syclo.sap.mm.steplet.POGetSteplet::throwExceptionToClient::506::POGetSteplet - Two internal tables are neither compatible nor convertible. |
2014 06 25 19:31:44#+0700#ERROR#com.sap.mobile.platform.server.agentry.console##anonymous#Agentry Runtime Worker Thread###Exception: 19:31:44 06/25/2014 : 20 (Agentry3), Java Business Logic Error (com.syclo.agentry.BusinessLogicException: POGetSteplet - Two internal tables are neither compatible nor convertible.),
I dont know the root cause of the error. Is it an error from ABAP code? Or from Agentry Java code?
T
he following is my code in processResult()
@Override
public ArrayList<SAPObject> processResults() throws Exception {
ArrayList<SAPObject> POTab = new ArrayList<SAPObject>();
JCO.Table _POTab = _tables.getTable("ET_PO_HEADER");
int rows = _POTab.getNumRows();
for(int i = 0; i<rows; i++){
_POTab.setRow(i);
PurchaseOrder POrow = new PurchaseOrder(_POTab);
String poNum=POrow.getID();
if (poNum.equals("")) {
continue;
}
ArrayList<PurchaseItem> poItems = getItems(poNum);
POrow.Items = poItems.toArray(POrow.Items);
POTab.add(POrow);
}
return POTab;
}
public ArrayList<PurchaseItem> getItems(String poNum) throws AgentryException {
try {
JCO.Table _purchaseItems = _tables.getTable("ET_PO_ITEMS");
int numItems = _purchaseItems.getNumRows();
ArrayList<PurchaseItem> poItems = new ArrayList<PurchaseItem>(numItems);
for (int i = 0; i < numItems; i++) {
_purchaseItems.setRow(i);
String itemPONum = _purchaseItems.getString("PONUMBER");
if (itemPONum.equalsIgnoreCase(poNum)) {
PurchaseItem item=new PurchaseItem(_purchaseItems);
poItems.add(item);
}
}
return poItems;
}
catch (Exception e) {
user.rethrowException(e, true);
}
return null;
}
Please help me. Thank you very much.