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
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