Unit price in Invoice form(Rounding up issues)

Hi Gurus!
In my smartform I have used a formula to get the unit price of an item line which is giving me rounding up issues as it is calulating upto the 3 decimal places that I require in my output. Is it possible to grab the unit price field (KEBTR) directly into my form for the unit price so that I get the actual amount as in SAP into my invoice output rather than caluclting it in my code so that there is no discripancies.
Like it shows on my form sometimes 98.999 or sometime 99.001 instaed of 99.00 as is in under the condition tab of the invoice, I would like it to show straght as is in SAP 99.000 rather tahn doing caluction and coming to a smallest decimal value.
CLEAR: g_unit_price, g_min_charge_flag, g_item_tot, g_skto_kwert.
* get skto amount (Cash discount)
LOOP AT gt_konv INTO gs_konv WHERE kposn = gs_gen_del-itm_number AND
kschl = 'SKTO'.   "Cash discount
g_skto_kwert = gs_konv-kwert.
EXIT.
ENDLOOP.
* For rental contracts there is no delivery so surcharges must be removed from net.
IF is_bil_invoice-hd_gen-bil_type = 'ZFV'.
CLEAR gs_gen_del-kzwi3.
LOOP AT gt_konv INTO gs_konv WHERE
kposn = gs_gen_del-itm_number AND
stunr BETWEEN 230 AND 289.
gs_gen_del-kzwi3 = gs_gen_del-kzwi3 + gs_konv-kwert.
ENDLOOP.
ENDIF.
g_item_tot = gs_gen_del-netwr - gs_gen_del-kzwi3.
IF gs_gen_del-fkimg <> 0.
g_unit_price = g_item_tot / gs_gen_del-fkimg.
ENDIF.
Thanks
Edited by: Aarav  Agnihotri on Jun 11, 2009 6:58 PM

Hi Aarav,
Check this links
[Rounding|Rounding]
[Rounding off value|Re: Rounding off value]
Read Above for a clear idea about Rounding values.
[Rounding of the Values|Rounding of the Values]
[Quantity & Rounding condition values|Re: Quantity & Rounding condition values]
[Rounding down values|Re: Rounding down values]
For More results Search In SDN...
Thanks & regards,
Dileep .C

