Native Microsoft Windows dialogs in SAP

In one of my articles I showed You how to turn off the pop up message boxes in Accessibility & Scripting options, but didn’t really describe about the 3rd checkbox below Enable scripting. In this article I’m going to show You how Show native Microsoft Windows dialogs works in SAP.

The easiest way to compare will be to show You how the dialog presents depending on the option is on or off. To do that I’ll go to the MVKE table in SAP, type random product to see any data and try to save this as spreadsheet.

Show native Microsoft Windows dialogs – ON

As the first case I consider the Windows native dialogs.

After choosing the spreadsheet save option the dialog popped up.

It looks like standard Windows Save As dialog window.

I tried also to record this using SAP Script Recorder, but there were only lines “before” the dialog, nothing else.

session.findById("wnd[0]/usr/cntlRESULT_LIST/shellcont/shell").pressToolbarContextButton "&MB_EXPORT"
session.findById("wnd[0]/usr/cntlRESULT_LIST/shellcont/shell").selectContextMenuItem "&XXL"

Show native Microsoft Windows dialogs – OFF

Later on, stil staying in the MVKE table, I turned off the native Windows dialogs.

So after choosing the spreadsheet I could see SAP GUI dialog.

I used also the Script Recorder to record the dialog and the Generate button click.

session.findById("wnd[0]/usr/cntlRESULT_LIST/shellcont/shell").pressToolbarContextButton "&MB_EXPORT"
session.findById("wnd[0]/usr/cntlRESULT_LIST/shellcont/shell").selectContextMenuItem "&XXL"
session.findById("wnd[1]/usr/ctxtDY_FILENAME").text = "export3.XLSX"
session.findById("wnd[1]/usr/ctxtDY_PATH").caretPosition = 40

The SAP GUI dialog actions were recorded.


The best summary would be the quote from SAP Help site:
Since Microsoft Windows’ native system dialogs (Save As, Open) cannot be recorded when a script is run, they are replaced automatically with predefined SAP GUI dialogs. You can disable this procedure by selecting option, Show Native Microsoft Windows Dialog. The native dialog boxes are then displayed, but cannot be accessed via SAP GUI scripting.

Author: Tomasz Płociński

I'm very advanced in VBA, Excel, also easily linking VBA with other Office applications (e.g. PowerPoint) and external applications (e.g. SAP). I take part also in RPA processes (WebQuery, DataCache, IBM Access Client Solutions) where I can also use my SQL basic skillset. I'm trying now to widen my knowledge into TypeScript/JavaScript direction.

One thought on “Native Microsoft Windows dialogs in SAP”

Leave a Reply

Your email address will not be published.