Exercise 4: Call Function Module 

Procedure

Use the Function Control to call the function module:

Private Sub cmdFunction_Click()

   

    cmdFunction.Enabled = False

    Screen.MousePointer = vbHourglass      'Activate hour glas

'

'Reference to function module RFC_CUSTOMER_GET

'

    Set dieFunc = FunctionCtrl.Add("RFC_CUSTOMER_GET")

   

'

'Set the import parameters and pass values from the input fields

'txtName.Text and txtNumber.Text

'

    If Len(txtName.Text) = 0 Then txtName.Text = "*"

       If Len(txtNumber.Text) = 0 Then txtNumber.Text = "*"

    dieFunc.Exports("KUNNR") = txtNumber.Text

    dieFunc.Exports("NAME1") = txtName.Text

'

'Call function module

'

    If dieFunc.Call = True Then

       TABOutput

    Else

       MsgBox "Error when accessing function in R/3!"

       Screen.MousePointer = vbDefault          'Deactivate hour glas

       Exit Sub

    End If

End Sub

How to Continue

Exercise 5: Display R/3 Data