priya_anthony
Board Regular
- Joined
- Jul 17, 2007
- Messages
- 64
Hi Experts
Desperately need your help
What actually the problem is the data is retrieved from SAP and the data needs to be displayed on to a form so kindly help jsut posting you the code below which retrives the data from SAP and the data is in oApplhelp
which is defined as a table the thing i need to display the data in oApplhelp on to a form having a grid
The below code only displays the msgbox that the data is found but i would need to display it on to a grid
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
If oApplHelp.RowCount > 0 Then
("IAstnr", "IAstna")
MsgBox "Data found"
Else
On Error Resume Next
MsgBox "Errors."
End If
End Sub
Desperately need your help
What actually the problem is the data is retrieved from SAP and the data needs to be displayed on to a form so kindly help jsut posting you the code below which retrives the data from SAP and the data is in oApplhelp
which is defined as a table the thing i need to display the data in oApplhelp on to a form having a grid
The below code only displays the msgbox that the data is found but i would need to display it on to a grid
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
If oApplHelp.RowCount > 0 Then
("IAstnr", "IAstna")
MsgBox "Data found"
Else
On Error Resume Next
MsgBox "Errors."
End If
End Sub