Skip to Content
Former Member
Mar 20, 2018 at 06:35 AM

How to handle Save as Dialog?

7913 Views Last edit Mar 20, 2018 at 06:34 AM 2 rev


I am new to Scripting : specially to copy SAP GUI Script to excel VBA but SAP will pop up a -save as- windows which is not recorded in the Script recorder: this may be a Window popup I don't know: How do I enter a path and filename automatically so I don't have to press SAVE in that popup ?

I also would like to over write this file since I am using this task as repetitive. I see a few chats on that subject but cannot get the proper VBA code . tx

below is a typical Script from SAP GUI :

  1. session.findById("wnd[0]").maximize
  2. session.findById("wnd[0]/usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell").doubleClickNode "F00007"
  3. session.findById("wnd[0]/usr/ctxtCHARG-LOW").Text="4552872B"
  4. session.findById("wnd[0]/usr/ctxtBWART-LOW").Text="101"
  5. session.findById("wnd[0]/usr/txtMJAHR-LOW").Text="2000"
  6. session.findById("wnd[0]/usr/txtMJAHR-HIGH").Text="2015"
  7. session.findById("wnd[0]/usr/ctxtALV_DEF").Text="/CPS"
  8. session.findById("wnd[0]/usr/ctxtALV_DEF").SetFocus
  9. session.findById("wnd[0]/usr/ctxtALV_DEF").caretPosition =4
  10. session.findById("wnd[0]/tbar[1]/btn[8]").press