Skip to Content

Shopping cart - runtime data

Hi All,

We are using ISA on ECC.

How to obtain shopping cart runtime data?

Like how many items are present in the cart, total value, ...

Suppose we are in product catalog page and add an item to the cart, can we get the current shopping cart data?

Thanks and regards


Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 11, 2008 at 08:03 PM

    Hello Aarthi,

    It is technically possible to always access almost any business object and the related information in any JSP. The UsersessionData object (which is a session context object) is available in all the JSPs. You can get the metaBOM and get any BO from the BOM. See order.jsp for some sample code to get SalesDocumentHeader from usersession --> BOM --> Order BO (Sales document) --> to header.

    You must include appropriate import statements in your JSP. The list below is just an example. Figure out what else you may need.

    <%@ page import="com.sapmarkets.isa.businessobject.*" %>
    <%@ page import="com.sapmarkets.isa.businessobject.item.*" %>
    <%@ page import="com.sapmarkets.isa.businessobject.order.*" %>
    <%@ page import="com.sapmarkets.isa.businessobject.header.*" %>

    The scriptlet below will give you an idea what needs to be done.

    BusinessObjectManager bom = 
      (BusinessObjectManager) userSessionData.getBOM
    salesDoc = bom.getBasket();
    HeaderSalesDocument  header = salesDoc.getHeader();
    ItemList items = salesDoc.getItems();

    From the size of the items you can determine the actual number of items in the cart.

    If you want to know about the Minibasket and how it gets displayed and gets the values (in B2B), see my replies in this

    Easwar Ram

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Easwar Ram,

      I was able to update mini basket value using your approach in order.jsp.

      But when it comes to catalog (ProductsISA.jsp or ProductDetailsISA.jsp) then number of items returned is zero. Is there any other way to get the correct number of items?

      When i say items.size(), its returning correct number of items in order.jsp, but "0" in ProductsISA.jsp or ProductDetailsISA.jsp.

      header.getNetValueWOFreight() is returning the correct price in all the jsps.

      Thanks and regards


Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.