Q
Problem solve Get help with specific problems with your technologies, process and projects.

Strings in 'RFC_RAD_TABLE_ENTRIES from VBA' code example

Axel Angeli explains why a function call isn't working in a code sample submitted by a SearchSAP.com member.

I've tried your example - RFC_RAD_TABLE_ENTRIES from VBA - and it works fine for that function.

Now I've modified that code to use the function DDIF_FIELDLABEL_GET, but I get the following error message:

wdtfuncs   SAP data type not supported

error on line:
Set i_TABNAME = Func.Exports("TABNAME")

Here is my VB code:

Option Explicit

Public Functions As SAPFunctionsOCX.SAPFunctions
Private LogonControl As SAPLogonCtrl.SAPLogonControl
Private R3Connection As SAPLogonCtrl.Connection
Private TableFactory As SAPTableFactory

Dim Func As SAPFunctionsOCX.Function

Public i_TABNAME  As SAPFunctionsOCX.Parameter

Public i_FIELD  As SAPFunctionsOCX.Parameter
Public i_LANGU  As SAPFunctionsOCX.Parameter

Public strLabel  As SAPFunctionsOCX.Parameter

'Public tENTRIES  As SAPTableFactoryCtrl.Table

Public Sub Main()
    Dim ix As Integer
    Dim retcd As Boolean
    Dim SilentLogon As Boolean
    Set LogonControl = CreateObject("SAP.LogonControl.1")
    Set Functions = CreateObject("SAP.Functions")
    Set TableFactory = CreateObject("SAP.TableFactory.1")
    Set R3Connection = LogonControl.NewConnection
    R3Connection.client = "000"
    R3Connection.ApplicationServer = "A1KGNB09"
    R3Connection.language = "DE"
    R3Connection.User = "BCUSER"
    R3Connection.Password = "minisap"
    R3Connection.System = "A1 SAP 620 09"
    R3Connection.SystemID = "000"
    R3Connection.SystemNumber = "00"
    R3Connection.UseSAPLogonIni = False
    SilentLogon = False
   
    retcd = R3Connection.Logon(0, SilentLogon)
    If retcd <> True Then MsgBox "Logon failed": Exit Sub
   
    Functions.Connection = R3Connection
    Set Func = Functions.Add("DDIF_FIELDLABEL_GET")
   
    Set i_TABNAME = Func.Exports("TABNAME")
    Set i_FIELD = Func.Exports("FIELDNAME")
    Set i_LANGU = Func.Exports("LANGU")
   
    Set strLabel = Func.Imports("LABEL")
   
    i_TABNAME.Value = "USR02"
    i_FIELD.Value = "BNAME"
    i_LANGU.Value = "DE"
   
    Func.Call
   
    MsgBox strLabel
'    Debug.Print eNUMBER_OF_ENTRIES
'    For ix = 1 To tENTRIES.RowCount
'        Debug.Print tENTRIES(ix, 1)
'    Next
    R3Connection.Logoff

End Sub

Unfortunately the OCX-Version does not support strings properly. DDIF_FIELDLABEL_GET exports a string. I suggest using DDIF_FIELDINFO_GET instead.

This was last published in January 2007

Dig Deeper on SAP PI-XI

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Join the conversation

1 comment

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

Hello,

I would like to see an example showing how to use ,Net (C# or VB.Net) in order to extract an SAP cube  data using BAPI function RSDRI_INFOPROV_READ_RFC.

Thank you,

M. R.






Cancel

-ADS BY GOOGLE

SearchERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchHRSoftware

Close