I just launched "SAP GUI Scripting: Understanding the Basics" ebook! If you are interested to learn more, check it out in the link below: ko-fi.com/s/c366da7e71
Hi Joel, Thank you, your video is very helpful. I have a question if I may ask. So when I run the macro, and executing the data from SAP, a pop up in Ms Excel appear "Microsoft Excel is waiting to complete OLE action". I assume it happens due large data that I extracted in SAP during the process. Do you have any idea to avoid this pop up error? Thank you
Hello! You can try adding Application.DisplayAlerts = False before you run your script and right before it ends, set Application.DisplayAlerts = True again so that Excel can work normally.
Thanks This video is really helpful. But while executing a particular transaction type there is no data generated in SAP and then I want to continue with another company code how to do that.
Hi there, you can actually use the status bar to your advantage in your script. Depending on is being shown in the status bar, use if statements to control the script. In your case, if you see a "success" message, then continue with the rest of the script to export, else, next loop. Hope this helps。
Hello! Just right click anywhere on the table you are trying to export, then click on spreadsheet, you should be able to untick that option and select your desired format.
Timestamps 00:17 SAP Settings - Enable scripting & avoid "A Script is Attempting to Access SAP GUI" Message 00:44 SAP Settings - Security Settings (Set Default Action to Allow) 01:00 SAP Settings - Selecting Spreadsheet Format for Exports 01:37 Excel Preparations - Enable Developer tab in Ribbon to access Visual Basic Editor 02:08 Excel Preparations - Enable SAP GUI Scripting API under Tools, References 02:48 Debugging Tips - Step Into 03:27 Debugging Tips - Watch Window 04:28 Debugging Tips - Breakpoints 05:20 Thanks for Watching!
Hi Joel, appreciated for your contribution. Videos are really helpful. One question: If one Date field in Script is a specific one, but in reality, it needs to be "Today", how I could adjust the code in script?
You can get today's date by using the method "Date()". Depending on how your SAP GUI is being set up, to get today's date in your desired format, you can use the following: Format(Date, "mm.dd.yy") or Format(Date, "mm/dd/yy")
Hello Joel, sorry for the inconvenience but I have a question! When I create the script, the save as windows window appears and the script does not record those steps, however, so that the format between SAP and Excel does not change, I have to download it that way, giving save as to the file. A few days ago I managed to find the code for the macro that did it but now I can't find it, do you know how to make my macro continue and save the file?
Hi there. You can check out one of the suggestion here in SAP community. community.sap.com/t5/technology-q-a/how-to-handle-save-as-dialog/qaq-p/648415 This suggested approach is using key strokes to switch between controls in the dialog. If the timing was not set right, it will break at times.
Hi Joel, I am not able to find any .ocx files on my computer. I have never heard of Citrix so I don’t think we use that. I know macros work with excel and SAP for me because I have a file that someone created for me with a macro script. Please help!
Hello! If you have something that works for you already, it likely means you have the file in your computer. To confirm, try this: Open File Explorer and navigate to the SAP GUI installation directory (C:\Program Files (x86)\SAP\FrontEnd\SAPgui). There should be multiple .ocx files in there. Can you locate the file there?
@@JoelTing I checked that exact file location and there were no .ocx files in that folder. Is it possible that it is written in a different format that doesn’t require that file?
Thanks for this. I have a problem when I run some transactions in SAP that takes say 2-3 minute to complete. For those transactions VB throws a pop up message saying that the interface is not responding. I googled for a solution to disable these messages, but none worked. Also added a wait but that did not help too. Without the ability to avoid these pop ups -automation stop in the middle awaiting for a manual confirmation. script do not complete awaiting intervention.
Hi there. I personally have not encounter this before. Do you have the specific error code? How about you try changing the Application.DisplayAlerts property for Excel to be False before running the script and set it back to True after running the script? Usually this will disable alert messages when macro is running.
@@JoelTing Thanks Heaps. This worked for me. I had 3 transactions that has this issue MB25 (Material reservations via MM system), IW39 (PM system) and one of our custom transactions to get payroll hours info
The script may differs from different SAP netweaver versions. You will need to change the top portion based on what you have recorded, but the concept is the same fundamentally.
Hi there. I'm not sure if I understand you correctly. I believe you are trying to send data from different Excel cells into SAP. If my understanding is correct, you can refer to the link below on how this could be done: joelting.com/articles/sap-gui-script/send-data-from-excel-to-sap-gui-with-excel-vba/
Hi Joel, I got a runtime error "432" File name or class name not found during Automation process, referrring the the line "Set SapGuiAuto = GetObject("SAPGUI"), please help thanks
@@yudimuttaqin205 personally I have not encounter this error before. Another way you can try is to check your recorded script. Look for the same Set SapGuiAuto line, and check whether the object is "SAPGUI" or another name. There's some system where the object is "SAPGUISERVER" instead.
Hey Joel , Great content !! I m facing issue that after clicking on script recording I am unable to record anything , I mean editing part in tcode areas not working . Could you please help in this regard ?
Hi Joel, Is there any problem if the Security Option is not highlight in the SAP options? I think this is a server/security problem with our company. Need I to be a superuser to proceed with the scripting?
Hi Joel, thank you for all your work. I'm having an issue though, the moment I have to select a spreadsheet the space for the route and the name of the file comes as a pop-up window outside SAP, also, the only available format I have is Office 2003 XML Format, instead of the Office Open XML Format (XLSX).
@@emilblack02 can you try to check if the setting "Show native Microsoft Windows dialogs" is disabled at your end under "Option" > "Accessibility & Scripting" > "Scripting"?
Hi Gonzalo, I believe we are not able to disable to auto open. But, I did some search and found something that is working for me in SAP forum. We can choose to close the exported excel file with the following function. Sub close_excel_instance_sap() Dim xlApp As Object ' Use the Excel file full path. Just the filename of the workbook will not work' Set xlApp = GetObject().Application ' close the exported workbook' xlApp.Workbooks(1).Close False ' close the excel instance' xlApp.Quit End Sub
Hey Joel do you know how can we pass multiple document no in one shot during automation (to avoid loop repetition ) . Please suggest , Thanks in Advance
@@JoelTing no during Automation we are using loop ...but bot pick one document no from excel then put in SAP ... but my requirement how can our bot will go for 10 document in one shot
Are you able to do it in bulk in SAP manually? If yes, you may be able to replicate it in the script. But if it's not, there's simply no such option. SAP GUI script is just helping you to do the work. If SAP GUI only accepts one document at a time, then my understanding is that the only option for the script to run is via a loop.
When you are doing it manually, I believe you are using a simple copy and paste? You can record the script to use the upload from clipboard button. Before running that line, use the range.copy() method to copy the range and click on the "Upload from Clipboard" button using the script. This way, it will be pasted into SAP like how you did manually.
Hi Joel, Your this video was helpful. Could you help me with this error pop "the enumerator of the collection cannot find an element with the specified index". It comes when I try execute this line of code. " Set Session=objconn.children(0)"
Hi there. Have you logged into SAP and in an active session already? The script is not able to find a SAP session to connect to. If it is already opened, then it may be due to scripting being disabled/not enabled by your company.
Hi Joel I really appreciate your helpful videos. I am using the Power Automate VB function and I am encountering a problem that I cant solve, maybe you can help? When I try to add a new employee the script fails at the point of Create Actions. I can see that it creates red brackets around the entire create actions page, those brackets would normally appear against a data input field and it then fails. When I run the script and it falls over, I have tried to record the script from that point however as soon as I click on the record script function in SAP, the brackets around the page disappear. I am at a loss as to how to resolve this.. If you could assist me I would be very grateful.
Hi Jollest Mc, when you mentioned that it failed at the point of Create Actions, do you mean when it is running the SAP VB script? Or are you using Click UI element etc to access the data input field?
Hi Joel, the VBA script fails when in SAP it is needed to paste one code first to enable the list option for pasting a list of codes to extract. Is there a solution to this?
Similar to what you will do previously, during your recording, paste one line first, then click on the list option and then paste in. When you are making it dynamic, when pasting the 1st line, you can use the first element in the list, then proceed with pasting the rest after the list option is available. Will that perform what you expect?
Hey Joel! Having an issue......the macro is running smooth on my system but cannot run it on my colleagues' system, Prompts an error on the first step!! Any idea?
Hi Joel, i must say very rich content👏👏👏👏 could you please help me how to change the system, as in my organisation recording is allowed in the "Quality system" only, how to use the scripts recorded in the "Quality system" to "Production system". Thanks
Hi Amit, I'm not sure how that would work though. You can try developing your script in quality system, then log off from that and log into production system before running the script. Would that work?
Hi SimpleExcelVBA, Right click anywhere on the grid in SAP and click on spreadsheet. It should give you the option to untick the always use selected format again
Btw, thanks for watching. I have watched your video before and it kind of get me started with SAP Scripting. Thanks a lot of your video as well! Appreciate it.
Hi, Joel. The script works fine for me. But when another user tries to use the script, it gives them a compile error: Variable not defined in this line: Set objConn = objGui.Children(0) We've configured the SAP settings already and did the excel preparations, etc. before running the script. What I suspect is that it's because I recorded and tested the script in the 'development system' and the user is trying to run the script in the 'production system'. I'm not sure though The script recording is allowed only in our development system. However, we have configured everything already in the user's production system before we ran the script.
Hi Lara, If that's the case, that means that users are blocked from executing any SAP GUI script in the production server. Usually that needs to be enabled by admin in transaction RZ11 sapgui/user_scripting for the production server.
Hi keirei go, you are still not able to find it using the browse button and changing the file type to ActiveX Control? Just wanted to understand, are you using Citrix so access SAP GUI? I have encountered some instances where Citrix is being used, and the script will not work in VBA.
@@JoelTing Even when I try to click any text box on the page, PAD shows only a Pane and not that particular UI element. Please help me. My company wont give the previleges for record & playback scripts. My only change is through desktop recorder
@@MukeshMishra-kl2fn unfortunately, PAD recording function does not work with SAP GUI. It is not able to capture all the elements. If your company do not allow record & playback scripts, you will not be able to record or execute any SAP automation scripts.
Hi there. Credits to Patrick Migues, he suggested to try the following: Dim export1 As Object Dim export2 As Object Set export1 = GetObject(“file location\Export 1.file extension”).Application Set export2 = GetObject(“file location\Export 2.file extension”).Application export1.Workbooks(1).Close export2.Workbooks(1).Close export2.Quit Error Situations: This will close either all of the Excel files opened after the Macro is run, explicitly listed or not (running correctly); or it will close all of the excel files opened prior to running the macro, to include the file running the Macro, if one of the explicitly listed files is not open or saved to the listed location. Because of the above, when this code fails, it will not throw a debug error. I gave up working on that part as I felt like it's not a good use of my time to keep trying and debugging this one simple action of closing the workbook, since I automated the most time consuming part.
Hi Joel, I have an issue in selecting layout in SAP while running the script in Macro. I have set my default layout while recording the script and Macro is working on the same day with default layout but when I am running it after 2-3 days layout is changing so the output I want is not coming with the changed layout. Can you help me how to fix this issue?
Hi kotipalli sowmya. In that case I would recommend you to record a version where you type in the layout name into the layout textbox. Avoid using default as this may be changed by others, resulting in inconsistent output. SAP Scripting only helps you to perform repetitive steps. As much as possible, we want to avoid using settings that may change the outcome.
@@kotipallisowmya8410 how about you add in the steps to select your layout via a search? Every run, click on the select layout button, then search for your layout. Then click accordingly, see if the scripting is able to replicate searching for your layout
Hello! Can you try navigating to C:\Program Files (x86)\SAP\FrontEnd\SAPgui using file explorer and check if sapfewse.ocx file is there? Are you able to record script before going into VBA?
@@JoelTing yes i can record the Script and now i have the connction. Unfortunately my Skript when i just copy and paste does not work. It seems He does not find the Connection to my sap. What can i do for that
Hi Bhanuka, may I know if there's any error shown when you are trying to enabled the option? Or is that option being disabled and greyed out all the time? If it's always disabled, chances are it's due to the company blocked its user from using scripting and there's not much that can be done (other than asking IT/admin to enable it in server) from a user perspective.
Hi Kalyana, this seems to be happening when the script cannot find the buttons/boxes to activate as written in your script. You may try debugging it step by step, see which step does your script goes wrong then determine how to fix it. Maybe some of the steps are not working as expected
Hi xeemv, just wanted to understand, did you have SAP GUI installed in your local computer? Or is it accessed via Citrix? If it is via Citrix, then, you wont be able to use Scripting with Excel VBA as it is not able to communicate with it.
Hi Vijay, you can try to troubleshoot step by step. See which step is giving the issue. For findbyID error, you can check if the error is triggered because the script did not manage to navigate to the page like what was recorded.
I just launched "SAP GUI Scripting: Understanding the Basics" ebook! If you are interested to learn more, check it out in the link below:
ko-fi.com/s/c366da7e71
thanks a lot! the tips about setting up the GUI and the Developer API were extremly helpful!
Awesome, keep SAP GUI tips and tricks videos coming :)
Dear Joeh, this is amazing video that I have solved my problem. Please keep going on sharing more useful videos 🥰
Hello Joel, That was an awesome video. Keep it up and post some more useful videos.
Another awesome video. Keep them coming.👍
It's Very Useful ! Amazing
Hi Joel, Thank you, your video is very helpful. I have a question if I may ask.
So when I run the macro, and executing the data from SAP, a pop up in Ms Excel appear "Microsoft Excel is waiting to complete OLE action". I assume it happens due large data that I extracted in SAP during the process. Do you have any idea to avoid this pop up error? Thank you
Hello! You can try adding Application.DisplayAlerts = False before you run your script and right before it ends, set Application.DisplayAlerts = True again so that Excel can work normally.
Very helpful! thanks a lot!
Good tips Joel, 👍
Thanks This video is really helpful. But while executing a particular transaction type there is no data generated in SAP and then I want to continue with another company code how to do that.
Hi there, you can actually use the status bar to your advantage in your script. Depending on is being shown in the status bar, use if statements to control the script. In your case, if you see a "success" message, then continue with the rest of the script to export, else, next loop. Hope this helps。
Really helpful for me. Superb bro
Glad to hear that!
Do you by chance know how to change the type of export type if you did at one point select "always use Selected Format" ?
Hello! Just right click anywhere on the table you are trying to export, then click on spreadsheet, you should be able to untick that option and select your desired format.
Timestamps
00:17 SAP Settings - Enable scripting & avoid "A Script is Attempting to Access SAP GUI" Message
00:44 SAP Settings - Security Settings (Set Default Action to Allow)
01:00 SAP Settings - Selecting Spreadsheet Format for Exports
01:37 Excel Preparations - Enable Developer tab in Ribbon to access Visual Basic Editor
02:08 Excel Preparations - Enable SAP GUI Scripting API under Tools, References
02:48 Debugging Tips - Step Into
03:27 Debugging Tips - Watch Window
04:28 Debugging Tips - Breakpoints
05:20 Thanks for Watching!
Great help. thank you so much
Hi Joel, appreciated for your contribution. Videos are really helpful.
One question: If one Date field in Script is a specific one, but in reality, it needs to be "Today", how I could adjust the code in script?
You can get today's date by using the method "Date()". Depending on how your SAP GUI is being set up, to get today's date in your desired format, you can use the following:
Format(Date, "mm.dd.yy") or Format(Date, "mm/dd/yy")
Thank you so much...Helped a lot
Glad it helped!
Hi Joel, I’m unable to find the SAP GUISCRIPT in my desktop even after follow your steps here… may I know is there any other ways that can help?😢
Hi there, are you using SAP GUI remotely like with Citrix?
Hello Joel, sorry for the inconvenience but I have a question! When I create the script, the save as windows window appears and the script does not record those steps, however, so that the format between SAP and Excel does not change, I have to download it that way, giving save as to the file. A few days ago I managed to find the code for the macro that did it but now I can't find it, do you know how to make my macro continue and save the file?
Hi there. You can check out one of the suggestion here in SAP community.
community.sap.com/t5/technology-q-a/how-to-handle-save-as-dialog/qaq-p/648415
This suggested approach is using key strokes to switch between controls in the dialog. If the timing was not set right, it will break at times.
@@JoelTing Thanks Joel!! but I have not been lucky! Let's see if I keep looking! I'll keep you informed
Hi Joel, I am not able to find any .ocx files on my computer. I have never heard of Citrix so I don’t think we use that. I know macros work with excel and SAP for me because I have a file that someone created for me with a macro script. Please help!
Hello! If you have something that works for you already, it likely means you have the file in your computer. To confirm, try this: Open File Explorer and navigate to the SAP GUI installation directory (C:\Program Files (x86)\SAP\FrontEnd\SAPgui). There should be multiple .ocx files in there. Can you locate the file there?
@@JoelTing I checked that exact file location and there were no .ocx files in that folder. Is it possible that it is written in a different format that doesn’t require that file?
Thanks for this. I have a problem when I run some transactions in SAP that takes say 2-3 minute to complete. For those transactions VB throws a pop up message saying that the interface is not responding. I googled for a solution to disable these messages, but none worked. Also added a wait but that did not help too. Without the ability to avoid these pop ups -automation stop in the middle awaiting for a manual confirmation. script do not complete awaiting intervention.
Hi there. I personally have not encounter this before. Do you have the specific error code? How about you try changing the Application.DisplayAlerts property for Excel to be False before running the script and set it back to True after running the script? Usually this will disable alert messages when macro is running.
@@JoelTing Thanks Heaps. This worked for me. I had 3 transactions that has this issue MB25 (Material reservations via MM system), IW39 (PM system) and one of our custom transactions to get payroll hours info
Joel, and how to connect to SAP neatwever 6,5 ? Something change ?
The script may differs from different SAP netweaver versions. You will need to change the top portion based on what you have recorded, but the concept is the same fundamentally.
I want enter data from excel cell. But it's getting entered SAP cell number only in SAP. Pls let me know how to add variable data from excel cell.
Hi there. I'm not sure if I understand you correctly. I believe you are trying to send data from different Excel cells into SAP. If my understanding is correct, you can refer to the link below on how this could be done:
joelting.com/articles/sap-gui-script/send-data-from-excel-to-sap-gui-with-excel-vba/
Hi Joel, I got a runtime error "432" File name or class name not found during Automation process, referrring the the line "Set SapGuiAuto = GetObject("SAPGUI"), please help thanks
Hi there. May I know if you have SAP GUI Scripting API enabled?
@@JoelTing yes i have enable it following the instruction via Excel options setting
@@yudimuttaqin205 personally I have not encounter this error before. Another way you can try is to check your recorded script. Look for the same Set SapGuiAuto line, and check whether the object is "SAPGUI" or another name. There's some system where the object is "SAPGUISERVER" instead.
Thank you very useful 😊
Hey Joel , Great content !!
I m facing issue that after clicking on script recording I am unable to record anything , I mean editing part in tcode areas not working . Could you please help in this regard ?
Hi, not too sure about this. I have not personally encounter this before. Once you hit the record button, nothing in your user interface work?
Hi joel when i try to record SAP Gui scripting i get the error of directory does not exist please help on this
Hi, would it work if you rename the Save To field to a directory that you know does exist?
Hi Joel,
Is there any problem if the Security Option is not highlight in the SAP options?
I think this is a server/security problem with our company. Need I to be a superuser to proceed with the scripting?
Hi Luis,
If it's not set to allow, sometimes it may intervene with the script. But anyway, you can try running a recorded script and see how it went.
Hi Joel, thank you for all your work.
I'm having an issue though, the moment I have to select a spreadsheet the space for the route and the name of the file comes as a pop-up window outside SAP, also, the only available format I have is Office 2003 XML Format, instead of the Office Open XML Format (XLSX).
Hi there. if XLSX format is not available, would it work if you try to work with XML format instead?
@@JoelTing it does! But every time I execute the script it stops at the saving part because of the pop-up window (save as)
@@emilblack02 can you try to check if the setting "Show native Microsoft Windows dialogs" is disabled at your end under "Option" > "Accessibility & Scripting" > "Scripting"?
hi Joel,
One question: how to disable auto open when you export to excel file from SAP?
Hi Gonzalo, I believe we are not able to disable to auto open. But, I did some search and found something that is working for me in SAP forum. We can choose to close the exported excel file with the following function.
Sub close_excel_instance_sap()
Dim xlApp As Object
' Use the Excel file full path. Just the filename of the workbook will not work'
Set xlApp = GetObject().Application
' close the exported workbook'
xlApp.Workbooks(1).Close False
' close the excel instance'
xlApp.Quit
End Sub
Hey Joel do you know how can we pass multiple document no in one shot during automation (to avoid loop repetition ) . Please suggest , Thanks in Advance
Hi there, do you mean copy and paste using clipboard?
@@JoelTing no during Automation we are using loop ...but bot pick one document no from excel then put in SAP ... but my requirement how can our bot will go for 10 document in one shot
Are you able to do it in bulk in SAP manually? If yes, you may be able to replicate it in the script. But if it's not, there's simply no such option. SAP GUI script is just helping you to do the work. If SAP GUI only accepts one document at a time, then my understanding is that the only option for the script to run is via a loop.
@@JoelTing yes I am able to run manually
When you are doing it manually, I believe you are using a simple copy and paste? You can record the script to use the upload from clipboard button. Before running that line, use the range.copy() method to copy the range and click on the "Upload from Clipboard" button using the script. This way, it will be pasted into SAP like how you did manually.
Hi Joel, Your this video was helpful.
Could you help me with this error pop
"the enumerator of the collection cannot find an element with the specified index".
It comes when I try execute this line of code. " Set Session=objconn.children(0)"
Hi there. Have you logged into SAP and in an active session already? The script is not able to find a SAP session to connect to. If it is already opened, then it may be due to scripting being disabled/not enabled by your company.
Hi Joel I really appreciate your helpful videos. I am using the Power Automate VB function and I am encountering a problem that I cant solve, maybe you can help? When I try to add a new employee the script fails at the point of Create Actions. I can see that it creates red brackets around the entire create actions page, those brackets would normally appear against a data input field and it then fails. When I run the script and it falls over, I have tried to record the script from that point however as soon as I click on the record script function in SAP, the brackets around the page disappear. I am at a loss as to how to resolve this.. If you could assist me I would be very grateful.
Hi Jollest Mc, when you mentioned that it failed at the point of Create Actions, do you mean when it is running the SAP VB script? Or are you using Click UI element etc to access the data input field?
How do you address error " Invalid GUI input data: FOCUS DATA"
Hi Martin, I have personally not faced this error before. Do you mind sharing which specific line result in the error?
Hi Joel, the VBA script fails when in SAP it is needed to paste one code first to enable the list option for pasting a list of codes to extract. Is there a solution to this?
Similar to what you will do previously, during your recording, paste one line first, then click on the list option and then paste in. When you are making it dynamic, when pasting the 1st line, you can use the first element in the list, then proceed with pasting the rest after the list option is available. Will that perform what you expect?
Hey Joel!
Having an issue......the macro is running smooth on my system but cannot run it on my colleagues' system,
Prompts an error on the first step!!
Any idea?
Hey Tallal Aazmi, do you know what's the error code they are having?
@@JoelTing
Hello Joel,
Sorry for the replying late,
I've getting this error
Runtime-Error '-227221020(800401e4)':
Automation Error
Invalid Syntax
Hi Tallal Aazmi, is the SAP GUI Scripting API enabled under reference in your colleagues' system?
Hi Joel,
i must say very rich content👏👏👏👏
could you please help me how to change the system, as in my organisation recording is allowed in the "Quality system" only, how to use the scripts recorded in the "Quality system" to "Production system".
Thanks
Hi Amit, I'm not sure how that would work though. You can try developing your script in quality system, then log off from that and log into production system before running the script. Would that work?
@@JoelTing thanks man🤘.... I'll explore this option as well.
Very nice video :)
Do You know how to undo "Always Use Selected Format" of spreadsheet?
Hi SimpleExcelVBA,
Right click anywhere on the grid in SAP and click on spreadsheet. It should give you the option to untick the always use selected format again
Btw, thanks for watching. I have watched your video before and it kind of get me started with SAP Scripting. Thanks a lot of your video as well! Appreciate it.
@@JoelTing Wow! Thank You. Really nice to hear that! Let's stay in touch in case of any issue connected with SAP or any programming issue :)
Hi,
How to do copy-paste from clipboard in VIM (SAP) using SAP GUI VBA?
Hi Kalyana, when you copy using Ctrl+C, is the scripting recording tool able to capture the shortcut or keystrokes?
@@JoelTing I saw one of your video about VBA - SAP GUI and I found the solution in it. Thanks a lot.
Hi, Joel.
The script works fine for me. But when another user tries to use the script, it gives them a compile error: Variable not defined in this line:
Set objConn = objGui.Children(0)
We've configured the SAP settings already and did the excel preparations, etc. before running the script.
What I suspect is that it's because I recorded and tested the script in the 'development system' and the user is trying to run the script in the 'production system'. I'm not sure though
The script recording is allowed only in our development system. However, we have configured everything already in the user's production system before we ran the script.
Hi Lara,
If that's the case, that means that users are blocked from executing any SAP GUI script in the production server. Usually that needs to be enabled by admin in transaction RZ11 sapgui/user_scripting for the production server.
@@JoelTing This was really the case 😅 Anyway, thank you so much!
Hi, muchas gracias por compartir el conocimiento
Thanks again!
Dear Joel, thanks a lot for the amazing video. But I cannot find the ‘sapfewse.ocx’ file on my desktop. 😭
Hi keirei go, you are still not able to find it using the browse button and changing the file type to ActiveX Control? Just wanted to understand, are you using Citrix so access SAP GUI? I have encountered some instances where Citrix is being used, and the script will not work in VBA.
I am getting an error while trying to log on to SAP.
Click failed ( failed to get UI element)
Hi, are you at the same page as when you first started recording?
@@JoelTing yes. Moreover, when I get logged onto SAP I observe that my PAD recorded does not recognize the various UI elements on the page.
@@JoelTing Even when I try to click any text box on the page, PAD shows only a Pane and not that particular UI element. Please help me. My company wont give the previleges for record & playback scripts. My only change is through desktop recorder
@@MukeshMishra-kl2fn unfortunately, PAD recording function does not work with SAP GUI. It is not able to capture all the elements. If your company do not allow record & playback scripts, you will not be able to record or execute any SAP automation scripts.
@@JoelTing Ok thanks for clarifying.
How to disable auto opening of sap downloads in excel?
Hi there. Credits to Patrick Migues, he suggested to try the following:
Dim export1 As Object
Dim export2 As Object
Set export1 = GetObject(“file location\Export 1.file extension”).Application
Set export2 = GetObject(“file location\Export 2.file extension”).Application
export1.Workbooks(1).Close
export2.Workbooks(1).Close
export2.Quit
Error Situations: This will close either all of the Excel files opened after the Macro is run, explicitly listed or not (running correctly); or it will close all of the excel files opened prior to running the macro, to include the file running the Macro, if one of the explicitly listed files is not open or saved to the listed location.
Because of the above, when this code fails, it will not throw a debug error.
I gave up working on that part as I felt like it's not a good use of my time to keep trying and debugging this one simple action of closing the workbook, since I automated the most time consuming part.
I really have a concern. Can you run a recoded sap gui macro with Sap not open?
Hi Abdulelah Alfi, no. SAP GUI macro functions by imitating user clicks and interactions with SAP GUI. So it needs to be opened to be ran.
Hi Joel, I have an issue in selecting layout in SAP while running the script in Macro. I have set my default layout while recording the script and Macro is working on the same day with default layout but when I am running it after 2-3 days layout is changing so the output I want is not coming with the changed layout. Can you help me how to fix this issue?
Hi kotipalli sowmya. In that case I would recommend you to record a version where you type in the layout name into the layout textbox. Avoid using default as this may be changed by others, resulting in inconsistent output. SAP Scripting only helps you to perform repetitive steps. As much as possible, we want to avoid using settings that may change the outcome.
@@JoelTing thank you for your prompt reply but unfortunately there is no text box to type in the layout name for the T code I am running
@@kotipallisowmya8410 how about you add in the steps to select your layout via a search? Every run, click on the select layout button, then search for your layout. Then click accordingly, see if the scripting is able to replicate searching for your layout
Your videos are good reference for me for developing my projects requirements. Thanks a ton👍
Am getting debug error how to fix that
What debug error you are getting? There's a lot of possibility and it will be hard to know what went wrong without knowing the details.
I cant find sap gui in vba what can i do?
Hello! Can you try navigating to C:\Program Files (x86)\SAP\FrontEnd\SAPgui using file explorer and check if sapfewse.ocx file is there? Are you able to record script before going into VBA?
@@JoelTing yes i can record the Script and now i have the connction. Unfortunately my Skript when i just copy and paste does not work. It seems He does not find the Connection to my sap. What can i do for that
@@markuskamot9910 What error did you e
I have tried several time to enable script recording with given tips but still that option is disabled. Please help SAP logon 730
Hi Bhanuka, may I know if there's any error shown when you are trying to enabled the option? Or is that option being disabled and greyed out all the time? If it's always disabled, chances are it's due to the company blocked its user from using scripting and there's not much that can be done (other than asking IT/admin to enable it in server) from a user perspective.
Hi, what is error 619 and how to solve it?
Hi Kalyana, this seems to be happening when the script cannot find the buttons/boxes to activate as written in your script. You may try debugging it step by step, see which step does your script goes wrong then determine how to fix it. Maybe some of the steps are not working as expected
👍
I still don’t have SAP GUI API
Please I need your help
Btw, thank you for the helpful video, but still I can’t use SAP GUI APi
Hi xeemv, just wanted to understand, did you have SAP GUI installed in your local computer? Or is it accessed via Citrix? If it is via Citrix, then, you wont be able to use Scripting with Excel VBA as it is not able to communicate with it.
Some time I get below error...how to fix it...
Run-time error ¹-2147418110 (800 10002)':
Method 'FindById' of object 'ISapSessionTarget' failed
Hi Vijay, you can try to troubleshoot step by step. See which step is giving the issue. For findbyID error, you can check if the error is triggered because the script did not manage to navigate to the page like what was recorded.
@@JoelTing it showing error to
Session findbyid (wnd [0]".Maxmize
In drag the above to watch window under Value -