cancel
Showing results for 
Search instead for 
Did you mean: 

VBA programming in Excel

shiguo_wang
Explorer
0 Kudos

Dear Colleagues,

We need use VBA programming in Excel to deliver the function to our customer. The VBA program will call our standard SAP function, e.g. RFC, Web service, and other kinds of service.

How can I know what functions, objects are delivered by SAP, which I can use in the VBA programming?

For example,

Set ctrl = CreateObject("<b>SAP.Functions</b>")

Set sapConnection = ctrl.Connection

sapConnection.<b>client</b> = ActiveSheet.Cells(3, 2).Value

sapConnection.<b>user</b> = ActiveSheet.Cells(4, 2).Value

sapConnection.<b>Language</b> = ActiveSheet.Cells(7, 2).Value

Is there any handbook I can use?

Your help will be appreciated very much!

Thank you and best regards,

Shiguo

Accepted Solutions (1)

Accepted Solutions (1)

CountZero
Explorer
0 Kudos

Hi Shiguo,

What information do you need? If you need a list of parameters and methods with the SAP.Functions object there is no real documentation that I can find. However if you are in the Visual Basic editor you can add a reference to SAP.Functions, then in the object browser see it's methods and properties.

So in the Visual Basic editor goto Tools->References. Click on the Browse button. You should see a open file dialog box. In the filetype drop down select OCX. Find your SAP gui directory and look for the following files wdtfuncs.ocx and wdtlog.ocx (you need to add them seperatly).

Then when you have done that you should see the following entries in the references dialog box

SAP Remote Function Call Control

SAP Logon Control

(both ticked).

Click on OK.

Press F2 or goto View->Object Browser.

In the top box it should say <All Libraries>

Using that box find SAPFunctionsOCX

You should see all the parameters and methods exposed by the SAP Functions OCX.

There is some small documentation visible in the lower half of the screen.

As for some code examples

Check in the widgets form. Look for SAP.VBS as that will give you an example of using RFC_READ_TABLE.

I hope this helps.

Nath

shiguo_wang
Explorer
0 Kudos

Hi Nath,

Thank you very much!

Best regards,

Shiguo

Former Member
0 Kudos

Hello,

I couldn't find the documentation in the Excel 2007 help like you should me. Does the object come with API or do I have to find a library to download it in?

Thanks,

David

thomas_brutigam2
Active Participant
0 Kudos

Hi David,

you have to set a "Link" in the VBA Preferences -> to find in

Extras-> References

Here you have to add the librfc32.dll

Then you'll find the Objects ....

Answers (0)