Skip to Content

Hello community,

we see at the DSAG (German SAP User Group) the NetWeaver Business Client (NWBC) as replacement in the near future for the SAP GUI for Windows with the SAP Logon. From this point I considered the SAP GUI Scripting with NWBC for Desktop. At first I installed the NWBC 4.0 PL 4 and configured the application server. It runs well and I directed my attention to the SAP GUI Scripting.

First of all, it works. But there are some differences to SAP GUI Scripting inside SAP GUI for Windows.

  1.  If I open a second NWBC Client window and use the method Connections from the Application object with the property Count, I get not more than one connection. SAP GUI Scripting uses only the first NWBC Client window. Look here: http://scn.sap.com/thread/3323820

  2. The correct entry in the running object table (ROT) for the SAP GUI Scripting inside NWBC is SAPGUISERVER.
  3. If I record a SAP GUI Script with NWBC, it sets SapGuiAuto = GetObject(“SAPGUI”). If I start this script from Windows Explorer, it runs in a normal SAP GUI for Windows session. I think it should be SapGuiAuto = GetObject(“SAPGUISERVER”).
  4. In the NWBC is no Ok-Code-Field visible. It is possible to use it with SAP GUI Scripting because it is in the scripting object hierarchy, but it is not possible to record something with it in NWBC.
  5. In the NWBC is no Toolbar[1] visible and not useable. Older SAP GUI Scripts will not work and there is no equivalent.

My momentary conclusion: SAP GUI Scripting in the context of NWBC offers not the same possibilities as in SAP GUI for Windows context now. We will see what will happen in the future development of NWBC in this sector, I am curious.

To be continued

Cheers
Stefan

To report this post you need to login first.

5 Comments

You must be Logged on to comment or reply to a post.

  1. Stefan Schnell Post author
    Hello community,

    to 5.: I export with Scripting Tracker the object hierarchy from transaction code SE16 from the SAP GUI for Windows and the NWBC for Desktop and compare it. Here are the differences:

    In NWBC are available:
    tbar[0]/btn[201];;GuiButton;
    tbar[0]/btn[210];;GuiButton;
    tbar[0]/btn[211];;GuiButton;
    tbar[0]/btn[212];;GuiButton;
    tbar[0]/btn[213];;GuiButton;

    In SAP GUI for Windows are available:
    tbar[0]/btn[423];;GuiButton;
    tbar[1]/btn[7];;GuiButton;
    tbar[1]/btn[5];;GuiButton;
    tbar[1]/btn[6];;GuiButton;
    tbar[1]/btn[32];;GuiButton;

    The buttons from Toolbar[1] are now the buttons 210 to 213 in Toolbar[0].
    It seems that all buttons from Toolbar[1] are now in Toolbar[0]. I checked it with the transaction codes SE37 and ST05.

    Karsten Schurr had the great idea to work exclusively with the virtual key codes, and this works perfect.

    The following example works on both:
    session.findById("wnd[0]/tbar[0]/okcd").text = "/nse16"
    session.findById("wnd[0]/tbar[0]/btn[0]").press
    session.findById("wnd[0]/usr/ctxtDATABROWSE-TABLENAME").text = "TSTC"
    session.findById("wnd[0]").sendVKey 7
    session.findById("wnd[0]").sendVKey 8

    This example works only on SAP GUI for Windows:
    session.findById("wnd[0]/tbar[0]/okcd").text = "/nSE16"
    session.findById("wnd[0]/tbar[0]/btn[0]").press
    session.findById("wnd[0]/usr/ctxtDATABROWSE-TABLENAME").text = "TSTC"
    session.findById("wnd[0]/tbar[1]/btn[7]").press
    session.findById("wnd[0]/tbar[1]/btn[8]").press

    For the future it seems to be better to work with virtual key codes.

    Cheers
    Stefan
    (0) 
    1. Obaid Ullah

      Have you tired to use business client 6 that is not returning any connection object from application object?

      I’ve SAP GUI 6.4 and SAP Business Client 6 installed on my machine. I’m able to use SAP scripting without any issue when working on SAP GUI 6.4 but when trying to use scripting on SAP GUI from SAP business client i’m unable to get any SAP connection object.

      I’ve verified that scripting is enabled on client as well as server side. I was able to get ‘GuiScriptingEngine’ object after retrieving SAP GUI object from window ROT. However I’m unable to retrieve connection object from ‘GuiScriptingEninge’ object as it does not has any children. No matter how many SAP connection/session are up, it always returns 0 child.

      (0) 
      1. Stefan Schnell Post author

        Hello Obaid,

        the combination of SAP GUI for Windows 6.40 and SAP NetWeaver Business Client 6 is little bit unusual. The support for SAP GUI 6.40 ends in October 2008 and the SAP NetWeaver Business Client 6 release date is October 2015.

        You can analyze the combination with Scripting Tracker.

        /wp-content/uploads/2016/02/001_885536.jpg

        In my example with SAP GUI 7.40 and NWBC 5 you see each open session and NWBC flag is set.

        Try it in your environment and let us know your results.

        Cheers

        Stefan

        (0) 
        1. Obaid Ullah

          Hi Stefan,

          Thanks for the update. In my earlier response I was refereeing to SAP GUI 7.4 instead of 6.4 (that was typo on my end).

          Though I never had trouble in using  scripting API on machine having NWBC 5 and SAP GUI 7.4. But after upgrading to Business client 6, I’m unable to get any connection object through the scripting. Interestingly, on same machine, I was able to interact with SAP GUI 7.4 with scripting without any issue.

          For Business client 6, I also tried to use SAP GUI native record and playback tool. Though this tool was recoding a script in similar fashion as was with NWBC 5 but when i play back that script i was getting same error. The error occurred at a point when it tried to retrieve connection object after retrieving object form window ROT.

          I’m wondering if SAP GUI has dropped support of scripting API with Business client 6!

          (0) 
          1. Stefan Schnell Post author

            Hello Obaid,

            I installed the actual release of NWBC 6.0 PL 1 on my system and try the SAP GUI Scripting and all works well – no problems with anything, all works as expected. I can record and I can replay, no restrictions, no problems, no dropping support. SAPGUISERVER exists in the ROT.

            /wp-content/uploads/2016/02/001_891614.jpg

            It seems another point of problem in your case.

            Cheers

            Stefan

            (0) 

Leave a Reply