on 09-12-2011 4:53 PM
Hi,
I am using ESO 5.1 and I need a script to create an auction from external data (XML) and vice versa: read auction data and create XML from it. For the second task, I'd like to use a Toolbar script. This is always called on Auctions (doc is an Auction).
I have the following problem: I can reach the "single" fields of the auction but I can not reach the collection members.
I use the following code:
1st version - lst is always null
CollectionIfc lst = doc.getExtensionCollection("COLLN:1:802"); // should contain auction line items
2nd version - lst is not null but contain only nulls
StringBuffer str = new StringBuffer();
CollectionIfc lst = doc.getCollectionMetadata("COLLN:1:802").get(doc); // should contain auction line items
for(int i = 0; i < lst.size(); i++) {
str.append("Line item:" + lst.get(i)); // lst.get(i) is always null
}
I tried all class collection names found in documentation - with no result.
Could you write me how to reach collection members?
Hi,
Standard collections can be accessed by their respective/specific accessor methods(e.g getLineItems()). Don't think the generic accessor methods would work for standard collections .
E.g in case of RFX/Contract you would have a getLineItems() method. It looks like Auction doesn't have an API to enable accesing the line item collection. You may have to request SAP for that.
In general, if you have access to a collection, all you have to do is get the iteratort. e.g. getLineItems.iterator() and use the hasNext(), next() methods to get its members
Thanks,
Baski
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Baski,
thanks for your answer.
According to the Class documentation, Auction class contains - among others - the following class collections:
COLLN:1:802 - subordinate - contains doc.auction.lineitems
COLLN:3:810 - associative - containing auction.bidders
etc.
So you mean, there is NO way to read and set these collections using API calls?
thanks again,
Gabor
User | Count |
---|---|
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.