SAP and ,acros

Status
Not open for further replies.

priya_anthony

Board Regular
Joined
Jul 17, 2007
Messages
64
Hello Experts


This what the code is like for SAP connection for BAPI with inpout parameters from the form and the output parameteres needs to be displayed on to an other form so kidly help me with the code part of it


Thanks
Priya



Private Sub callBAPI()

Dim oBAPIHelp
Dim oIAstnr As Object, oIAstna As Object 'Input parameter
Dim oReturn As Table, oMessages As Table, _
oApplHelp As Table 'Output parameters




If Not CheckSAPConnection Then
Exit Sub
End If

'Make an instance of SAP object

Set oBAPIHelp = objBAPIControl.GetSAPObject("BAPISHELP")


'Set input parameters of the BAPI
Set oIAstnr = frmApplicant.txtApplicantNo.Text
Set oIAstna = frmApplicant.txtApplicantName.Text



'Get a reference to the output parameters so they can be consulted
'after calling the BAPI
Set oApplHelp = objBAPIControl.DimAs(oBAPIHelp, "ApplicantHelp", "APPLHELP")
Set oMessages = objBAPIControl.DimAs(oBAPIHelp, "ApplicantHelp", "MESSAGES")
Set oReturn = objBAPIControl.DimAs(oBAPIHelp, "ApplicantHelp", "RETURN")


'Call object's method with applicant name *Care*
oBAPIHelp.ApplicantHelp _
IAstnr:="", _
IAstna:="*Care*", _
ApplHelp:=oApplHelp, _
MESSAGES:=oMessages, _
RETURN:=oReturn

If oApplHelp.RowCount > 0 Then
MsgBox "Data found"

Else
On Error Resume Next
MsgBox "Errors."
End If

End Sub
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Status
Not open for further replies.

Forum statistics

Threads
1,181,649
Messages
5,931,217
Members
436,784
Latest member
amuljono

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top