Skip to Content
avatar image
Former Member

SAP.Functions vs SAP.ScriptingCtrl.1 vs SAP.GetScriptingEngine

Hi Community,

I noticed from this forum that there are several methods of calling the SAP objects in scripts e.g. SAP.Functions, SAP.ScriptingCtrl.1, GetScriptingEngine etc.

Is there any reference document on the differences between these methods e.g. when we should use it, which one is better for what purpose etc?

Just curious...

Thanks,

Sayuti

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Nov 03, 2013 at 08:07 AM

    Hello Sayuti,

    SAP.ScriptingCtrl.1 is the program ID (ProgID) of the SAP GUI Scripting API.

    If you create an instance like this

    Set application = CreateObject("SAP.ScriptingCtrl.1")

    you can use the SAP GUI Scripting API inside your program.

    SAP.Function is the ProgID of the SAP Remote Function Call Control library. This has nothing to do with the SAP GUI Scripting API. This is a part of the ActiveX libraries to connect SAP via COM.

    GetScriptingEngine is a method of the class GuiApplication from the SAP GUI Scripting API. It delivers an IDispatch interface to an instance of a running SAP GUI process.

    Hope my explanations help to understand the difference.

    Cheers

    Stefan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 10, 2013 at 10:51 PM

    Dear Sayuti, Stefan,

    I just reading your post and your testmethode2, i'm quite intrusting to get the new version.

    I try it and unfortunately, i getting an error into excel. the saplon is lauched but the application is in idle mode, until i get an error.

    Is it possible to share how you do this type of connection with more details ?

    Many thanks.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Dear Samir,

      What is the error did you get from Excel?

      I'm not sure how to be more detailed than I already have. The procedure is pretty straightforward.

      First you need to do 'early-binding' to sapfewse.ocx. @Stefan Schnell has written how to do it here: http://scn.sap.com/thread/2102571

      If this does not solve the issue, perhaps, the version of software is different. I used Excel 2010 running on Windows 7 and saplogon 720.

      Also, is scripting support enabled by your server?

      Thanks,

      Sayuti