Updating the Price for a PO Line ... What's Wrong?

Both MsgBoxes return the correct values.  So, the B1 Purchase Order object appears to be functioning correctly.  However, the POR1 table is not updated in the database.  What am I doing wrong?
Dim oPO As SAPbobsCOM.Documents
Dim oPO_Lines As SAPbobsCOM.Document_Lines
oPO = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseOrders)
oPO.GetByKey(lBaseRef)
oPO_Lines = oPO.Lines
oPO_Lines.SetCurrentLine(lBaseLine)
MsgBox("Before Update: Price = " & oPO_Lines.Price)
oPO_Lines.Price = dPrice
MsgBox("After Update: Price = " & oPO_Lines.Price)
oPO.Update()
oPO.Close()
lBaseRef and lBaseLine were assigned from a Purchase Invoice before this code was executed.

Ah!  I figured this out.  The Purchase Order is Closed (and unedittable at the database level) once the Purchase Invoice is created for these items.  Therefore, the assignement of dPrice to the Price column is "NOT" updated in the POR1 table.
Too bad that exceptions are not raised for such errors.  Also, it is confusing that the 2nd MsgBox() shows a misleading "updated" value.  Apparently, data validation is being handled at two layers in the application.  Why?  I would assume SAP would implement the validation at the business logic layer, especially given the recommendations to develop all customizations through the SDK.
I can perform the update using a recordset query; but, this direct editting of the table would require modifying several lines in both the POR1 and OPOR tables.  Thus, this solution (my only solution for this project) would be extraordinarily difficult to maintain.  Therefore, I am going to recommend dropping this implementation requirement.

