priya_anthony
Board Regular
- Joined
- Jul 17, 2007
- Messages
- 64
Hi experts need your help
i m looking to get the data from SAP and display it on to a grid so can i use a data grid for the same if so how can that be done
kindly help im just posting the code below if anything can be done to get the same below code uses a msgboc saying data found i would require a grid to display the same so
kindly help..............
Private Sub callBAPI()
Dim oBAPIHelp
Dim oIAstnr As Object, oIAstna As Object 'Input parameters
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
I_ASTNR = frmApplicant.txtApplicantNo.Text
I_ASTNA = 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
For Each Row In oApplHelp.Rows
If oApplHelp.RowCount > 0 Then
MsgBox "Data found"
Else
On Error Resume Next
MsgBox "Errors."
End If
Next
End Sub
i m looking to get the data from SAP and display it on to a grid so can i use a data grid for the same if so how can that be done
kindly help im just posting the code below if anything can be done to get the same below code uses a msgboc saying data found i would require a grid to display the same so
kindly help..............
Private Sub callBAPI()
Dim oBAPIHelp
Dim oIAstnr As Object, oIAstna As Object 'Input parameters
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
I_ASTNR = frmApplicant.txtApplicantNo.Text
I_ASTNA = 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
For Each Row In oApplHelp.Rows
If oApplHelp.RowCount > 0 Then
MsgBox "Data found"
Else
On Error Resume Next
MsgBox "Errors."
End If
Next
End Sub