Unit Price and Document Total in a Marketing Document

Hi Experts,
I am trying to post a marketing document through the DI API.  I have assigned value to the document lines as follows:
                sapDocument.Lines.ItemCode = items.MaterialCode;               
                sapDocument.Lines.Quantity = items.Quantity;
                //sapDocument.Lines.Price = items.Price; // tried assigning to both Price and Unit Price
                sapDocument.Lines.UnitPrice = items.Price;
                //sapDocument.Lines.LineTotal = items.LineTotal // Also tried assigning this.
All my documents have been successfully posted in SAP Business One except that there is no Price saved and therefore follows that my Line Total and Document Total are all 0.00.
Hope someone could help me out.
Thanks.
Melvin Balingit

Hello Guys,
So the correct method is
first assign the unitprice, than assign the qty.
Dim oDoc As SAPbobsCOM.Documents = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
        oDoc.CardCode = "C20007"
        oDoc.DocType = BoDocumentTypes.dDocument_Items
        oDoc.DocDueDate = Today
        oDoc.Lines.ItemCode = "A00002"
        oDoc.Lines.Quantity = 2
        oDoc.Lines.UnitPrice = 100
        oDoc.Lines.Add()
        oDoc.Lines.ItemCode = "A00003"
        oDoc.Lines.Quantity = 2
        oDoc.Lines.UnitPrice = 100
        If oDoc.Add <> 0 Then
            MsgBox("Erreur " + oCompany.GetLastErrorDescription())
        Else
            Dim newCode As String = oCompany.GetNewObjectKey()
            MsgBox(newCode)
            AddInvoiceEx(newCode)
        End If
Regards
János

