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!

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.

Similar Messages

  • Adding to item quantity

    Hi all
    When first adding an item to the basket, is it possible to add more than 1. For example on the partdetail.aspx page have a quantity box next to the add to basket link. Rather than adding it once then having to update the quantity after in basket view.
    Thanks

    The cart page is actually doing the add part, so you would either need to redirect from there using a plugin, or create a plugin to manually add the part (using NPOrder.AddPart())
    If you want to create the plugin, then you only need to swap out the NavigateURL on the "~/catalog/controls/partslistblock.ascx" for the cart image.
    Find the lnkAddToCart Hyperlink and change
    NavigateUrl="~/commerce/cart.aspx?AddPartNo="
    to
    NavigateUrl="~/catalog/partdetail.aspx?partno="
    Message was edited by:
            Shane Hart

  • Error while adding a item

    Hi All
    When I am adding a item in master data then error occurred "variation for price list and price list for items" and finally i could'nt add item. So please solve it if you have any solution regarding it.
    Thanks with regards
    Bibha
    Edited by: Bibha Singh123 on Mar 25, 2011 12:43 PM

    Hi Bibha,
    check Message 3506-9 Price List Error - Please Help thread.
    Thanks,
    Neetu

  • How to create new subsite while adding new item to the list by using javascript?

    hi,
    I hav a task ie, when I add item to the list then subsite will create with that list item title and description . So By using javascript, I have to create subsite while adding new item to the list.
    Help me to solve this.
    Thank you, 

    Is your item getting added through Javascript client object model ? If yes, you can write in the success delegate of your list creation method the logic to create the subsite.
    function CreateListItem()
    var clientContext = new SP.ClientContext.get_current();
    var oList = clientContext.get_web().get_lists().getByTitle('List Name');
    var itemCreateInfo = new SP.ListItemCreationInformation();
    this.oListItem = oList.addItem(itemCreateInfo);
    oListItem.set_item('Title', 'My New Item!');
    oListItem.set_item('Body', 'Hello World!');
    oListItem.update();
    clientContext.load(oListItem);
    clientContext.executeQueryAsync(Function.createDelegate(this, this.CreateListItemOnSuccess), Function.createDelegate(this, this.onQueryFailed));
    function CreateListItemOnSuccess() {
    var subsiteTitle = oListItem.get_item('Title');
    //Logic to create a subsite
    function onQueryFailed(sender, args) {
    I have added a sample flow for the above scenario. Have a look at the following lnk for how you can craete a subsite using ecmascript.
    http://ravisoftltd.wordpress.com/2013/03/06/sharepoint-2010-create-site-with-ecma-script-with/
    Geetanjali Arora | My blogs |

  • Using Bapi_salesorder_change adding a item, deleting a  item,Quanty change

    I need help on Bapi_salesorder_change.
    I have a table control in which there will be data of a particular sales document no, items, quantity, sales unit. When user changes the quantity, or adds a line item or deletes a line item and the press the save button bapi_salesorder_change should trigger and should change the order as the user changes.
    Can u help how to write code for this three conditions
    1> adding line item.
    2> deleting a line item.
    3> changing the quantity.
    using bapi_salesorder_change
    Can i use the same bapi for three conditions?
    Please help me in this as soon as possible.
    I thank them in advance

    Hello Geeks,
              i am using this bapi  for updating my item quantity no....
              but the bapi return msg say tat its not changing....
              i think i may did some mistake pls anyone can rectify it....
              i hv attached my code below......
    *For line item
    TYPES :BEGIN OF y_t_vbap,
            vbeln TYPE vbeln_va,  "sales Document
            posnr TYPE posnr_va,  "Item no of SD document
            matnr TYPE matnr,     "Material No
            zmeng TYPE dzmeng ,   "Target qty in Sales unit
            spart TYPE spart,     "division
            message TYPE BAPI_MSG,
           kwmeng type kwmeng,   "cummulative order qty
           END OF y_t_vbap.
    TYPES : y_t_itemin TYPE bapisditm,
            y_t_return TYPE bapiret2,
            y_t_headerx TYPE bapisdh1x.
    TYPES: BEGIN OF y_t_logdata,
           lno             TYPE         lineno,         "Lineno
           field           TYPE         fieldname,      "Field Name
           value           TYPE         lmon_fvalue,    "Field Value
           message         TYPE         bapi_msg,       "Messages
           END OF y_t_logdata.
                     Internal table declaration
    DATA: "y_i_vbak      TYPE   STANDARD TABLE OF y_t_vbak,
          y_i_vbap      TYPE   STANDARD TABLE OF y_t_vbap,
          y_i_headerx   TYPE   STANDARD TABLE OF bapisdh1x,
          y_i_itemin    TYPE   STANDARD TABLE OF bapisditm ,
          y_i_iteminx   TYPE   STANDARD TABLE OF bapisditmx,
          y_i_return    TYPE   STANDARD TABLE OF y_t_return,
          y_i_logdata   TYPE   STANDARD TABLE OF y_t_logdata,
          y_i_bapiret   TYPE   STANDARD TABLE OF bapiret2.
                     Table type declaration
    TYPES: y_tt_vbap    TYPE   STANDARD TABLE OF y_t_vbap ,
           y_tt_logdata TYPE   STANDARD TABLE OF y_t_logdata.
                     Work Area declaration.
    DATA:   y_wa_vbap     TYPE   y_t_vbap,
          y_wa_itemin   TYPE   bapisditm ,
          y_wa_iteminx  TYPE   bapisditmx,
          y_wa_headerx  TYPE   bapisdh1x,
          y_wa_return   TYPE   y_t_return,
          y_wa_logdata  TYPE   y_t_logdata,
          y_wa_event    TYPE   slis_alv_event,
          y_wa_event1   TYPE   slis_t_event,
          y_wa_bapiret  TYPE   bapiret2.
                     Variables declaration.
    DATA: y_i_event     TYPE   slis_t_event,
          y_v_success   TYPE   i           , "For Success
          y_v_error     TYPE   i           , "For Error
          y_v_sno       TYPE   char30      ,
          y_v_eno       TYPE   char30      ,
          y_v_msg       TYPE   char100     . "error msg
                     Constants declaration.
    constants : y_k_x type char1 value 'X',
                    y_k_u type char1 value 'U',
                   y_k_e type char1 value 'E'.
                  SELECTION SCREEN LAYOUT
    SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN: COMMENT 3(18) text-003.
    PARAMETERS   :    y_p_vbln TYPE vbak-vbeln OBLIGATORY.
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN : END OF BLOCK b1.
                      START-OF-SELECTION.
    START-OF-SELECTION.
    WRITE: text-002.
                      END-OF-SELECTION.
    END-OF-SELECTION.
      SELECT  vbeln
              posnr
              matnr
              zmeng
              spart
              FROM vbap
                   INTO TABLE    y_i_vbap
                   WHERE vbeln = y_p_vbln.
      LOOP AT y_i_vbap INTO y_wa_vbap.
        y_wa_vbap-zmeng = 2 + y_wa_vbap-zmeng.
        MODIFY y_i_vbap FROM y_wa_vbap INDEX sy-tabix.
      ENDLOOP.
      PERFORM y_f_update USING y_i_vbap.
    *&      Form  y_f_update
           POPULATE BAPI DATA AND RUN BAPI
    FORM y_f_update USING  y_p_vbap TYPE y_tt_vbap.
      CLEAR: y_i_headerx, y_i_itemin, y_i_iteminx,
             y_i_return, y_i_bapiret.
      REFRESH: y_i_itemin, y_i_iteminx, y_i_return, y_i_bapiret.
      LOOP AT y_i_vbap INTO y_wa_vbap.
        MOVE y_wa_vbap-zmeng TO y_wa_itemin-target_qty.
        MOVE y_wa_vbap-posnr TO y_wa_itemin-itm_number.
        APPEND y_wa_itemin TO y_i_itemin.
      ENDLOOP.
    *Update the Bapi Itnernal tables
      y_wa_headerx-updateflag = y_k_u .
      APPEND y_wa_headerx TO y_i_headerx.
      LOOP AT y_i_vbap INTO y_wa_vbap.
        y_wa_iteminx-itm_number = y_wa_vbap-posnr.
        y_wa_iteminx-target_qty = y_k_x .
        y_wa_iteminx-updateflag = y_k_u .
        APPEND y_wa_iteminx TO y_i_iteminx .
      ENDLOOP .
      CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          salesdocument    = y_wa_vbap-vbeln
          order_header_inx = y_wa_headerx
        TABLES
          return           = y_i_return
          order_item_in    = y_i_itemin
          order_item_inx   = y_i_iteminx.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
      CLEAR y_i_vbap.
    IF y_i_return is not initial.
      LOOP AT y_i_return INTO y_wa_return where TYPE = y_k_e .
        MOVE y_wa_return-message TO y_wa_vbap-message .
        Append  y_wa_vbap to y_i_vbap.
        y_v_success = y_v_success + 1.
      ENDLOOP.
    ENDIF.
      y_wa_event-name = 'TOP_OF_PAGE'.
      y_wa_event-form = 'Y_FD_TOP_OF_LIST'.
      APPEND y_wa_event TO y_i_event.
      CLEAR y_wa_event.
      CALL FUNCTION 'ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program         = sy-repid
          i_tabtypename1             = 'Y_T_VBAP'
          it_events1                 = y_i_event[]
        TABLES
          t_outtab1                  = y_i_vbap[]
        EXCEPTIONS
          program_error              = 1
          maximum_of_appends_reached = 2
          OTHERS                     = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " y_f_vbap
    *&      Form  Y_FD_TOP_OF_LIST
    FORM y_fd_top_of_list.
      MOVE: y_v_success TO y_v_sno,
            y_v_error   TO y_v_eno.
      CONCATENATE text-002 y_v_sno '/' y_v_eno INTO y_v_msg SEPARATED BY
      space.
      CONDENSE y_v_msg.
      WRITE / y_v_msg .
      SKIP 1.
    ENDFORM.                    "Y_FD_TOP_OF_LIST

  • Adding line item prior to ACC_DOCUMENT03 Posting

    Due to our legacy currency alignment on some systems being incongruent with our SAP ECC 6.0 environment, some upstream inbound IDocs will post with 2 decimals for HUF when 6.0 environment has 0 decimals for HUF.  The inbound documents are coming in as ACC_DOCUMENT03 IDocs.
    There will be rounding involved.  iN certain cases, the rounding will mean that the line items are no longer in balance.
    Rather than alter the value of the inbound line items, preference is to add line item prior to posting that contains the balance difference and posts to the "rounding difference" account.
    Has anyone expereinced this situation before? How was it resolved?
    Considered adding line item via "BAPI_ACC_DOCUMENT_POST" or, if possible, within "'BAPI_INCOMING_INVOICE_CREATE'".
    Has anyone faced this or a simlar issue before?  How was it resolved?  Was it resolved internally?

    Hello Weng,
    I also looked on SAP notes. 
    There is a note with much information about Tax Postings with accounting BAPIs and it's a consulting note.  The note number is 626235.
    Regards,
    Rae Ellen Woytowiez
    Edited by: Rae Ellen Woytowiez on Dec 21, 2010 10:11 PM

  • C#: when adding listview items the screen flashes and only single listview column loads?

    When adding listview items, the listview1 items flash and only the first listview column loads (there are 5 columns in all)?
    Background...
    I was having cross-threading issues on 3 form components which I was able to resolve (see
    code here). Now I think the soluiton which involves creating a delegate and performing an "InvokeRequired" check (see
    what I used), I'm having an issue passing 5 values for each column. Below is the code involved calling this invoking check for each and their methods.
    Before having the cross-thread issue the "listview1.Items.Add(values.text) add the comma separated string values to the appropriate columns, but that doesn't happen through the cross-thread fix required.
    The "Loading()" method is handled through and async/await method causing the initial cross-thread issue.
    private void Loading()
    int t = 1;
    foreach (string line in scripts)
    string[] listValues = line.Split(',');
    ListViewItem values = new ListViewItem(listValues);
    if (t == 1)
    AddColumn("Script Name", 200); // Creates column headings
    AddColumn("Date and Time", 150);
    AddColumn("SID", 75);
    AddColumn("Environment", 75);
    AddColumn("Client", 75);
    t++;
    else
    if ((values.Text != "") && (values.Text != "Script Name"))
    //listView1.Items.Add(values);
    AddItem(values.Text);
    if (!dictScript.Contains(values.Text))
    dictScript.Add(values.Text);
    //cbxScriptList.Items.Add(values.Text);
    AddScript(values.Text);
    private void AddItem(object o)
    if (this.listView1.InvokeRequired)
    AddItemCallback d = new AddItemCallback(AddItem);
    this.Invoke(d, new object[] { o });
    else
    { // code that adds item to listView (in this case $o)
    listView1.Items.Add(o.ToString());
    private void AddScript(object o)
    if (this.listView1.InvokeRequired)
    AddCBXCallback d = new AddCBXCallback(AddScript);
    this.Invoke(d, new object[] { o });
    else
    { // code that adds item to listView (in this case $o)
    cbxScriptList.Items.Add(o.ToString());
    private void AddColumn(object o1, object o2)
    if (this.listView1.InvokeRequired)
    AddColCallback d = new AddColCallback(AddColumn);
    this.Invoke(d, new object[] { o1, o2 });
    else
    { // code that adds item to listView (in this case $o)
    listView1.Columns.Add(o1.ToString(), (int)o2); // Creates column headings
    SV

    Ok, I still have the flickering issue, I could use some guidance on that. And I should note that before I had the code-threading issue, I never had any flickering, it all appeared simultaneously.
    However, I was able to populate all columns (5 in all).  I had two corrections to make.
    1) My method should not have been passing the parameter as text but as the object ListViewItem:
    // Not This...
    AddItem(values.text)
    // This is Correct...
    AddItem(values)
    2) Then I needed to cast my object as a ListViewItem in my method call:
    private void AddItem(object o)
    if (this.listView.InvokeRequired)
    AddItemCallback d = new AddItemCallback(AddItem);
    this.Invoke(d, new object[] { (ListViewItem)o });
    else { // code that adds item to listView (in this case $o)
    listView1.Items.Add((ListViewItem)o);
    SV

  • Zen Vision:M adding unhighlighted items to Now Play

    My brand new Vision:M has just begun adding the item below what I have highlighted to the "Now Playing" list instead of what I wanted. I updated the firmware to . immediately after receiving the player.
    Anyone else have this problem. After I click on "add to selected", the highlight bar drops down to the next item and that's the item that's added. Very undesireable and confusing. No real help from Creative email support.

    Sidenote everyone: My post may have been somewhat misleading. The computer recognizes the Zen, as in, if I go under "My Computer" and whatnot it shows it as being there, what's not recognizing it is Creative MediaSource. The computer knows its there and a window asking what I want to do pops up every time I plug the Zen in, but when I run MediaSource, which is the specific version for this type of operating system, it won't recognize it and hence I can't transfer files. Sorry for the confusion.

  • Separtae  PO for the third party vendor while adding the item in the sales

    Hi
      There is any possible to create to separate PO for the added new item (third party vendor)in the existing sale order .
    Thanks
    Ramesh

    I don't think it will update the Billing Date. However, In VF while creating Invoice, we can mention the required Date.
    Regards,
    Rajesh Banka

  • Awt.List Flicker when adding many items.

    I need to add a lot of items to an awt.List (around 100),
    is there a way to do this off-screen so that it wont flicker
    like crazy while I'm adding the items in a loop?
    Thanks,
    Rob.

    you can make your list invisible setVisible(false) when it performed the adding make it visible.You can use Thread.sleep() to stay for a while till adding has not been done!
    hope it will match with ur requirements

  • Adding Glossary items from chapter text.

    Adding Glossary items one by one is painful.
    Any short cut you can suggest to create them?
    Thanks.

    I'm preparing an iBooks version of a long French text for which I have a glossary in spreadsheet format. Unbelievably tedious to have to now enter all the items one by one. An import function would be awesome, and it would be straitforward to link definitions to target words in the text. No mind-reading required. :-)

  • Proto adding strange items in web browser

    Hi, Proto is adding strange items in web browser that are not in the editor. See images below
    Editor
    Web
    It seems to be adding content that is placed at the bottom of the page.
    See live link https://creative.adobe.com/file/ff07618c-b98a-4672-a2ce-8f7b4c7c0558
    Please advise on how I can fix this issue.
    Kind Regards
    Ryan

    Hi Ken, thanks for getting back to me.
    I am have tried to login to my creative cloud account, but found that my proto project will no longer sync with the cloud. Not sure what to do hear. I have tried to login in and out of my account, on my ipad which didn't help.
    Please advise.
    Kind Regards
    Ryan

  • Slow Reports after adding calculated item

    Hi All,
       I am facing a slow response after adding few calculated items in a report. Is it a normal behavior of OBIEE in terms of adding calculated items?
    Anyone faced similar issue please comment.
    Thanks,
    Muhammad Waqas

    Hi Muhammad Waqas,
    Have you run the physical query that is generated by BI Server on Database? Once executed on database, compare the execution time with OBIEE execution times, with this you will get the answer.
    Depends on the amount of data and the type of calculation, it is normal behaviour to slow down the performance of the reports after adding calculated measures.
    Please mark it Helpful/Correct, if it is.
    est Regards,
    Kalyan Chukkapalli
    http://123obi.com

  • Added iCal item on iPhone 5 that are not transferring to MacBook

    Hello All, I have an iPhone 5 - I have added calendar items on my phone that, when I plug into my MacBook Pro to sync, are not transferring over. I have read the forums and tried the resetting my sync history - still nothing has changed. I do not use iCloud and do not want to. Any help is appreciate. Thanks in advacne

    Does this involve iPhoto for the Mac in any way?  Or should it be in the iPhoto for IOS forum? or the iCloud forum?
    LN

  • Adding multiple items at once to a SharedCollection

    I'm playing around with Cocomo for the first time. I like it
    a lot, but haven't yet got enough understanding of the API. So I'm
    sure I'm missing something obvious.
    Anyway. I want to build an application that share an array of
    items between clients. The array should be persistent and when a
    new client connects it will get the latest data. At the startup of
    the first client I want to fill the shared array with default data.
    I also want to revert to this data from time to time in an
    applications lifecycle.
    I've been checking out the examples and I think a
    SharedCollection would be perfect for this scenario (not sure if it
    really is?).
    The problem I have is when I try to fill the SharedCollection
    with data, using the addItem method within a for loop, I only get
    an entry with the last item, instead of multiple entries (I'm
    checking what data that has been added by using the Dev Console).
    I'm doing all this in the SYNCHRONIZATION_CHANGE event (only the
    first time it's fired).
    I should also note that this happens the first time, when no
    CollectionNode already is created. When a CollectionNode already
    exist it works.
    Is this totally the wrong way to go? Am I missing something
    about how CollectionNodes should be created? Any help is highly
    appriciated!

    Hi ,
    I actually modified the SharedCollectionExample locally to
    have items added in the beginning in synchrinization change
    handler. It works fine for me , here is what I did
    In the SharedCollectionExample in the examples folder ,
    add this line
    _model.addEventListener(CollectionNodeEvent.SYNCHRONIZATION_CHANGE,onSynchronizationChang e);
    in the onCreationComplete() method where you first declare
    SharedCollection Class.
    And in the
    private function
    onSynchronizationChange(p_evt:CollectionNodeEvent):void
    if ( _model.isSynchronized ) {
    _model.addItem({State:"Nevada",Capital:"Carson City"});
    _model.addItem({State:"California",Capital:"Sacramento"});
    I can get multiple items( i.e. these two items i added) in
    the very beginning. If you check that the model ( SharedCollection)
    is synchronized and add within it the items it should work fine and
    will give you an initial set of items. Also, shared collection has
    a property called idField and it will index objects based on this
    field value with duplicates being overwritten.
    I hope this helps. Otherwise please copy fractions of code
    where you are still finding problem.
    Thanks
    Hironmay Basu

Maybe you are looking for

  • Another 17" Review (this time from Europe)

    Received my 17" MacBook Pro today - shipped from Shanghai. After reading so many posts of people having problems with MacBooks, I was concerned. But it turned out to be near perfect. Here are some details This is my first Apple Notebook after an G4 i

  • Upgrading iM from 8.1.6 to 8.1.7

    I migrated one of our 8.1.6 databases to 8.1.7. Based on the migration documentation, InterMedia Text needs to be manually upgraded. Following Doc ID 120611.1, I ran s0801070 as SYS, then as CTXSYS, I ran the following: u081070.sql dr0typec.pkh dr0pk

  • Problem in FB60

    Hi, I am using Transaction code FB60 to post Vendor Invoice. In the payment tab, for Pmnt Block, I am choosing the option " Block for Payment". However, after I press Enter or Save the invoice, the Payment Block automatically changes to "Free for Pay

  • Iphone 5s background photo uploading broken?

    I just got the Iphone 5s and I have tried the Flickr app and the Google+ app.  Neither of them upload my photos until I go to the actual app.  Even if they are running in the background they don't auto upload.  Is that normal?  Thanks.

  • Can't Complete Install

    Can't complete install of Photoshop Elements 10 & Premiere Elements 10, Disc 5.  Prior disks loaded fine but Disc 5 causes a window from my Lexmard printer to open which asks "What do you want to do? View & Print or Save to PC?"  Although I close the