Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

how to connect visual basic with sap

Former Member
0 Likes
497

hi

i want to connect vb system and sap system.can any1 help me?

2 REPLIES 2
Read only

Former Member
0 Likes
456

Hi,

You can access function modules of SAP from VB application by using RFC, BAPI and Webservices in SAP. So based on your requirement, check out relevant function modules in SAP and call them from VB.

Reward points if helpful.

Regards,

CS.

Read only

Former Member
0 Likes
456

Hi

Using BAPIS u statrt communicating with vb or java --etc.

For example,

U want tot connect vb .U need to use the component

SAP.BAPI.1 Component.

U design a form in vb,

Declarations:

Public obj As Object

Public boOrder As Object

Public oHeader As Object

Public oHeaderde As Object

Public oHeaderup As Object

Public oHeaderin As Object

Public conn As Object

Public ovalues As Object

Public oReturn As Object

Public x As String

In form load event:

Private Sub Form_Load()

On Error GoTo err1

Form_Timer

Set obj = CreateObject("SAP.BAPI.1")

Set conn = obj.connection

conn.logon

Set boOrder = obj.GetSAPObject("ZBAPISTUD(bapiname)")

Set oHeader = obj.dimas(boOrder, "ZbapiSearch(bapi method name)", "STUD") 'searching the record

Set oHeaderde = obj.dimas(boOrder, "DeleteStud", "STUD") 'deleting the record

Set oHeaderup = obj.dimas(boOrder, "ZbapiUpdate", "STUD") 'updating the record

Set oHeaderin = obj.dimas(boOrder, "CREATESTUD", "STUD") 'inserting the record

Exit Sub

err1:

MsgBox Err.Description

DoCmd.Close

End Sub

Every bapi is must a remote enabled fm. Every bapi method linked with a rfc fm.

If it is helpful rewards points

Regards

Pratap.M