Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 7999

Creating Sales Order via External VB.net Application Fails

$
0
0

Hallo Experts ,

 

I am   have developed  an VB.NET application  that i would like to create a  Sales order via code  i have also provided that correct configuration set up via code . The  problem is that this code  doesn't  work  .Would someone kindly give a solution. Below is my code  the code  doesn't throw any error

 

Dim oComp As New SAPbobsCOM.Company

        With oComp

            .Server = "WINCCPC-PC\WINCC"

            .DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2008

            .LicenseServer = "localhost:30000"

            .UserName = "manager"

            .Password = "manager"

            .CompanyDB = "SBODemoUS"

            .Connect()

            Dim oOrder As SAPbobsCOM.Documents = DirectCast(oComp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders), SAPbobsCOM.Documents) ' Order object

            oOrder = oComp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)

            ' Fill Order details

            oOrder.CardCode = "C40004"

            oOrder.CardName = "TRIALS"

            oOrder.HandWritten = SAPbobsCOM.BoYesNoEnum.tNO

            oOrder.DocDate = Now()

            oOrder.DocDueDate = Now()

            oOrder.DocCurrency = "USD"

 

 

            'Fill 2 lines in the order

            oOrder.Lines.ItemCode = "A00092"

            oOrder.Lines.ItemDescription = "IBM Inforprint 1312"

            oOrder.Lines.Quantity = 1

            oOrder.Lines.Price = 380

            oOrder.Lines.TaxCode = "0"

            oOrder.Lines.LineTotal = 380

 

 

            oOrder.Lines.Add()

            oOrder.Lines.ItemCode = "A00093"

            oOrder.Lines.ItemDescription = "IBM Infoprint 1222"

            oOrder.Lines.Quantity = 1

            oOrder.Lines.Price = 380

            oOrder.Lines.TaxCode = "0"

            oOrder.Lines.LineTotal = 380

            oOrder.Lines.Add()

           

 

 

        End With


Viewing all articles
Browse latest Browse all 7999

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>