Skip to Content
avatar image
Former Member

Unable to find control id through vbscript recording

Hi All,

I am new to scripting , I have automated many tasks of mine through scripting but this one I am facing issue.

I am not able to find control id of SAP APO Optimizer trace file export button ,I want to automate downloading of trace files in text file format in a particular folder. I have attached trace file screenshot for your reference

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Feb 08, 2016 at 07:21 AM

    Hello Enigma,

    you can analyze the the ID with Scripting Tracker.

    Here an example to read text from an editor control on the SE80:

    Here an example code how to read the content:

    '-Begin-----------------------------------------------------------------
    
      '-Directives----------------------------------------------------------
        Option Explicit
    
      '-Global Variables----------------------------------------------------
        Dim SapGuiAuto, application, connection, session, TextEdit
    
        If Not IsObject(application) Then
          Set SapGuiAuto = GetObject("SAPGUI")
          Set application = SapGuiAuto.GetScriptingEngine
        End If
    
        If Not IsObject(connection) Then
          Set connection = application.Children(0)
        End If
    
        If Not IsObject(session) Then
          Set session = connection.Children(0)
        End If
    
        Set TextEdit = session.findById("wnd[0]/usr/subEDITORSUBSCREEN:SAPLEDITOR_START:8430/cntlEDITOR/shellcont/shell")
    
        MsgBox TextEdit.Text
    
    '-End-------------------------------------------------------------------

    And now you can save the content via FileSystemObject in a file - you can find a good example here.

    Cheers

    Stefan


    001.jpg (316.1 kB)
    Add comment
    10|10000 characters needed characters exceeded

    • Hello Enigma,

      I never have tried it with so big data. In my test case I use it with 10 MB and if I call the Text property I get an exception with the code 80010105. It seems necessary to save the file via button "Save as local file".

      Try this to open the dialog:

      TextEdit.ContextMenu

      TextEdit.SelectContextMenuItemByPosition "18"

      Here you find a description how to work with Windows Save as dialog.

      Let us know your results.

      Cheers

      Stefan