Skip to Content

The GOS supports SAP GUI Script recording, all we have to do is to disable in the SAP Logon the using of native Windows dialogs. More information here.

 

To try it you can use the TAC SGOSTEST (Test tool for GOS).

 

Export

After that it is possible to record this activities also.

Here an example with the transaction code FB03 with an export of a PDF file from the GOS.

 

And now your the scripting code looks like this:

session.findById("wnd[0]/titl/shellcont/shell").pressContextButton "%GOS_TOOLBOX"
session.findById("wnd[0]/titl/shellcont/shell").selectContextMenuItem "%GOS_VIEW_ATTA"
session.findById("wnd[1]/usr/cntlCONTAINER_0100/shellcont/shell").currentCellColumn = "BITM_DESCR"
session.findById("wnd[1]/usr/cntlCONTAINER_0100/shellcont/shell").selectedRows = "0"
session.findById("wnd[1]/usr/cntlCONTAINER_0100/shellcont/shell").pressToolbarButton "%ATTA_EXPORT"
session.findById("wnd[1]/usr/ctxtDY_FILENAME").text = "This is a test.pdf"
session.findById("wnd[1]/usr/ctxtDY_FILENAME").caretPosition = 19
session.findById("wnd[1]/tbar[0]/btn[0]").press

 

Import

Here an example code for an import:

session.findById("wnd[0]/titl/shellcont/shell").pressContextButton "%GOS_TOOLBOX"
session.findById("wnd[0]/titl/shellcont/shell").selectContextMenuItem "%GOS_PCATTA_CREA"
session.findById("wnd[1]/usr/ctxtDY_PATH").text = "C:\Dummy\"
session.findById("wnd[1]/usr/ctxtDY_FILENAME").text = "This is a test.pdf"
session.findById("wnd[1]/tbar[0]/btn[0]").press

 

To report this post you need to login first.

6 Comments

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

  1. Stefan Schnell Post author

    Hello Anatoliy,

    if you record your activities via SAP GUI Scripting, you see on the right side in the status bar a litte rotating barberpole. This means that a script is running.

    In this case the GOS dialog in the Folders Management looks like this:

    If you don’t record your activities via SAP GUI Scripting, the same GOS dialog in the Folders Management looks like this:

    Do you activate the script recording if you see this dialog?
    If yes, which path resp. which activities do you use to open this dialog in Folders Management?
    TAC ORGANIZER > …

    Cheers
    Stefan

     

    (0) 
  2. Anatoliy Chibisov

    Good afternoon, Stefan!
    The script is needed to load the pdf file from the disk, the actions of the file and the file are not displayed when the script is run.

    Record:

    The form of loading does not change.

    When formatting and running the script stops Folders Management.

    Can I write a script for Folders Management?

    (0) 
  3. Stefan Schnell Post author

    Hello Anatoliy,

    this is a modal dialog box, this means it blocks other applications, e.g. a running script, on the same process. It is necessary to start another independent process parallel to control this dialog box. You can find a solution here.

    Cheers
    Stefan

    (0) 
  4. Emin Hasanov

    how do I automate findById(“wnd[0]/titl/shellcont/shell”).pressContextButton “%GOS_TOOLBOX”

    As I see, GuiShell doesnt contain pressContextButton method

    (0) 
    1. Stefan Schnell Post author

      Hello Emin,

      GuiShell is an abstract object whose interface is supported by all the controls. Look at the sub type of GuiShell. In your case it is GuiToolbarControl which extends GuiShell. GuiToolbarControl offers the method PressContextButton(Id As BStr) As Void. Here a tiny example script:

      $ID = Invoke-Method $session "findById" @("wnd[0]/titl/shellcont/shell")
      Invoke-Method $ID "pressContextButton" @("%GOS_TOOLBOX")

      Best regards
      Stefan

      (0) 

Leave a Reply