Please keep making recordings, they are great, I can't find this information anywhere else ! I was trying to create bots using Blue Prism and interacting with SAP to run variants etc is so hard. Then i found script recorder, then your video's, and now all my automations are so easy and I can easily get Blue Prism to run the macro's in excel. You are an absolute life saver, please make more recordings on anything you think would be helpful. I am a process improvement specialist - trying to automate as much as possible for our central transactions team (AP, SD, AR), general staff GR/SES and finance staff. I have watched most of your video's on SAP scripting and downloaded your excel files with your code in to interrogate and learn from - thankyou !!
hey you did this! Awesome. I wrote a script last year using your outline of code (in Excel VBA) to save screenshots into an Excel worksheet (the script leaves a bit of space between each one). Great work. Thanks again for all the templates.
Thanks a lot for taking the time to share and explain not only your code but the basic of scripting in SAP and how to control it from a macro in Excel: Excellent job I'll try to mimic and adapt as much as possible to my work, I'm just a newby in this, but I certainly learned a lot from this video.
@@csongorvarga I did sucesfully create several mini-macros that runs scripts in SAP taking values from some tables in EXCEL. Happily, my SAP profile granted the options to create scripts. As expected, it was not easy task but thanks to your guidance and a lot perserverance (trial and error) it finally worked. I'm still in the learning-beginner phase, but really happy with the results. Thanks again
Sure, you can programatically create new worksheets in Excel. I don't have a code for it, but record the steps with macro recording and see what code gets generated.
This video is very helpful and it helps me a lot with my automation. I wonder how to take screenshots when there's like a long list and need to scroll down so the screenshots capture all data needed. Is there any way to do it without using the number of clicks as guidance to put the codes? Thank you!
Thanks for recording this - I have started to use GUI scripting to speed up testing and it has helped hugely but I was missing the screenshots. I'm trying to use your script but I'm getting an error at "Set worddoc = wordapp.documents.Open(folder + template)" although I've replaced your example screen path and file with mine. Do you have any suggestions please - sorry I am relatively new to this
Did you put a '/' at the end of the path? This code just add the filename to the path and if the path does not terminate with a / your last folder get concatenated with the filename.
@@csongorvarga Thanks for the quick reply...that was exactly what I had missed! I really should have looked at the simple bit - I was going mad looking at the code!
Hi, I tried to find "SAP GUI scripting API" or "sapfewse.ocx" in Tools/reference (video 8:30), but I didn't find it. How can I check if I have the function for me to run my scripts directly in excel? These videos you shared are really helpful for me as a beginner of SAP. Hope I can learn more from your channel. 😊
@csongorvarga - Could you please help me what kind for VBA code can I use to take screenshot of any SAP window and paste it to excel sheet. for example fs10n screenshot to be placed in excel sheet
The code in this example shows you how to take a screenshot. What works in Word, works in Excel as well. And to paste the picture to Excel, record a macro in Excel and it will generate the code for you.
I am facing an error when I run it in P94 (1) 110 Run Time error '5174': Sorry we couldn't find your file. Was it moved, renamed, or deleted.... How can I fix the error?
Hi Csongor, this is amazing work. I've been following you for the past 3 years now. I wanted to ask if you could consider a script that opens a Purchase Order and somehow gets it exported to PDF or any other readable format. SAP allows you to click on the print preview button, and shows page-by-page each page of the Purchase Order, but I'm struggling to find a way to get the whole PO out into 1 single document. Any thoughts or idears?
I try to run the excel and code as provided. The code only copies what I have in the clipboard prior to starting the macro, the screen does not seem to be copied? any suggestions on how to correct @csongorvarga
Can we run two scripts at a single time.....well like simultaneously in two different windows.And the videos you posted ages ago are very useful for me 😊, thanks
If you connect to two different sessions, you need two session objects. So my code needs to be changed a lot as my variables are global, but there is no issue it would not work.
Interesting video. I'm very new to SAP scripting, then it seems a little bit complicated. I'd like to extract a report taking screenshots of the initial screen and report result.
Any tips how to create excel, which would post invoices via FB01 with multiple lines? i guess there is a need for a loop between header data and posting keys. Thank you in advance for replay.
Yes, I would use that. FB01 is probably using gridview and you can address each line individually. So you can just cycle through lines 1 to n and add the line item details.
You talked about needing to kill word in the background and restarting excel at times. Have you ever experienced GUI scripting, sap randomly shutting down without any error messages? What’s weird is, is won’t consistently shut down every time at the same line. It might shut down on like 10 one time, line 20 another, and the next, it might be line 15. If I run the code all at once (F5) as opposed to steeping though (F8), it never shuts down without an error. Only when stepping through. Any thoughts?
Hey, I experienced similar issue. For me it usually happened when I used "SET" function and went through certain GUI elements on "Locals" window in VBA. It was some time ago, I'm not quite sure what Interner said about it but in the end I never found a succesfull solution for it.
In the transactions I have seen, when you select a PDF document, it opens it an Adobe PDF Viewer window and you use the save button in the PDF Window. But since that is not part of the SAP GUI you cannot script it. It will only work if you get the SAP save dialog as in my video.
Thank you for making this, it is very useful. If possible, can we get the SAPGui scripting code that takes just the screenshot? Just to compare there is code in SAP help (navigate from SAP Gui screen) that worked: file:///C:/Program%20Files%20(x86)/SAP/FrontEnd/sapgui/sapguihelp/ScriptingAPI/f3812bd3dfdf4f32ab62b30551d0ca68.html
Please keep making recordings, they are great, I can't find this information anywhere else ! I was trying to create bots using Blue Prism and interacting with SAP to run variants etc is so hard. Then i found script recorder, then your video's, and now all my automations are so easy and I can easily get Blue Prism to run the macro's in excel. You are an absolute life saver, please make more recordings on anything you think would be helpful. I am a process improvement specialist - trying to automate as much as possible for our central transactions team (AP, SD, AR), general staff GR/SES and finance staff. I have watched most of your video's on SAP scripting and downloaded your excel files with your code in to interrogate and learn from - thankyou !!
Great to see you getting back into SAP scripting help videos :)
hey you did this! Awesome. I wrote a script last year using your outline of code (in Excel VBA) to save screenshots into an Excel worksheet (the script leaves a bit of space between each one). Great work. Thanks again for all the templates.
Hello, if you don't mind can you share the file link with me ? It will be a great help 👍
Thanks a lot for taking the time to share and explain not only your code but the basic of scripting in SAP and how to control it from a macro in Excel: Excellent job
I'll try to mimic and adapt as much as possible to my work, I'm just a newby in this, but I certainly learned a lot from this video.
You are welcome, I hope you get yours done as well.
@@csongorvarga I did sucesfully create several mini-macros that runs scripts in SAP taking values from some tables in EXCEL. Happily, my SAP profile granted the options to create scripts. As expected, it was not easy task but thanks to your guidance and a lot perserverance (trial and error) it finally worked. I'm still in the learning-beginner phase, but really happy with the results. Thanks again
Posting in f-02 after saving ,it will provide document number ..how can we copy paste from SAP to excel file ... Please provide macro
Is there a way I can generate the screenshots for each PO in separate tabs, for each PO, within the excel workbook?
Sure, you can programatically create new worksheets in Excel. I don't have a code for it, but record the steps with macro recording and see what code gets generated.
This video is very helpful and it helps me a lot with my automation. I wonder how to take screenshots when there's like a long list and need to scroll down so the screenshots capture all data needed. Is there any way to do it without using the number of clicks as guidance to put the codes? Thank you!
What do you mean number of clicks?
How to attach supporting files in posted document...with help for script recording?
It is great Video. Awesome in many ways, Suggestion - May be keep the example with one PO and make the whole story simple
Thanks for recording this - I have started to use GUI scripting to speed up testing and it has helped hugely but I was missing the screenshots. I'm trying to use your script but I'm getting an error at "Set worddoc = wordapp.documents.Open(folder + template)" although I've replaced your example screen path and file with mine. Do you have any suggestions please - sorry I am relatively new to this
Did you put a '/' at the end of the path? This code just add the filename to the path and if the path does not terminate with a / your last folder get concatenated with the filename.
@@csongorvarga Thanks for the quick reply...that was exactly what I had missed! I really should have looked at the simple bit - I was going mad looking at the code!
Amazing, dude !! Thanks a lot !
Hi, I tried to find "SAP GUI scripting API" or "sapfewse.ocx" in Tools/reference (video 8:30), but I didn't find it.
How can I check if I have the function for me to run my scripts directly in excel?
These videos you shared are really helpful for me as a beginner of SAP. Hope I can learn more from your channel. 😊
@csongorvarga - Could you please help me what kind for VBA code can I use to take screenshot of any SAP window and paste it to excel sheet. for example fs10n screenshot to be placed in excel sheet
The code in this example shows you how to take a screenshot. What works in Word, works in Excel as well. And to paste the picture to Excel, record a macro in Excel and it will generate the code for you.
I am facing an error when I run it in P94 (1) 110 Run Time error '5174': Sorry we couldn't find your file. Was it moved, renamed, or deleted.... How can I fix the error?
That is a good question. You probably have to debug it to see what the path for the file is. Can you make sure your path in E6 ends with a backslash?
Hi Csongor, this is amazing work. I've been following you for the past 3 years now. I wanted to ask if you could consider a script that opens a Purchase Order and somehow gets it exported to PDF or any other readable format. SAP allows you to click on the print preview button, and shows page-by-page each page of the Purchase Order, but I'm struggling to find a way to get the whole PO out into 1 single document. Any thoughts or idears?
I try to run the excel and code as provided. The code only copies what I have in the clipboard prior to starting the macro, the screen does not seem to be copied? any suggestions on how to correct @csongorvarga
Can we run two scripts at a single time.....well like simultaneously in two different windows.And the videos you posted ages ago are very useful for me 😊, thanks
If you connect to two different sessions, you need two session objects. So my code needs to be changed a lot as my variables are global, but there is no issue it would not work.
Interesting video. I'm very new to SAP scripting, then it seems a little bit complicated. I'd like to extract a report taking screenshots of the initial screen and report result.
Any tips how to create excel, which would post invoices via FB01 with multiple lines? i guess there is a need for a loop between header data and posting keys. Thank you in advance for replay.
Yes, I would use that. FB01 is probably using gridview and you can address each line individually. So you can just cycle through lines 1 to n and add the line item details.
@@csongorvarga have you received my mail? is that one gmail account valid?
You talked about needing to kill word in the background and restarting excel at times. Have you ever experienced GUI scripting, sap randomly shutting down without any error messages? What’s weird is, is won’t consistently shut down every time at the same line. It might shut down on like 10 one time, line 20 another, and the next, it might be line 15. If I run the code all at once (F5) as opposed to steeping though (F8), it never shuts down without an error. Only when stepping through. Any thoughts?
Sorry, I never had any such issue. SAP and Excel is stable for me, even if I am running or stepping through in debug mode.
Hey, I experienced similar issue. For me it usually happened when I used "SET" function and went through certain GUI elements on "Locals" window in VBA. It was some time ago, I'm not quite sure what Interner said about it but in the end I never found a succesfull solution for it.
is it possible to have vba to extract pdf from sap?
In the transactions I have seen, when you select a PDF document, it opens it an Adobe PDF Viewer window and you use the save button in the PDF Window. But since that is not part of the SAP GUI you cannot script it. It will only work if you get the SAP save dialog as in my video.
Can you please send me the file
11:52
Thank you for making this, it is very useful. If possible, can we get the SAPGui scripting code that takes just the screenshot? Just to compare there is code in SAP help (navigate from SAP Gui screen) that worked: file:///C:/Program%20Files%20(x86)/SAP/FrontEnd/sapgui/sapguihelp/ScriptingAPI/f3812bd3dfdf4f32ab62b30551d0ca68.html
You are Great !! The (.iconify) works awesome for Screenshot : Thank you very much for Video ...