cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to access template objects from list

Former Member
0 Kudos

Hi,

I have a problem -

I have a class where I am accessing all the templates created by a user. I have been able to find the code to filter the templates but I am not able to make use of this list to fetch other data of the document. Below is part of the code that I have used to filter -

com.sapmarkets.isa.businessobject.order.OrderStatus orderList = bom.getOrderStatus();

if(orderList == null)

orderList = bom.createOrderStatus(new OrderDataContainer());

/* .... some more code ...*/

orderList.readOrderHeaders(user, shop, filter);

/*After this I try to access data but not able to do so */

log.error("orderList attributes Count[" + orderList.getOrderCount() + "]"); /*gives correct count */

log.error("Header ChangedAt is [" + orderList.getOrder().getHeaderData().getChangedAt() + "]"); // gives null

Please help me trying to find what needs to be done to access data from this orderList object.

Thanks

Roopali

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

First: what version of ISA do you use?

In version 4, the API of the getOrder() method says:

Method will return an Order / OrderDataContaienr object which has <b>no backend representation</b> nor it is backend aware.

I remember I had a similar problem. I just had to look for other methods to get to the data I needed.

I used the ReflectionToStringBuilder.toString() (from the apache/jakarta commons lang library) to obtain useful debug info, e.g.

log.debug(ReflectionToStringBuilder.toString(orderList));

or

log.debug(ReflectionToStringBuilder.toString(orderList.getOrder()));

Good luck!

Roelof

Former Member
0 Kudos

Hi Roelof,

Thanks for the reply since yes I am using ISA4.0 and I did not go through the doc to see the return condition of getOrder. Unfortunately I might not be able to exactly try using ReflectionToStringBuilder since the jar is not present in my development environment and due to security issues putting it there will take some time.

Since you mention you too had similar problem do you remember how were you able to access the data. Any pointers will be helpful.

Thanks

Former Member
0 Kudos

Hi,

Try methods like:

orderList.getItemList();

orderList.getitemListData();

orderList.getOrderheaderData();

Remeber tot test for null values. If no null is returned, try methods of the returned objects.

Sorry, can't think of anything else now.

Good luck!

Roelof

Answers (0)