on 08-10-2007 5:54 PM
Hi,
I would like to use the function getEquipmentStatusCondition to filter mly equipment list.
But, during the process an exception is launch. After debug, i've seen it is at this point (in the UIHelperImpl.java):
if (parent == null) {
---> size = ((BOManager) manager).size(rowdesc, condition);
} else {
size = ((BOManager) manager).size((RowBO) parent, rowdesc, condition);
}
Here is my implementation :
Condition condition = null;
com.sap.mbs.tools.list.ListHeader equipmentListHeader = com.sap.mbs.tools.list.ListParser
.getHeader(MAMViewListControllerInterface.TECHOBJ_EQUIP_HEADER_LIST_ATH);
Mam031QueryBuilder queryBuilder = (Mam031QueryBuilder) naming.lookup(Mam031QueryBuilder.class.getName());
condition = queryBuilder.getEquipmentStatusCondition("STATUS", RelationalOperatorType.SQL_LIKE, "AREC");
setListAttributes(context, equipmentListHeader, condition, null, null, null, "onNavigate");
Could you explain me what's appening ?
Kind Regards
Joseph,
Hello,
getEquipmentStatusCondition gives you a condition on 031Item130 node and you try to execute this upon the 031ItemTOP node.
You should use getEquipmentSimpleCondition to make a condition on the top node. If you want to select the TOP node from its child, you have to build a condition on the child and another condition liking that child to the top node. Refer to MI doc at this point for more complete example.
Thank you,
Julien.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Each SyncBO is composed of nodes: header and child. The node are assembled using foreign key relations.
The header node is called the TOP node and the child node are usually referred as 010, 020, etc. Each node is a table on the device and they have foreign relations to their TOP node.
If you create a query on one of the child node and expect the query to return the TOP node, then it won't work. If you query the TOP node, then you will have a result. When you want the result of a query to be the TOP node but you want to query the child node (your case), you have to follow the relationship child to TOP using the parent key.
I hope I am clear this time!
Thank you,
Julien.
note: getEquipmentStatusCondition is not part of the MI API.
rather it is a MAM specific implementation.
since Item130 (Status) is the child item of SyncBo Mam031, this method
will return a condition for querying Item130 and not the top or header rows.
if you want to query the header, try using getEquipmentSimpleCondition.
regards
jo
Hello,
If I remember correctly there is no such things as join query in MI 7.0 and older. You have to query for all the Status items, then get the parent key for each and query the Equipment TOP for that key to get the equipment itself.
You are better constructing a query with all unique parent key with a OR between them then querying them each after the other.
Thank you,
Julien.
Hello Julien,
I have solved my problem not using queries. The following snippet code show my solution :
ListHeader equipmentListHeader = com.sap.mbs.tools.list.ListParser.getHeader(MAMViewListControllerInterface.TECHOBJ_EQUIP_HEADER_LIST_ATH);
BOList mam031List = mam031Manager.getMam031s();
BOList myOutputList = (BOList) naming.create(BOList.class.getName());
Mam031Impl myEquipment = null;
Mam031Item130Impl equipmentSatus = null;
for (int i = 0; i < mam031List.size(); i++) {
myEquipment = (Mam031Impl) mam031List.get(i);
BOList mam031Item130List = Mam031Manager.getMam031Item130s(myEquipment);
if (mam031Item130List.size() != 0) {
for (int idx = 0; idx < mam031Item130List.size(); idx++) {
equipmentSatus = (Mam031Item130Impl) mam031Item130List.get(idx);
if (equipmentSatus.getInact().equals("") && equipmentSatus.getStatus().equalsIgnoreCase("E0008")) {
myOutputList.add(myEquipment);
}
}
}
}
setListAttributes(context, equipmentListHeader, myOutputList, null, null, "onNavigate");
If you have any suggestion feel free.
I give you points anyway
Kind regards
Joseph
Hi Berthe,
Classes in cam.sap.mbs.mam.bo.query (where all XXXConditions are residing) are internal MAM classes. There is no generic documentation on them except java docs generated in MAM.
They are created by MAM developers for specific MAM processes, naming conventions are as judged by a developer.
So every time you use it you should look in the code or java doc what is one or the other condition is meant for.
If it does not match your spec you can either extend MAM condition classes and add you condition builders or use generic methods from AbstractQueryBuilder (which are used in condition classes as well).
Regards,
Larissa Limarova
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.