Similar Messages

  • BAPI_PO_CHANGE to update the Price for the line item not updating the Price

    Hi,
    I am using BAPI_PO_CHANGE to update the Price for the line item. This BAPI is not updating the Price. I am using external cummit also, but the BAPI is not updating price.
    I am passing following data to the BAPI.
    Plant: CQ11
    PO                   Material                Price
    4500002142     TEST_BATCH     12
    Please provide suggestion.
    Regards,
    Jubin.

    Hi,
    check this link...this has sample code
    [http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm]
    Regards,
    Surinder

  • I would like to make an upgrade from creative suite cs5 to cs6 what is the price for student edition and what i have to do, i do not found in your website price

    i would like to make an upgrade from creative suite cs5 to cs6 what is the price for student edition and what i have to do, i do not found in your website price

    There are no upgrades for student editions. You simply buy a fresh license at the discounted price.
    Mylenium

  • How does the return sales order captured the price for mat. Doc. during GI

    Dear Guru,
    We have a commercial return sales order process, which we have created a Doc Type YR01 "Commercial Return"
    everytime when this YR01 is been generated from the Customer Return PO, we need to change the MAP via tcode MR21.
    Problem here, this time the user processed with a wrong step, the user straight away to create a DO and GI for this YR01  before the MAP is changed. SO obviously the price in Material Document generated when GI is inccorect, thus a reversal for this GI and DO is done.
    After DO and GI is reversed, we update the correct MAP via MR21 and perform a DO and then GI, but we realized the Price in material document doesn't capture the latest updated MAP price.
    So after many testing, we found there are 2 ways to solve this,
    1. Recreate a new YR01 Commercial return sales order
    2. Or during the MR21, select the variance "Special Stock - Sales Order"
    Question,
    Can i know where does the SO capture the MAP price and where and which table that the MR21 will be updating when selected variant "special stock - sales order"?
    Thank you very much,
    Chee Wee

    Hi,
    The price entered in MR21 updates the price for the material in material master "accounting 1" tab page. This will update the price in the table MBEW according to the valutaion class you have assigned to the material type.
    If you are entering "Special Stock - Sales Order" in MR21. the valuation class for sales order stock should be assigned for the material in the material master "accounting 1" tab page MBEW-EKLAS, this valuation class will have an altogether different accounting, so according to me option 1 i.e reversal of document YR01 is a more easier solution.
    Regards
    Aadesh Kamat
    Edited by: aadesh123 on Jul 11, 2011 10:45 AM
    Edited by: aadesh123 on Jul 11, 2011 10:48 AM

  • HT2305 I want to upgrade IMovie, IPhoto, Garageband and ITunes. My MacBookAir is one year old. But what are the prices for updates?

    My MacBookAir is one year. I want to upgrade IMovie, IPhoto, Garageband and ITues, But What are the prices for these upgrades. How do I get around?

    Actually, if you are updating the free iLife apps (iPhoto, iMovie & GarageBand) that came with your new Mac, the updates are free. Only if you are upgrading to newer major paid versions would you be charged.
    iTunes is always free, but is located in Apple Downloads, not the Mac App Store;
    http://support.apple.com/downloads/

  • Dear Sir, I am registered customer of Adobe Illustrator CS6. I want to update the adobe to Adobe CC the latest software. What is the price for updation.

    Dear Sir
    I already have adobe illustrator CS6. I want to update to Adobe CC. Can you please send the price for the updation.
    Thanks
    Rajan

    Full prices can be found here:
    https://creative.adobe.com/nl/plans?store_code=nl
    The price for a single applications is €24,- a month

  • What is the price for UK Creative Cloud?

    This URL: https://creative.adobe.com/plans shows that the price for existing qualified customers is £22.23:
    Yet when I click "Sign Up", I get a price of £27.34:
    Also, you'll notice from the screenshots above that the regular annual subscription price is different.  Note: even with 20% VAT added to the £22.23 price, the total should only be £26.68.  The regular price on the second page is also actually less than what it would be if the first page was showing prices without VAT.
    Please could someone tell me the actual prices I'll be paying!!

    Ireland's VAT is 23% thus giving you the £27.34 ; not nice but ......

  • What is the price for an iphone 5s of 32gb if I buy it with no carrier?

    I want to buy an iphone 5s of 32gb, but I want to use it in mexico, what is the price of the phone??? and also what is the price for unblock it to use it in mexico???

    $649.95

  • What's the price for a MacBook Pro Retina Display Top Case with battery in the US?

    I'd like to know what´s the price for a MacBook Pro Retina Display Top Case with battery in the US.

    Here you go.

  • What is the price for Unlocked iphone5 for the 16 GB , 32 GB, & 64 GB. ?

    I search the web regarding the price for the unlocked iphone5 price and I found that it's 649 $ for the 16 GB , 749 $ for 32 GB and 849 $ for the 64 GB. But some shops in DC they are asking a price of 1200 USD for the 16 GB.  Where should I buy the unlooked iphone 5 in Washington DC and in what price and which is the right price ?
    Thank you

    No availability of unlocked devices in the US has been announced at this time.

  • When iphone 4s will be released in india, and what is the price for 16gb

    when iphone 4s will be released in chennai, tamilnadu, india .  and what is the price for 16gb

    You would have to ask Apple, or your local official reseller.

  • What is the price for Photoshop CS3?

    what is the price for Photoshop CS3?
    I have an old mac PRO (2008) and have problems with newer versions

    kjersti fjøsne wrote:
    I have an old mac PRO (2008) and have problems with newer versions
    Your Mac Pro 2008 should have no problems with CS6.  Not sure about CC or CC2014. Note that Adobe stills sells CS6 with a perpetual license.
    I run CS6 13.0.6 on a 2996 Mac Pro 1,1 without any problems or slowdowns whatsoever.  Just make sure you have your Mac equipped with plenty of RAM, a physically separate HD for Photoshop's scratch, and a video card with enough VRAM on it.  See my machine's specs below.
    Intel Xeon Mac Pro 1,1 [late 2006] 2.66 GHz Quad; 16 GB RAM; mutant/flashed, factory-overclocked 875/1225 "Apple PowerColor" ATI Radeon HD 5770 with 1 GB of GDDR5VRAM driving side-by-side dual 22"/24" monitors in Extended-Desktop mode; Mac OS X Lion 10.7.5 and Snow Leopard 10.6.8 boot drives; intrusive Spotlight and frivolous Dashboard permanently disabled; USB wireless 'n' available but connected to the Internet and networked via wired Ethernet. Photoshop CS6 13.0.6.

  • I have my Launch Vidoe ready and the "share" drop down is gray so no ability to send it anywhere.  what is this?  I went on to update the computer for other reasons, now Safari 6.0.2 asit interferred with downloads; and from OS X basic to Mtn Lion 10.8.2.

    I have my Launch Video ready and the "share" drop down is gray so no ability to send it anywhere.  What is this?  I went on to update the computer for other reasons, now Safari 6.0.2 asit interfered with downloads; and from OS X basic to Mtn Lion 10.8.2.  

    Make sure your Project has the focus. You cannot Share an Event.

  • What´s the price for any Cisco ASA security parts?

    Hello everybody,
    Please, I need to know the prices for the items:
    ASA5500X-SSD120=     
    FS-VMW-2-SW-K9       
    L-ASA5525-TAM=       
    I need to implement Cisco IPS with 2 Cisco ASA 5525X.
    Thank you.

    Your local Cisco partner can provide pricing for your area.
    The Cisco Support Community is not the place to request price quotes.
    Please go to www.cisco.com and refer to the top menu pick "How to Buy" to find an authorized partner / reseller serving your area.

  • I tried to update the software for my iPhone 4S. It froze, and now won't turn off, or on, or sync.  Any ideas on how to fix this?

    I tried to update the software for my iPhone 4S, 16 GB to the most recent version (8.1?).  I don't know what I was updating from, because I can't access that, but it was whatever was installed on it (I got it about a year ago, so probably 6.something). 
    It froze, and now won't turn off, or on, or sync with my macbook plus, which is what I have always sync'd it to.  (I backed it up and sync'd it right before I tried to update the software.)
    Since it originally froze almost 3 hours ago, it shows a white screen with the apple on it and a line underneath.  When I try to sync with my laptop, it says it needs me to enter a passcode on the phone, which I can't enter because the screen is frozen.  So I'm unable to access the iPhone portion of iTunes.
    I have tried to turn it off, with no luck.  I have tried rebooting my laptop and syncing, but I still get the same result.
    Does anyone know how to fix this?
    I really wanted to wait to update the software, but I was having internet connectivity issues for the past 3 weeks, and Sprint suggested updating the phone's software.
    Thanks in advance for your help!

    Hi NWL1,
    Thanks for the question. If I understand correctly, the iPhone won't update and is stuck. I would recommend that you read this article, it may be able to help you resolve or isolate the issue.
    If you can't update or restore your iPhone, iPad, or iPod touch - Apple Support
    Thanks for using Apple Support Communities.
    Have a great day,
    Mario

Maybe you are looking for

  • How to implement a single user in mutiple AD groups?

    Hi all, I need your help in achieving the following requirement. 1. Security should be applied based on a DeptName from DeptTable For example Department Name= A , Department Name =B, Department Name =C. 2. Also security should be based on Officer Ind

  • About  Interactve Reports

    Hi Falks,   If any one knows about interactive report transaction code than plz give reply as well as send  me one step by step example how to create interactive reports. mail me on "[email protected]". Thanx and regards, Rahul Talele

  • Essbase 11.1.2.2 view outline not showing attributes assigned to level0

    I have a weird queston. I have users that have full READ access to an essbase application. when they goto view it doesn't show the attributes assigned to our property dimension. In this version shouldn't they be able to see these? Or do i need to upd

  • Setting up ARD 2.2

    I'm able to see my mom's computer on the scanner list, but when I add her to the Master List the username and password are not accepted. The ones I'm using are admin and current on her machine. I'm new to this, real new and appreciate any help. Thank

  • YouTube Quality is horrible!!!

    Ive noticed that the quality of YouTube videos on my 3G iPhone are horrible! I went into an apple store and played a video from YouTube on a display phone, and the image is crystal clear. Im very frustrated because after shelling out $200 for the pho