Skip to Content
author's profile photo Former Member
Former Member

Cannot create an Invoice with a negative line

I am tring to export an invoice with a negative row and I'm gettign an error here is an examlpe of what I'm doing .

Dim vDrafts As SAPbobsCOM.Documents

Set vDrafts = vCmp.GetBusinessObject(oDrafts)

vDrafts.DocObjectCode = oPurchaseInvoices

vDrafts.CardCode = "2"

vDrafts.ManualNumber = "222"

vDrafts.HandWritten = tNO

vDrafts.DocDate = Now

vDrafts.DocType = dDocument_Service

vDrafts.DiscountPercent = CDbl("0")

vDrafts.Lines.AccountCode = "100000"

vDrafts.Lines.ItemDescription = "TEST"

vDrafts.Lines.Price = 123

vDrafts.Lines.Quantity = 1

vDrafts.Lines.VatGroup = "6S"

vDrafts.Lines.DiscountPercent = CDbl("0")

vDrafts.Lines.Add

vDrafts.Lines.AccountCode = "100000"

vDrafts.Lines.ItemDescription = "TEST"

vDrafts.Lines.Price = -13

vDrafts.Lines.Quantity = 1

vDrafts.Lines.VatGroup = "6S"

vDrafts.Lines.DiscountPercent = CDbl("0")

RetVal = vDrafts.Add

and if I change to

vDrafts.Lines.Price = 13

vDrafts.Lines.Quantity = -1

then the invoice will be exported but the line will be positive .

Do you have any idea on what is wrong .

Thanks

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 04, 2005 at 03:17 AM

    SBO does not allow ( atleast with 2004A) to have a line item with zero or below price.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 04, 2005 at 06:35 AM

    Hi Mohamed,

    SBO will not let you set a negative line if the total amount of the document is negative.

    It can be done by hand in SBO, so you should be able to get it. Try doing the same as you do it by hand.

    I would try something like:

    vDrafts.Lines.Quantity = 1

    vDrafts.Lines.Price = -13

    Hope helps,

    Ibai Peñ

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 14, 2005 at 07:17 PM

    Just to let you know that the problem was fixed . I was usign a beta version of sapb1 . The same code works fine with the official version .

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.