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

How to Add Sales order from one database to another database

Hi All,

I am trying to add sales order with sales order object.

I have completed connectivity from one database to another database.

but i am unable to post sales order with orders object.

My code is

ObjSales = objMain.objUtilities.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)

ObjSales.DocDate = Date.Parse(System.DateTime.Now().ToString("d"))

ObjSales.DocDueDate = Date.Parse(System.DateTime.Now().ToString("d"))

ObjSales.TaxDate = Date.Parse(System.DateTime.Now().ToString("d"))

ObjSales.CardCode = "C0006"

ObjSales.Series = 92

ObjSales.PaymentGroupCode = 3

ObjSales.Comments = "vivek"

ObjSales.Lines.Add()

ObjSales.Lines.SetCurrentLine(1)

ObjSales.Lines.ItemCode = "5127"

ObjSales.Lines.Quantity = 100

ObjSales.Lines.UnitPrice = 10

ObjSales.Lines.WarehouseCode = "01"

ObjSales.Lines.TaxCode = "0"

ObjSales.Lines.DiscountPercent = "0.00"

ObjSales.DocTotal = 1000

If ObjSales.Add <> 0 Then

objMain.objApplication.SetStatusBarMessage("Sales or Not Posted", SAPbouiCOM.BoMessageTime.bmt_Short, True)

Exit Sub

else

objMain.objUtilities.ShowSuccessMessage("Sales Order Posted successfully")

End If

The above code is executing successfully.But the Sales order is not getting added.

Thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on May 02, 2011 at 09:39 AM

    Hi Vivek,

    If the code you posted is not throwing any errors, then the order really does get created. Apparently just not to both databases, am I correct ?

    > I have completed connectivity from one database to another database.

    That means that apparently you have not gotten this bit right.

    Generally speaking if you want to create an order into two databases, you first need to connect to both databases and create separate order objects for each database. So you need to do this bit twice; once for each database. Something like this:

    ObjSales1 = objMain.objUtilities1.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
    ObjSales2 = objMain.objUtilities2.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)

    Then at the end you also need to add both objects separately:

    If ObjSales1.Add <> 0 Then
    etc.
     If ObjSales2.Add <> 0 Then
    etc

    Good luck,

    Johan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 02, 2011 at 10:27 AM

    hi vivek.Y

    you can use B1isn solution for your issue . (SAP Business One Integration for SAP NetWeaver). you can download document in

    SAP channel parner portal or looking for Forum.

    thanks

    H2

    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.