Similar Messages

  • Unit price for invoice

    Hi Experts,
    I want to get unit price for invoice line items from BSEG table.
    How to get it.
    What is the unit price field for invoice line items.
    Regards,
    Sangeeta.

    Hi Sasi,
    Should I take the line item amount(WRBTR) for unit price from bseg table?
    Regards,
    Sangeeta.
    Edited by: Sangeeta on Dec 29, 2008 8:00 AM

  • Net Unit Price of Invoice Item Not Kept/Deleted

    Hello everyone,
    Yesterday I had an issue with a supplier invoice uploader I've created --- it uploads consistently which is nice, but for some reason the unit price is disappearing on me. I've got the following lines:
    in which 'row.zItemNetUnitPrice' is decimal (currencyCode is always going to be GBP in this case, so I figured I didn't need it) and row.zAmountOrdered is obviously a Quantity type. Now, here's the strange part: when 'newSIItem' is created using siItem, the unit price is deleted --- as in, immediately after creation of newSIItem, the unit price is set to 0.00. But the amount ordered is kept as it was set. So obviously that's weird, and is causing all my invoice items to be created as zero price --- you'll agree that's not very helpful.
    What's also strange is that, in order to remedy this I tried to just set the unit price to what I wanted AFTER newSIItem was created, as according to the repository explorer it's not read-only. This worked --- up until I set the account assignment type, at which point it got set BACK to zero as follows:
    As you can see in the debugger, it says 'changing invoice price not possible...'. --- but the net unit price field isn't read-only. So my overall question is: what the hell is going on? Any help would be greatly appreciated. Attached is my entire mass-enabled AfterModify script and the XML file I'm using as part of a file input run on the custom business object to which this script belongs. Thanks!
    Lewis
    EDIT: I tried moving 'newSI.NetUnitPrice.Amount.content = row.zItemNetUnitPrice' to after the account assignment --- it seems it was invalidated by any subsequent command, even to the point that having it directly before setting gross amount to total gross amount would still not work. I also tried setting net amount instead of net unit price --- the debugger specifically told me that net amount is read-only. But the repository explorer says it has write access. Anyone able to shed light on this?

    I solved this --- I noticed that I had siRoot.DocumentGrossAmountsIndicator set to false but creating the root node (newSI = SupplierInvoice.Create(siRoot)) turned that back to true again for no apparent reason. My guess is that having this set to true, i.e. all values are gross, dynamically sets all net fields to read-only. Once I discovered this it was as simple as setting the indicator back to false post-creation of the root node, and then net price fields were accessible again.

  • R12: Disable Field Quantity and Unit Price in Line Item (AR)

    Hello,
    Is there a setup in Oracle Receivables - Transactions where I can disable the field "Quantity" and "Unit Price" on the form for line item?
    I don't have Order Management nor Inventory setup in this environment.
    Note: In AP invoices, these field are disabled.
    vik

    Hello.
    I don't think that is possible because the system uses those fields to calculate the Amount field, which cannot be filled in directly.
    Octavio

  • Authorisation for unit price in Sales Order

    Hi Experts,
    Is there a way to prevent users from being able to change the unit price of an item in Sales Orders?  If not directly can anyone suggest a workaround to prevent access to this field?  We have noticed recently that on some occasions when users were not able to apply certain discounts they had changed the unit price!
    Regards
    Geoff

    Hi Goeff........
    Its easily done by Authorization.
    Just unauthorized an user to change the Unit price in General Authorization in sales module.
    Or you can disable the unit price column through Form Setting and do not give authorisation to change form settings to that user........
    Regards,
    Rahul

  • Unit Price Field is in-active on a Purchase Order for a Normal User

    Hi All,
    One of my A/P user is unable to enter price on a Purchase Order as the PO Unit Price field is inactive. I have given this user full authorization on PO and activated the unit price field from form settings as well but as such nothing is happening. Can anybody tell me how to get it activated.
    BR

    +Naveed Jameel wrote:
    <<Hi All,
    One of my A/P user is unable to enter price on a Purchase Order as the PO Unit Price field is inactive. I have given this user full authorization on PO and activated the unit price field from form settings as well but as such nothing is happening. Can anybody tell me how to get it activated.>>+
    Hello Naveed,
    Have you given read only or full authorisation to the price list group associated with the price list used for your BOM?
    KR
    Murielle

  • MM SUS Invoice unit price issue

    Hello ,
    We are using MM SUS invoice scenario. In MM PO has created for order quantity 2000 EA, and net price is 73.51 USD for 1000 per unit.
    During invoice, price information of item is like this:
    Price 0.07 USD, Per 1 EA and value is 147.02 USD
    But during invoice processing, system calculated net value to 140 USD, and invoice posted for 140 USD only, any advice or suggestion how to handle this in?
    System is SRM4.0 and ECC 6.0
    Thanks in advances for replay.
    Sunil

    Hi Virender,
    Value in SXMB_MONI in SUS is correct.
    <NetUnitPrice>
      <Amount currencyCode="USD">73.51</Amount>
      <BaseQuantity unitCode="MTK">1000</BaseQuantity>
      </NetUnitPrice>
      </Price>
    but in BBAP_PD (table BBP_PDIGP) entry is :
    PRICE                                  0,07
    PRICE_UNIT                       1
    PRICE_ORIGIN
    VALUE                                  147,02
    Normally it  should PRICE 73.51 and PRICE_UNIT 1000 ,any guess we are in SRM4.0?
    Thanks
    Sunil

  • Unit price issues

    HI!
    In m my smartform Im getting the unit price for my invoice from the condition table directly instead of calculating it (Total / Quantity) which creates the rounding up issues. SO this works fine for us but the problem occurs when the condition pricing is like 300/ 1000 L or 4000/ 1000Kgs , what happens is that in the output the unit price and quantity when multiplied contradicts , though the net price per line item shows correctly but suppose qty is 3 L and the unit price is 300/1000L so total os .9 dollars which is correct but in  the form out put it shows  qty= 3 unit price 300  and total .9 dollrs, which si contracdictory, so what I did I used a calculation gaain and divided by condition price by condition pricing unit so when its 300/1000L it would show .3 /L which is now ok but another problem rose with metric ton, since the selling unit is MT and the unit price now after dividing by condition pricngi unit makes it per KG so output would show like qty =3 unit price  4 and total = 12000 dollars , so heer unit price is wrong as it should have been 4000/ Ton as the total os 12000 dollars.
    Is theer a way out to show the correct unit pricing as per the sales unit. I had used the code to just divide the total price of line item  divided by the Quantity but then the rounding up issues came up which was not required .
    read table is_bil_invoice-it_kond into gs_kond
    with key bil_number = gs_gen_del-bil_number
    itm_number = gs_gen_del-itm_number.
    if sy-subrc = 0.
      g_unit_price = gs_kond-kbetr / gs_kond-kpein.
    else.
    ** Loop around and get the price for it
      loop at is_bil_invoice-it_kond into gs_kond
      where bil_number = gs_gen_del-bil_number and
      itm_number = gs_gen_del-itm_number.
        if gs_gen_del-fkimg <> 0.
             g_unit_price = gs_kond-kbetr / gs_kond-kpein.
          endif.
    *  g_unit_price = g_item_tot / gs_gen_del-fkimg.
        endif.
      endloop.
    endif.
    * Get unit price and tot price.
    g_item_tot = gs_gen_del-netwr - gs_gen_del-kzwi3.
    *IF gs_gen_del-fkimg <> 0.
    *  g_unit_price = g_item_tot / gs_gen_del-fkimg.
    *ENDIF.
    thanks

    Well we would ike to grab the unit price directly from the condition mentioned in the billing documents , thats the reason this issue has errupted , We would like to pull it directly from teh document onto the invoice but as I said when its given per 1000 L or /1000 Kgs then the problem occurs as teh quantity may be in MT and the unit price in the condition on document maybe like 4000 dollars per 1000 KGS so it takes 4000 and multiplies bny quantity which is in MT which is 1000 times more than teh correct value. SO as per my piece of code its grabbing the unit price directly from teh condition in the billing document . If I just divide this unit price that I am gettimng from the condition table in Doc by the condition rate KPEIN then it works ok except in few cases like MT. The quantity will show 3 MT suppose and the unit price will be 4000/1000 = $4/ kgs so this will contradict the units but in case of per 1000L it would be ok as the resultant will be in litres only but in case of MT its converted to Kgs so basically a client will see 3 MT QTY for 4 / Kgs  and price will be 12000 dollars which dosent look alright though teh resultant is correct prioce.
    SO this becomes a special case when we dont need to divide by condition unit rate . My question is can be give such kind of exceptions in our code and proceed or will be wrong.
    Thanks

  • Unit price validation in Purchase Order, Goods Receipt PO and A/R Invoice

    Hello!
    I want to have validation of the Unit Price field in Purchase Order, Goods Receipt PO and A/R Invoice documents.
    This means that user has to get some kind of message if she/he do not enter the Unit price in above mentioned documents.
    I can not use the price lists for this, to get the field populated automatically, because I do not have all the prices...
    I am no longer newbie when it come to SAP, but this really puzzles me
    Thanks,
    Dejan

    Hello guys,
    I have tried to add this code to check if the field Unit Price was empty in the Purchase Order form (Object ID 22)
    But it gives me an error message - Error converting data type varchar to numeric (CINF)
    I am getting the same error message even if I have some value in the Unit Price field...
    I am really confused - what is wrong with it???
    Here is the code from the Transaction notification
    IF (@object_type = N'22' AND @transaction_type in (N'A', N'U') )
         BEGIN
              IF EXISTS (SELECT T1.DocEntry FROM OPOR T0 inner join POR1 T1 on T0.DocEntry = T1.DocEntry
              WHERE (T1.PriceBefDi IS NULL OR T1.PriceBefDi = ' ') AND T0.DocEntry = @list_of_cols_val_tab_del)
                   BEGIN
                        Set @error =1
                        set @error_message = 'Unit Price cannot be blank'
                   END
         END
    Thanks,
    Dejan

  • Rounding off Issue (Net Value not equal to Net Price * quantity)

    Dear Gurus,
    Here is an interesting issue.The default calculation done in the pricing procedure is two decimal places.Now we consider a real scneario,consider the net value of 324 quantities of an item calculated is 36,049.86 .When it is divided by quantity  the resulting value of net price is 111.265 but the system shows 111.27 by rounding it off.
    Now here comes the problem,my client needs the rate to be shown on the order script to be two decimal places and the net value should be equal  quantity * net price.So if we apply this,
    324 * 111.27 = 36051.48
    But the net value calculated by the system is 36,049.86.So it can be consluded that:
    "Quantity * Net Price Shown is not Equal to Net Value calculated by the System"
    Need an urgent resolution,project is stuck on this
    Regards,
    Sam Ahmed
    Edited by: Lakshmipathi on Nov 3, 2011 12:14 PM
    Please dont add URGENT in subject or in your post

    Here is the pricing procedure,
    We start with the amount condition types
                                            Unit Price        Units Condition Value
    ZMRP     MRP                     1,700.00           10     PAC     55,080.00      
    ZTRP     Trade Price     1,445.00           10     PAC     46,818.00      
    ZDPR     Dist. Price     1,445.00           10     PAC     46,818.00         (GL)
    Using Trade Price we apply the product discount of 23%
    ZPRD     Product Discount     23.000-     %                    10,768.14-
    Then we send discount amount to the gl by using condition type ZDIS
    ZDIS      Discount Value     100.000-     %           10,768.14-      (GL)
    tHE RESULTING NET VALUE IS  36,049.86      as 46818.00 - 10,768.14
         Order Item value     111.27      1     PAC     36,049.86      
    And the Net Price is 111.27

  • Wrong unit price on the invoice.

    Hi guys,
    Im requested to look at the production issue where an invoice gets its unit price printed incorrectly, though the other things such as gross weight, net weight , quantity and amount are printed correctly.
    also we have the sapscript which calls function module in other abap program.
    Guys any ideas on this issue please post them.
    Thanks,
    Venkat

    Hi,
    You need to sit with ABAPer and debugg the program and check why the value is printing wrongly.He is the only one who can solve your problem.
    Reward points if useful
    Regards,
    Amrish Purohit

  • Unit Price after Discount/Rounding

    For sales documents, we are currently using the Discount% column to include additional fees to an item's unit price. Ex: sales price list u/p of $0.60 * Discount of -5% = billed u/p of $0.63 (Price after Discount includes $0.03 hub fee). We have this setup as we are calculating commission based on the price list u/p. The above example rounds nicely, but the problem comes about when the figures are not even. For example an item with list price of 4.54 must be billed at 4.65. The resulting discount% is -2.4229074... Although rounding will show the correct u/p of 4.65, the row/doc total calculations will be carried out at 4.649999... For high volume orders, this will create a noticeable price discrepency. Is there a way to enter the Price after Discount field manually? Thank you.

    Hi Allen,
    Check in:
    Administration -> System Initialization -> Document Settings -> Generla Tab:
    'Calculate Row Total Using Unit Price'.
    If this box is checked in 2005 the field 'Price after Discount' will not be active even if it is set as active in the Form Settings of the document.
    In 2007 for a database that was created in 2007 this field cannot be activated as far as I know.
    From what I remember a db that has been upgraded from 2005 to 2007 this field can still be activated.
    I hope it helps.
    Jesper

  • AR Invoice - Source for unit price

    Hi,
    The concurrent program "Invoice Print BPA Child Program" (ARBPIPCP) prints the output in pdf format. We had created an SO with unit price as 3 decimal points and created invoice by running Autoinvoice Master program. The invoice is created with 3 decimal points
    Unit_selling_price - 0.315
    Quantity - 50000
    Extended price - 15750
    Unit_standard_price - 0.32
    But in Invoice print it shows unit price as 0.32 and extended price as 15750
    Please let us know why it is giving unit price as 0.32 (Unit_standard_price) and extended price calculated from 0.315 (Unit_selling_price). Or is it just rounding off the unit selling price to two decimals. If so, where should I set the precision to display properly. Please help.
    Thanks,
    Prasanna

    Please check if this query meets your need:
    Select T2.City 'Customer City', T2.State1 'Customer State',
    T2.ZipCode 'Customer ZIP', T0.ItemCode 'Part#', T0.Quantity,
    T1.DocNum 'Invoice#', T1.DocDate 'Invoice Date',
    T0.GrossBuyPr 'Unit Cost',T0.Price 'Unit Price', T1.CardCode 'Customer Code', T1.CardName 'Customer
    Name', T1.NumAtCard 'Customer PO', T0.ShipDate 'Ship Date'
    From INV1 T0 INNER JOIN OINV T1 ON T1.DocEntry =
    T0.DocEntry
    LEFT JOIN OCRD T2 ON T2.CardCode = T1.CardCode
    LEFT JOIN OITM T3 On T3.ItemCode = T0.ItemCode
    Where T1.DocType = 'I' and DateDiff(MM,T1.DocDate,
    GetDate()) = 1
    In this query, only the invoices are showed.  If you need Credit Memo too, use Union All to add those tables.
    Thanks,
    Gordon

  • How to round unit price in XSL-FO Standard Purchase Order

    I have been trying to round the unit price of the Standard Purchase Order stylesheet that is written in XSL-FO. Please could someone suggest I how I could achieve this? As my attempt have been unsuccessful. In the stylesheet the following line of code returns the unit price.
    <xsl:value-of select="UNIT_PRICE"/>
    Thank you,
    Mark

    I assume you are talking about number formatting:
    You can use the XPATH function format-number:
    <xsl:value-of select="format-number(UNIT_PRICE,"####.#")"/>
    This will ONLY work if UNIT_PRICE is a correct XSL number (meaning no thousand seperator). Otherwise you can probabley remove the , out of say 1,234,567 using the
    translate function translate(UNIT_PRICE,",","") - Please check any XSL reference for additional information.
    Hope that helps,
    Klaus

  • Creating order form and need Java Script to calculate unit price and quantity in Acrobat Pro.

    Hi,
    I am creating order form in Acrobat Pro , and I have
    code
    Order Quantity
    Unit price $
    201
    500
    $ 0.52
    201
    1000
    $ 0.36
    202
    300
    $ 0.26
    202
    500
    $ 0.2
    How make Subtotal and Total price with Java script.
    I do not know how to write java script.
    Anyone can help me?
    Thanks,

    Thanks for your response. I have 2 quantities and 2 Unit price for each code, I know a simple sum in calculation it works for 1 unit price and quantity.  Can you please let me know how to do it? One of the expert sent m this:
    //change field names as needed
    var qt1 = this.getField("qt1").value;
    var up1 = this.getField("up1").value;
    var qt2 = this.getField("qt2").value;
    var up2 = this.getField("up2").value;
    event.value = (qt1 * up1) + (qt2 * up2);
    I put this in total text field (calculation tab , Custom script) , but it  did not worked.
    I appreciate it if anyone can help or give me  suggestion.

Maybe you are looking for

  • While trying to open Open Directory, I get  a setState error

    I'm runing Server 2.2 on a new 2012 Mac Mini 2.6 running Mountain Lion 10.8.2 My server was running fine for over a month then I updated to Server 2.2 from 2.1 and I lost my Open Directoy and it would not restart. I kept getting this message. Then al

  • [SOLVED]Gnome 3.4 is not suspending when the lid is closed.

    Hey.. Since upgrading to gnome 3.4.1, my laptop does not suspend when the lid is closed. I have read this this thread without getting a clear answer... I have checked the setting in gnome tweak tool, and they are both set to "Suspend" The laptop has

  • Sending an email to a group

    I have a group and want the group name to show up in the "To" line of a new email rather than "undisclosed recipients" Is there a way to do that? Thanks!

  • To Do's Not Showing Up on Published Page

    I use iCal to publish a class calendar for the classes I teach. When I publish their calendar to MobileMe it gives me a URL to view the calendar. This is the URL I give to my students. Viewing my calendar through me.com, the calendar comes out great.

  • ORA-24247: network access denied by access control list (ACL)

    Hi All, I am sending a mail thru OWB 11g ( and using database 11g) after successful or failure of process. My process is completing successfully but am not able to send mail. At the time of sending mail it is giving me error as below ORA-24247: netwo