Skip to Content

How to return the window/screen name in GUI scripting

I'm starting out with SAP GUI scripting.  I'm driving the scripts from Excel, which works well.  I haven't found a reference book that explains the objects, methods and properties available in SAP GUI scripting so I do a lot by trial and error, guessing at what I think the property might be.  One of the issues that I have run into is that when I look up a document using FBV3, the resulting screen can be different.  I don't understand what is driving the difference (vendor type, document type, company code ???).  I need to grab a field off of the window, but the field will be referenced different depending on the type of window that come up.

Is there a way with GUI script to read the name of the window so that I know which field reference to use to get the field that I want?

Thanks,

Tyler

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Oct 06, 2014 at 12:18 PM

    Hello.

    session.findById("wnd[0]").Name
    

    Or if you have a Dialog popup it can be:

    session.findById("wnd[1]").Title
    

    Best regards,

    Holger

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 21, 2014 at 01:51 PM

    You also can use

    session.ActiveWindow.Text

    Regards

    Rüdiger

    Add comment
    10|10000 characters needed characters exceeded