cancel
Showing results for 
Search instead for 
Did you mean: 

Excel VBA + SAP Scripting / How can I send an instruction to a background window without bringing it up?

Former Member
0 Kudos

Hello guys,

I need to send keys to a window in the background, but I don't want it to pop up when I do it as it may cause some errors if I'm typing something at that moment. Is this possible?

The script I'm working on converts a spool to a pdf, but when the save as window comes up, the script stops recording because that is not a SAP screen, but a windows screen.

I was actually able to make it work by ending the script right before executing the transaction, then I used AppActivate and SendKeys to execute the transaction by pressing F8 and saving the file by pressing enter, but I still have these windows popping up while the macro is running, so, is it possible to have the SendKeys point to a specific application without it bringing it to the foreground?

Also, please note that I am new to programming, so I'm not familiar with all the functions.

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

holger_khn
Contributor
0 Kudos

Hello Jahir.

I had several similar request in past.

One requirement was mass convertion of PM orders printout from spool to PDF.

I found a solution where a small ABAP-Report (implemented in coding-area of an SQ02 infoset) Transfer spool data from my SAP user as PDF to a temp Folder on my local HDD.

Then I convert this PDF-files with an small application (pdf2txt.exe) to text-files. Where a small Excel VBA code got an specific text as identifier (PM order number).

So I have pdf-files with spoolnumber-naming and dedicated PM order number. So a small VBA code is renaming my files for better identification by enduser.

Another method was to write an small VBA macro which is able to identify Save-As dialogbox and fillin a specific filename and press 'Save' by using ESER32-API methods and functions.

As you are new with programming I guess both methods are a Little bit to complex for you.

LEt me know when you Need more Information for one of above used methods by me.

MAy you can give some more Details in which Transaction you will Trigger the spools.

Br, Holger