Skip to Content
avatar image
Former Member

¿How I can to record this button?

This Button is appears when I download an attached file in the transaction FB03 but I want to do a Macro using the recorder in SAP.

The vbs scripts is stop when this windows appear.

This is my script, Other alternative is use a script for found the windows but the cursor sometimes start in differents position (open, save or cancel) and the tabs or enter was not exact.

session.findById("wnd[0]/titl/shellcont/shell").pressButton "%GOS_TOOLBOX"
session.findById("wnd[0]/shellcont/shell").pressButton "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").doubleClickCurrentCell

And I thought that is posible just user the session ID of the button like

session.findById("wnd[1]/tbar[0]/btn[0]").press

Anyone know what is the ID CODE session?

Thanks for the help

buttom.png (16.2 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • May 03, 2017 at 05:57 AM

    Hello Hector,

    the GOS supports SAP GUI Script recording, all you have to do is to disable in the SAP Logon the using of native Windows dialogs.

    After that you can record your activities also.

    Here you see the FB03 with an export of a PDF file from the GOS.

    And now your 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
    

    Cheers
    Stefan

    Add comment
    10|10000 characters needed characters exceeded