Skip to Content
avatar image
Former Member

Adding an item in Basket

Hi,

I'm currently using ISA 4.0 SP10 with R/3 as a backend. I wrote a custom basket refresh class and in it I need to write a function that will add an item to the current basket. I did something like this:

ItemData myitem = basket.createItem();

myitem.setProduct("01-102");

myitem.setQuantity("10");

..

..

itemList.add(myitem);

Once I run the function it seems to work (whereby it adds an item to the current itemList) but then the webpage remains blank and I get a java.null.pointer in my log file.

java.lang.NullPointerException

at com.sapmarkets.isa.catalog.impl.CatalogQueryStatement.getName(CatalogQueryStatement.java:182)

Let me know if you have any suggestions. Thanks!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    May 04, 2006 at 02:16 PM

    You should try and find where the exception is being thrown... put some "try and catch" statements in CatalogQueryStatement.java? I'm assuming that the function getName() is accessing a reference to an object that is set to null.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 04, 2006 at 02:23 PM

    I think I found the problem.

    If I don't put this:

    myitem.setUnit("EA");

    ...then I get the error. I don't know why thats neccesary to set if it gets overwritten anyway once the product is updated from the Catalog. Strange.

    Add comment
    10|10000 characters needed characters exceeded