Can't remove line item...

I can successfully add products to my shopping cart. The problem is that I cannot remove them. My app consists of 2 beans and 2 jsp pages. One bean is just a setter/getter for a product (not show). The shopping cart bean is here:
package shoppingcart;
import java.util.ArrayList;
import java.util.Iterator;
import javax.servlet.*;
import javax.servlet.http.*;
public class CartBean extends HttpServlet {
private ArrayList items = new ArrayList();
public void addItem(OrderItem o) {
     items.add(o);
public void removeItem(OrderItem o) {
     items.remove(o);
public Iterator getContents() {
     System.out.println(items.size());
     return items.iterator();
}The product page (not shown) just sends a value for 'product' over to the shopping cart. With the code here, I get a variable o unknown.
<%@ page import="shoppingcart.OrderItem" %>
<%@ page import="shoppingcart.CartBean" %>
<jsp:useBean id="cart" class="shoppingcart.CartBean" scope="session"/>
<%
String action= request.getParameter("Action");
%>
<%
if (action.equals("addtocart")) {
String product = (String)request.getParameter("product");
System.out.println(product);
OrderItem o = new OrderItem();
o.setProduct(product);
cart.addItem(o);
if (action.equals("Remove"))
cart.removeItem(o);
%>
<%
     Iterator contents = cart.getContents();
     if (!contents.hasNext()) {
     out.println("<tr><td height=50><center>" + "You have no items to checkout" + "</center></td></tr>" );
     else {
     while (contents.hasNext()) {
     OrderItem o = (OrderItem)contents.next();
     %>
                      <tr class="text">
                        <td class="text"><%=o.getProduct() %> </td>
<td align="center"><input name="Action" type="submit" value="Remove"></td>
...Any suggestions on how I can remove an line item at a time?? Thanks!

If you upgrade a capex planning application through the upgrade wizard then the "Line Item" dimension will remain the same name, if you create a new application  then it will use the new options.
Cheers
John
http://john-goodwin.blogspot.com/

Similar Messages

  • Removing line item dimention from info cube

    Hi All Experts,
    Early watch report has suggested us to remove line item dimention and high cardinality from some cubes.
    bur our cubes are having data , and when I tried to chekc this in our Dev server, Line Item dimention is disabled when it is filled with data.
    but when I delete data from Cube, Line item diemention check box gets enabled.
    so does it mean that we can not flag or remove line item dimention form cube if contains data,
    and in mine case I  have to delete all data from cube and then trensport it to PRD after deleting data from Cube and reload after transport.
    Am I correct.
    Please advice If I am wrong.

    Hi,
    yes, you are correct. You have to delete the content of the cube before you can change a line item dim. to a 'normal' dimension. As a workaround you might use a copy of the cube, create and/or copy all update rules to the new cube, and create a new update rule from the old to the new cube. Transport everything to prod, then load you new cube from the old cube and do all the other load as before. Move/copy your queries from the old cube to the new cube as well.
    regards
    Siggi

  • Removing line item dimension

    Dear All,
    I have encountered a problem after I removed line item dimension flag from the dimension properties and added new characteristics to that dimension.
    When I checked the data in the cube, I was surprising to find the old characteristic (that was the only char. in the dimension previously) having irrelevant values.
    Now I can understand that there was no dimension table before removing the flag. And the new dimension table leaded to wrong matching between fact table and SID table.
    Can you suggest any solution to make the correct matching between the fact table and SID table ?
    thanks in advance..
    regards,
    berna

    Try performing the RSRV Tests.
    Go to tcode: RSRV and perform the following tests:
    All Combined Tests --> Transaction Data --> Foreign Key Relationship Between Dimension(s) and SID Tables for the Associated Characteristics
    All Combined Tests --> Transaction Data --> Fact and Dimension Tables of an InfoCube
    Cheers,
    Neel.

  • Re-Filling Dimension table, after removing line-item property

    Hi Friends,
    We need to remove line item property of a line item dimension of an infocube. I made that change and activated the cube. But when i check the dimension table of this dimension, i see no records regarding this.
    This cube has 60 mil. records, so we can not delete the content and reload it.
    Do you guys know anyway to fill that dimension table with the existent data in the cube ?
    Thanks & Regards
    S.P.

    Hi Suresh,
    I didn't delete the content of the cube but was able to remove checkmark of line-item dimension. Cube was activated successfuly. But the problem is that there in no data in this newly created dimension table..
    Regards
    S.P.

  • To remove line items from invoice which have 0 qty.

    Dear Friends,
    Requirement: To remove line items from invoice which have 0 qty.
    For this I wrote the code in RV60AFZZ. It is very well happening, but when last line item comes it is failing.
    What I have written is " DELETE XVBRP WHERE FKIMG = '0' ." . This code is deleting all the line items with 0 qty except last line item.
    Actually, this exit works line item wise. Once the line item is appended, the code what I have written is working. For the last line item, record is not appended when this exit is triggerred, thats why last record is not deleted.
    The include where all line items are getting appended in XVBRP is LV60AB03. I modified this also. Same code I have written here to delete the records once it is appended. But after doing this the problem is - invoice is not getting created.
    Please help me in doing this so as to delete this last record also. I tried with other logics also, not able to track the last record.
    Please help me to resolve this problem.
    Thanks.

    Hi,
    Check user exit RV60AFZC.
    RV_INVOICE_DOCUMENT_ADD is the FM which is called to generate number for the invoice after all the line items have been added to vbrp structure. Add a break-point here and check.
    All the best.
    Regards,
    Amit

  • What is line item datas,how can u check line item in Infocube?

    Hi friends,
    what is line item datas,how can u check line item in Infocube?

    hi konda,
    line item data
    i shall give u an example .
    consider a super market bill,
    the bill has 1.customer name        2. bill number   3. date of purchase
    the above line will be header.
    line item data are the items which u purchase.
    item 1 pencil  2 rubber  3. sharpner  4. cryon  5. sketch pens
    above are line item datas.  for a particular set of header data u may have many line item datas.
    reward points if helpful.
    bye.

  • Can sales order line item text be replicated into production order

    Hi
    Can sales order line item text be replicated to production order through standard PP configuration? If so how can it be done?
    If that is not possible through standard configuration then can it be possible to read both sales order line item information and production order information using a BAPI or a program?
    Please help me, i have been trying hard for this and also searches sdn for relevant posts but could not find any, I thank all people who can help me with some information on this.
    Regards,
    Jessica

    Sample code:
    DATA:
      wa_order_objects    TYPE bapi_pp_order_objects.
    DATA:
      it_order_header     TYPE STANDARD TABLE OF bapi_order_header1.
    *--Setting Flag to get details of BAPI
      wa_order_objects-header         = c_x.
      CALL FUNCTION 'BAPI_PRODORD_GET_DETAIL'
        EXPORTING
          number           =  "Order number"
          order_objects    = wa_order_objects
        TABLES
          header           = it_order_header.

  • How can i restrict line items in check printing.

    I am printing a check and its invoice details(Item details) alos in the same page.How it look means frst check part
    will print and in the main window i am printing item details. Up to this part it is working fine. But in case of these item details if more than 10  line items are there it should print on second page.can any one help what is the code to solve  this issue and where i have to write the code.

    Hi,
             We can write an if condition in the text element of the Main window for this..
             Put a counter....if a counter reaches 10..call the NEW-PAGE command..
              if counter > 10.
                NEW-PAGE.
                counter = 0.
              endif.

  • Can't modify line item text in financial document

    Dear all,
    In some cases I'm not able to modify line item text field in financial documents, and I don't know why.
    I've checked customizing and BSEG-SGTXT appears as modificable field in any case.
    As far as i know text field is not a relevant field, so the system should let me modify it if the customizing is right.
    Does anyone know if there could be any other customizing that affects this transaction (FB02)?
    Thanks

    Hi
    Since you indicated the entry is from goods receipt, I understand that you are trying to change the line item text in a GL line item.
    If so, please ensure the following:
    1. in OB32, for Account type S and Field name BSEG-SGTXT, the trasaction type is blank, "Field can be changed" is ticked and "Posting period not closed" and "Line item not cleared" are not ticked. 
    2. In OB32, for Account type S and field name BSEG-SGTXT, no other entry is there along with company code which has a different rule.
    3. You can enough authorization to change the document.
    4. If you can change the text, but cannot save it, then please check whether any validation/BTE is in place which is not allowing to do so.
    Regards

  • F-32 ( User Exit / BTE ) Remove line items depending on condition

    Hi Gurus,
    When i run F-32 transaction, before the line items are displayed  I need to remove certain line items depending on some condition.
    Is there any user exit or BTE to do that ?
    Avi

    Hi,
    Try any of the below,
    Customer-exit
    SAPLF051
    RFKORIEX
    RFEPOS00
    RFAVIS01
    FEDI0001
    FARC0002
    F180A001
    F050S001
    F050S002
    F050S003
    F050S004
    F050S005
    F050S006
    F050S007
    Business Add-in
    FI_RES_ITEM_CURRENCY
    FI_TRANS_DATE_DERIVE
    BADI_ENJ_ALT_ADR
    BADI_F040_SCREEN_600
    BADI_FDCB_SUBBAS01
    BADI_FDCB_SUBBAS02
    BADI_FDCB_SUBBAS03
    BADI_FDCB_SUBBAS04
    BADI_FDCB_SUBBAS05
    RFESR000_BADI_001
    BADI_MIRO_SPLT_ADD
    BADI_PRKNG_NO_UPDATE
    FVFZ
    INVOIC_FI_INBOUND
    AC_QUANTITY_GET
    F050S008
    ADJUST_NET_DAYS
    FBAS_CIN_LTAX1F02
    FBAS_CIN_MF05AFA0
    FISPLIT
    FI_AUTHORITY_ITEM
    FI_DOC_DISP_LI
    FI_FB08_SUBST_BUDAT
    FI_GET_INV_PYMT_AMT
    FI_HEADER_SUB_1300
    FI_PAYREF_BADI_010
    Regards,
    Umang mehta

  • Can i remove the items in session once timeout

    note: i did not mean the session.timeout issue, I mean that I want to remove some of the item which set in the session, once timeout, but the session still.

    You could probably use a java.util.Timer with a java.util.TimerTask to do this sort of thing. Here is the API: http://java.sun.com/j2se/1.4.2/docs/api/ That should help you find out how to use the two classes.
    I would guess what you could do is create a Timer in the ServletContext. Then, everytime a user adds something to the session, you would create a TimerTask with access to the session and the item name. When the task is due, remove the item from the session and kill the task. You would also want to provide a means of stopping or reseting the TimerTask I would guess, but the details are up to you.

  • Editing a document done in Word 2004. I can't remove lines done in Word. Using Mac Mini with 10.9.4

    I am unable to a remove lines from a document originally done in 2004 using  Mac Word 2004 while running it on Pages. Using Mac Mini with OSX 10.9.4.
    Tried to delete lines. Delete is not highlighted in Pages.
    Message was edited by: francinefromkent, 08/8/2014, 5p.m. EST. Edited to give more information.

    The version of Pages is the most useful extra information, it hardly matters what Mac you are using.
    Menu > Pages > About Pages
    The line could possibly be an underline or a paragraph border or a line which is a separate object underneath the rest of the text.
    Probably it is a paragraph border.
    Peter

  • Still Crazy After all these attempts......Can't remove an item from Trash

    PREVIOUSLY POSTED (TWICE!) I've got a file stuck in the trash that won't go away. The trash will empty but that file never goes away. I can't move the file out of the trash, nor can I rename the file. The file name is a bunch of weird forward slashes and I have no idea where it came from. If I add files to the trash and them empty it, the new files will be emptied but not this weird file. I have tried everything I can think of...Secure Empty Trash, downloaded "What's Keeping Me" software,WhatsOpen software, Trash It! software, Growl, Main Menu (admittedly not sure how Growl WhatsOpen, Trash It! work)..... nothing works!
    Don't have any other hard drives....do have Word for Mac and Flip4Mac but don't have any other Window applications (Quicktime is not Windows, right?) - it's pretty much 100% Apple
    Any suggestions on how to get rid of this pesky file?
    Have received lots of suggestions but still have the file!! Doesn't seem to impact the computer's operation but now it has become personal - me vs. "the file" ....and the file is winning.
    Bob

    I've seen two things that absolutely can not be removed from the Trash, no matter what, from a Mac. The first is a file that is a result of having a Windows install, as in Boot Camp, where one needs to boot into Windows and run its version of repair disk. The second case involves Windows, but indirectly. It is possible for Windows users to name a file using illegal (in Mac and UNIX) characters, and for a Mac user to get this file, usually by downloading. Neither the Mac Finder nor Terminal could cope with the illegal characters in the file name and the file will stay until the disk is reformatted. One of the latter cases I remember was a song by ABBA which someone got from a friend in Iceland. It's been awhile since I last saw this problem reported. A notorious example was a file from Adobe in Vietnamese, in the Legal folder. Trashing the Adobe application left this file in the Trash. In that case if one booted from the OS install disk and ran Repair Disk, then rebooted, the Trash could then be emptied. If the file is driving you nuts, you might try that. It might work for your file too.
    Francine
    Francine
    Schwieder

  • I can't remove an item from the sidebar using the standard procedure.

    In fact, as opposed to all the other items in my sidebar, this one can't even be clicked on, or otherwise manipulated. It might refer to a folder I once threw out, and goes by the same name as another item in my sidebar which is associated with a current folder and works just fine. I want to trash the unresponsive item, but, well, it's  unresponsive. Command + Clicking on icon and dragging to trash doesn't work, and clicking or right clicking on the icon brings up no options. The other icons in my sidebar respond properly.

    I have the same problem. Mine is a shortcut to a folder in my Dropbox. If I drag the same folder from Dropbox onto the sidebar, it creates a shortcut that IS responsive (the way it's supposed to be), but the old one remains unresponsive, and I am unable to delete it in any of the usual ways. Very frustrating.
    I chalk it up to yet another example of how Lion is not only not better than Snow Leopard but actually much, much worse. I hate it.

  • Can't remove unwanted item from menu bar

    I recently purchased a Western Digital My Book HD to use for backups. The HD included software which I stupidly thought I needed to use it, so I installed it. I quickly realized I didn't need it and uninstalled the software, however it has left an icon in my menu bar which I can't seem to get rid of. Is there a way to make it go away or am I stuck now?

    how did you uninstall that software? did you simply trash the application? that wasn't the proper way to do it since the app used an installer to install. there should be an uninstaller that came with that app. try using that. you might have to reinstall that software first. if that doesn't work then you have to search out what exactly that software installed. there could be login items. check those in system preferences->accounts. or there could be some launch daemons. check homedirectory/Library/Launchagents, /Library/launchagents and /Library/launchdaemons. but definitely try the uninstaller first.

Maybe you are looking for

  • Calendar app view

    calendar app view restricted to a daily view, which I can scroll lt to rt, rt to left, but has no place available at bottom, or anywhere else, to switch back to weekly, monthly or any other view.........there's no alternative ...........I can't delet

  • How to set where clause for a Valueset from OAF Page

    Hi all I am customizing a standard page Employee Self Service. I have added some additional fields to existing KFF. There was field say "CHILD NAME" which is a free text field. The client now wants it to be a Drop down(or as LOV) which should display

  • Is the "Thunderbolt Port" the exact same thing as the "MiniDisplay Port"?

    All i want to do is connect my laptop to my TV however it doesn't have an HDMI port on this macbook pro. I have a thunderbolt port has a lihghtening pic next to it and i search for cables but all i get are MINI DISPLAY PORTS??? Are these one in the s

  • Unable to switch mo

    I have 32-bit Vista, and a Sound Blaster X-Fi Xtreme Audio (it's an OEM from HP, so Creative won't give me any support for it) There is no mode button in either the console, nor is there a mode switcher option when I click on the icon. I'm pretty sur

  • Upgraded from ios4 to ios 6 and lost all apps i had downloaded and some photos?

    I upgraded an ipad2 from ios4 to ios 6 and once all was done, all my apps, purchased and free ones were gone - and some of my pictures.  Any idea? I do not dare doing another "resore backup" ...   Any help?