on 2014 Jun 25 1:42 PM
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.
Looking at the error messageit looks like exception is thrown on the SAP side. One of the posssible reason is that in the BAPI Output table reference for PO header or PO items and internal table referenced within the class handler for PO object are not the same. One could be structure and another could be an internal table.
Options to troubleshoot further.
1) By putting break in your class handler on SAP side.
2) Turn on detailed logging on SMP Server.
3) Check for short dumps on SAP side
Thanks
Manju - SAP CEG
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Manju,
Thank you very much for your quick reply.
The abap code runs well and results in two tables with data of POs and Items on SAP. Is there any posibility that the bapi runs correctly but still throws exception to Agentry clients?
notes: i didnt write the abap code and dont know anything about how to write ít. However, i saw my mate excute the bapi successfully and generate data.
by the way, please let me know how to turn on the detail log in smp3.0. Thank you very much.
User | Count |
---|---|
82 | |
12 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.