Similar Messages

  • Total calculation based on unit price and UDF field values

    Hi All,
    This is for a construction related company. Please find attached screen shot for details.
    My scenario is when we are creating sales order my client wants to calculate the total amount based on unit price towards the UDF fields defined. For example user will give the unit price  per sqft in Unit price ie 2800 as per screen shot column and constructed area in Sqft in he will enter the area like cons area in sqft =1500. So this 1500 need to calculate with unit price and will display in total. So in Total field it should show like 2800*1500= result. Like wise other amount values in udf needs to be calculated and displayed in total field  .
    Is this possible in SAP B1. Please help me with your valuable suggestions.

    Hi,
    Try this:
    SELECT ($[$38.U_Price.number]* $[ORDR.U_CArea.number)+ $[ORDR.U_EBexp.number]+ $[ORDR.U_RO.number]+ $[ORDR.U_Maintenance.number]+ $[ORDR.U_CorpFund.number]
    Thanks & Regards,
    Nagarajan

  • 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.

  • How to validate the line item values in OFR - quantity , unit price and UOM

    Hi All,
    Is there any possibility to validate the line items like quantity, unit price and UOM against the DB and stops those invoices at verifier (1 batch =10 invoices) level  if yes could you please let me know the process how to proceed further.
    due to this some the invoices are coming to OFR is with incorrect quantity, UOM and unit price different from PO lines information like quantity , UOM and unit price and those invoices are not validating from the DB and these are processed to EBS and it's effecting the GL and reporting.
    Regards,
    Anil

    Hi ,
    I did not get the exact requirement.Let me bit:
    In standard AP project lines validation will try to compare the quantity , unit price and UOM of line against the database for match which actually performed on export.
    So even if match fails batch will be exported.Now if you want to correct it before EBS,i think you can do it in the business process easily that you are consuming whether BPEL/BPM process.
    We have done this in several projects
    =========================
    But If you want that to be done from OFR side i think we need to code  UserExitPONumberValidate event to  compare the line items values against database.I need to test this also.

  • Decimal Place settings for  'Total' field in Marketing documents.

    Dear sir,
    I'm Using SAP B1 2005B Patch Level 5
    I want to know which Decimal places setting i have to set for'Total'
    Field in all Marketing documents.I want to know whether it come's under
    Prices settings or Amounts setting.

    Jambulingam,
    The no. of decimals is set  in the Administration  -System Initialisation -  General settings - Display tab . There on the left hand side you can see the settings for decimals.
    Since it is a total you wil have to set it for Amounts.
    Nagesh

  • Unit Price and Discount % is INACTIVE

    Hello Experts,
    In A/P Invoice unit price column is inactive rather not allowing to enter value in it. In form settings it is active.
    Help Required.
    Shazad Nazir

    Nazir
    I guess full authorization is needed to enter unit price, check in
    Sales Reports --> Change Row Amounts --> Full Authorisation
    and also have a look at this thread
    Authorisation for GRPO
    Thanks
    Rizz

  • Showing Zero Unit Price/Row Total

    Hi,
    We currently allow posting rows for item sales with zero unit price. I am having trouble showing the unit price and row total as "$0.00" instead of a blank field with PLD. Both of these fields are system variables (80 and 84), neither field is linked to itself, and neither field has the 'Suppress zeros' box checked. Any possible solution to this? Thank you.

    Hi there,
    You could try using a formula type field and multiplying your system variable field by 1.
    - Say for example your Unit Price field has a Unique ID of F_100.
    - Create a new line Formula field and set its value to Round(F_100*1,2).
    - This will display your zero value unit price as 0.00.
    - Note that I'm only using Round() to display zeros after the decimal place, otherwise the zero value unit price would appear as 0. So change the number of decimals as required.
    - Unfortunately this removes the currency code display from the value so you will need to re-display it if required, you can do this using a database type field and selecting the Price Currency field.
    Do the same for row total. Hope that helps.
    Regards,
    Andrew.

  • Sales quotation without unit price & total shows a error invalid total INR

    Dear All,
    According to my clients requirement,iam creating a sales quotation without unit price and total .
    Now when iam copying it to a sales order,it is showing me a error "Invalid Total INR".
    I could not understand why and how it is happening.
    Can anyone help me out.
    Regards,
    Meghana

    sir,
    i tried removing FMS still it is coming.........
    The surprise thg is in certain sales quotation without unit price and total there is no such error and it is converted into order, but the issues is wiyth certain old sales quotations.
    Regards,
    Meghana
    Edited by: MEGHSHILPK on Nov 8, 2010 12:11 PM

  • Is there a link between the Journal tables and the Marketing Document tables?

    Hi Everyone,
    Is there a link back from the Journal Tables (e.g.: OJDT and / or JDT1) to the Marketing Documents tables (e.g.: OINV and / or INV1)?
    If there is a link can you please let me know what it is?
    Kind Regards,
    David

    David..
    Try This
    Select T1.RefDate,
    Case
    When T1.TransType=13 Then 'Invoice'
    When T1.TransType=14 Then 'A/R Credit Memo'
    When T1.TransType=15 Then 'Delivery Note'
    When T1.TransType=16 Then 'Delivery Return'
    When T1.TransType=162 Then 'Stock Revaluation'
    When T1.TransType=18 Then 'Purchase Bill'
    When T1.TransType=19 Then 'A/P Credit Memo'
    When T1.TransType=20 Then 'GRPO'
    When T1.TransType=202 Then 'Work Order'
    When T1.TransType=21 Then 'Goods Return'
    When T1.TransType=24 Then 'Incoming Payment'
    When T1.TransType=30 Then 'Journal'
    When T1.TransType=46 Then 'Outgoing Payment'
    When T1.TransType=59 Then 'Goods Receipt'
    When T1.TransType=60 Then 'Goods Issue'
    When T1.TransType=67 Then 'Stock Transfer'
    Else T1.TransType
    End [TransType],
    T1.TransId,
    Case
    -- Sales A/R
    When T1.TransType = 13 Then (Select isnull(Comments, '') From OINV Where DocNum = T1.BaseRef and CardCode = T1.ShortName) -- Invoice
    When T1.TransType = 14 Then (Select isnull(Comments, '') From ORIN Where DocNum = T1.BaseRef and CardCode = T1.ShortName) -- A/R Credit Memo
    When T1.TransType = 15 Then (Select isnull(Comments, '') From ODLN Where DocNum = T1.BaseRef and CardCode = T1.ShortName) -- Delivery
    When T1.TransType = 16 Then (Select isnull(Comments, '') From ORDN Where DocNum = T1.BaseRef and CardCode = T1.ShortName) -- Delivery Return
    -- Purchase A/P
    When T1.TransType = 18 Then (Select isnull(Comments, '') From OPCH Where DocNum = T1.BaseRef and CardCode = T1.ShortName) -- Purchase Bill
    When T1.TransType = 19 Then (Select isnull(Comments, '') From ORPC Where DocNum = T1.BaseRef and CardCode = T1.ShortName) -- A/P Credit Memo
    When T1.TransType = 20 Then (Select isnull(Comments, '') From OPDN Where DocNum = T1.BaseRef and CardCode = T1.ShortName) -- GRPO
    When T1.TransType = 21 Then (Select isnull(Comments, '') From ORPD Where DocNum = T1.BaseRef and CardCode = T1.ShortName) -- Goods Return
    -- Production
    When T1.TransType = 202 Then (Select isnull(Comments,'') From OWOR Where DocNum = T1.BaseRef and PostDate = T1.RefDate) -- Work Order
    -- Banking
    When T1.TransType = 24 Then (Select isnull(Comments, '') From ORCT Where DocNum = T1.BaseRef and CardCode = T1.ShortName) -- Incoming Payment
    When T1.TransType = 46 Then (Select isnull(Comments, '') From OVPM Where DocNum = T1.BaseRef and CardCode = T1.ShortName) -- Outgoing Payment
    When T1.TransType = 30 Then (Select ISNULL(LineMemo, '') From JDT1 Where Ref1 = T1.Ref1 and ShortName = T1.ShortName) --  Journal
    -- Inventory
    When T1.TransType = 59 Then (Select ISNULL(Comments, '') From OIGE Where DocNum = T1.Ref1 and DocDate = T1.RefDate) -- Goods Receipt
    When T1.TransType = 60 Then (Select ISNULL(Comments, '') From OIGN Where DocNum = T1.Ref1 and DocDate = T1.RefDate) -- Goods Issue
    When T1.TransType = 67 Then (Select ISNULL(Comments, '') From OWTR Where DocNum = T1.Ref1 and DocDate = T1.RefDate) -- Stock Transfer
    When T1.TransType = 162 Then (Select ISNULL(Comments, '') From OMRV Where DocNum = T1.Ref1 and DocDate = T1.RefDate) -- Stock Revaluation
    Else ''
    End [Remarks],
    T1.LineMemo,
    Case
    When exists (Select AcctCode From OACT Where AcctCode = T1.ContraAct)
    Then (Select AcctName From OACT Where AcctCode = T1.ContraAct)
    else (Select CardName From OCRD Where CardCode = T1.ContraAct)
    End [Account],
    Case
    When T1.Debit=0.0
    Then 0.0
    Else T1.Debit
    End Debit,
    Case
    When T1.Credit=0.0
      Then 0.0
    Else T1.Credit
    End Credit
    From JDT1 T1
    Where T1.TransType <> -3
    And T1.RefDate Between @FromDate and @ToDate
    And T1.ShortName = @Account
    Order By T1.RefDate,
    T1.TransId
    Regards
    Kennedy

  • Reconnect base and target document if duplicate marketing document

    How can you reconnect the links between the base and target documents when you duplicate marketing documents? 
    For example,  an error was made during the entry of the GR PO and we performed the Goods Return.  However, when you create a Goods Receipt PO and then a Goods Return, the original PO is now closed.  How can you re-open the original PO or else link a new target document to it?
    Thank you.

    Thats right.  You can create a new business process for Exceptions and exceptions have to handled as a one off situation.
    I would suggest you take measures to minimize the error by putting business rules in place and for these one off situations simply type in the PO / SO number in the remarks.
    Creating all document is a big efforts.
    Suda

  • 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 shows discounted value...

    I added a Discount column to a quotation page so I can line item discounts, I placed it after the Unit Price. When I add a line item discount it shows the discount value in the Unit Price column. How do I get it to retain the original Unit Price and have it show the discounted price at the end? In addition if there is a 100% discount it shows the obvious zero value. I am not too familier with the PLD so I do not know the correct protocol for setting up a formula, if that is neccessary.
    Thanks

    At the row level there are 2 columns.
    Unit Price
    Price After discount
    Make sure both these fields are enabled.
    Also, in Admin > System init > Document Settings > General Tab ..Calculate the Row total using Unit price ....... should be unchecked

  • Trying to download orders with unit price detail

    I'd like to download orders with unit price, number of units, and line item total charge without the sales tax applied.  The itemization is in the order emails, but I seem to only be able to get a line item total including tax in an export file.  I'd have to know the unit price and do the math in order to import these orders into our Great Plains system.  That sounds like it's going to generate errors in tax withholding as prices change.
    Can I get unit price, subtotal, and tax broken out in an export file?
    Thanks
    Marty

    Hi Marty,
    Unfortunately the system is limited to what the report generator provides at this stage.  I'm afraid this would need to be a wishlist/enhancement request in this case. 
    Kind regards,
    -Sidney

  • How to find the unit price of a Material

    Hi Friends,
    Please help me in finding the field for Material unit price or How do I calculate the Unit price of a Material.
    because in webdynpro screen user will entering only Material number,quantity. for that material I need to find the Unit price and calulate the to total amount like ( quanity * unit price) and put it in total amount column.
    For that I require unit price of a material,I have plant,sales org.storage location.
    is there any function modules for that?
    Please help me in finding the unit price.
    Regards,
    Xavier.P

    Hi
    See table MBEW. The value or price is in terms of UoM that you have in MARA-MEINS (base unit measure). You have 2 diff. prices: variable and standard in function of type (field VPRSV).
    Regards
    Eduardo
    Edited by: E_Hinojosa on Aug 12, 2011 10:49 AM

  • Creating a Formatted Search in Item Master based on Unit Price

    Hi Experts,
    I have to create a Formatted Search for assigning the Standard Cost of Items as Selling Price-Selling Price*.05  i.e the Standard cost of the item should be set upon automatically equal to 5% less of Selling Price .
    I have created the following Formatted Search Query :
    SELECT ((SELECT $[$34.68.NUMBER])-(SELECT $[$34.68.NUMBER] *.05))
    and have assigned this FS to Standard Cost Field . I am not able to base it upon Unit Price field . This FS is correct but it is not automatically refreshing upon change of Unit Price and I have to manually update it(ALT+F2) . I guess the filed upon which it should be based upon is not correct .
    please guide me how to resolve this issue . How to base this FS upon Unit Price.
    Thanks and Regards,
    Pooja Singh.

    Hi,
    Actually I dont want to set upon the last No for the Series. What about the Sequence ? Administration->setup->financials->Tax->Sequence. Here also the same thing can be done but Location Specific. When I created 2 Series for the two different locations , I found that two different fields appeared on the screen Sequence Name Where I found the two sequences I defined for the two locations. If you have any idea about what this sequence is for and how far is it different from Document Series , please let me know.
    Thanks and Regards,
    Pooja Singh

Maybe you are looking for

  • BP Duplicate check

    Hi To all Can anyone revert on how to avoid duplicate creation of BP based on address,we checked on customisation & few BAdi's but could not figure out. Thanks in advance, Shiva

  • Services Configuration Text File

    On Solaris 10 wasn't there a services configuratin text file. Say example I wanted to disable FTP there used to be a file where I placed a # in front of the Service, or am I thinking of Linux?

  • Video in trash?

    Yikes...desperately need some help! All set to work on my master's project when I found my project to be gone in FCP. Somehow all my video is in my Trash can. I am a nervous wreck trying to remedy this situation but have little computer knowledge whe

  • Clean install lion when already on Lion?

    How do I clean install lion when i'm already on lion?

  • Can IEEE 488.2 Labview software/drivers used on a IEEE 488.1 instrument

    I have a IEEE 488.1 device but am using a IEEE 488.2 Labview software/driver package.  Measurement and Automatiion tells me that the IEEE 488.2 board is working properly but there is no communication between the board and the device. Is IEEE 488.2 do