Você está na página 1de 6

9/8/2016

ConnectionBetweenSAPandDotnet

Login Register

Forum

Articles

Ask Experts

Exams

Education

Study Abroad

More

Search

Subscribe to Email
Get Jobs by Email

Connection Between SAP and Dotnet

Forum posts by Email


Articles by Email

Awards
& Gifts
Posted Date: Total Responses: 0 Posted By: UltimateRenganMember
Level:
GoldPoints/Cash: 6

Connection Between SAP and Dotnet


IndiaStudyChannel
53616Megusta

Step1:
First add the Empty Project
File>New Project>Empty Project

Step 2:

Megustaestapgina

Registrarte

Selprimerodetusamigosenindicarquete
gustaesto.

Right click the Project Name>Choose Add Reference>Add Reference window will display >Choose COM Tab
>Choose SAP Business One DI API version 2007 and SAP Business One UI API version 2007 A>Then ok

Step 3:
Right click the Project Name>Add>Add NewItem>Module
Top Contributors
Step 4:
Import the System.Reflection name space.

Step 5:

http://www.indiastudychannel.com/projects/2837ConnectionBetweenSAPandDotnet.aspx

Today
Pramod 31
K Mohan 25
Phagu Mahato 22

1/6

9/8/2016

ConnectionBetweenSAPandDotnet

Create the objects for SAPbouiCOM and SAPbobsCOM

Last 7 Days
Pramod 903
Kailash Kumar 644

Add the below code in Module and run it

K Mohan 436
more...

Imports System.Reflection

Online Members

Module Module1

Sujoy Krishna Das

Public WithEvents application As SAPbouiCOM.Application

ar

Public company As SAPbobsCOM.Company

Gaurav

Public Function SetConnectionContext As Integer

Ank Arya

Try

rahulchouhan

Dim bnnStrCookie As String

Ramakrishna Kambhampati

Dim bnnStrConnectionContext As String

Timmy M.John

company = New SAPbobsCOM.Company

SATYAJIT MANDAL

bnnStrCookie = company.GetContextCookie

More...

bnnStrConnectionContext = application.Company.GetConnectionContextbnnStrCookie
If company.Connected = True Then
company.Disconnect
End If
SetConnectionContext = company.SetSboLoginContextbnnStrConnectionContext

Catch Ex As Exception
application.MessageBoxEx.Message

Finally

End Try

End Function
Public Sub SetApplication

http://www.indiastudychannel.com/projects/2837ConnectionBetweenSAPandDotnet.aspx

2/6

9/8/2016

ConnectionBetweenSAPandDotnet

Dim bonGuiSboGuiApi As SAPbouiCOM.SboGuiApi


Dim bnnStrConnectionString As String
bonGuiSboGuiApi = New SAPbouiCOM.SboGuiApi

Try
bnnStrConnectionString = Environment.GetCommandLineArgs.GetValue1
bonGuiSboGuiApi.ConnectbnnStrConnectionString
application = bonGuiSboGuiApi.GetApplication

Catch Ex As IndexOutOfRangeException
bnnStrConnectionString =

"0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D00560049004

90056"
bonGuiSboGuiApi.ConnectbnnStrConnectionString
application = bonGuiSboGuiApi.GetApplication

Catch Ex As Exception
application.MessageBoxEx.Message

Finally

End Try

End Sub
Private Sub Class_Init
SetApplication
If Not SetConnectionContext = 0 Then
application.MessageBox"Failed setting a connection to DI API"
End
End If
If Not ConnectToCompany = 0 Then
http://www.indiastudychannel.com/projects/2837ConnectionBetweenSAPandDotnet.aspx

3/6

9/8/2016

ConnectionBetweenSAPandDotnet

application.MessageBox"Failed connecting to the company's Data Base"


End
End If
application.StatusBar.SetText"Connected...", SAPbouiCOM.BoMessageTime.bmt_Short,

SAPbouiCOM.BoStatusBarMessageType.smt_Success
End Sub
Public Function ConnectToCompany As Integer

Try
If company.Connected = True Then
company.Disconnect
End If
ConnectToCompany = company.Connect

Catch Ex As Exception
application.MessageBoxEx.Message

Finally

End Try

End Function

Sub Main
Try
Class_Init

Catch Ex As Exception
application.MessageBoxEx.Message

Finally

End Try
http://www.indiastudychannel.com/projects/2837ConnectionBetweenSAPandDotnet.aspx

4/6

9/8/2016

ConnectionBetweenSAPandDotnet

End Sub

End Module

Project Feedbacks
No feedbacks found. Be the first to respond...

Post Feedback

Subscribe

Un Subscribe

You must Sign In to post a feedback.


Next Project: How to clear IE cache through vb.net
Previous Project: How to show Empty gridview using C#?
Return to Project Index
Post New Project

Related Projects
C programming language Fahrenheit and Centigrade Temperatures

Schedular

Visual C++ project files Download a file from a web page

How to create a window.

C Language Program For Find The Largest Number Among Three


Numbers
http://www.indiastudychannel.com/projects/2837ConnectionBetweenSAPandDotnet.aspx

5/6

9/8/2016

ConnectionBetweenSAPandDotnet

About Us Contact Us Copyright Privacy Policy Terms Of Use Advertise


ISC Technologies, Kochi India. All Rights Reserved.

http://www.indiastudychannel.com/projects/2837ConnectionBetweenSAPandDotnet.aspx

6/6

Você também pode gostar