I just launched "SAP GUI Scripting: Understanding the Basics" ebook! If you are interested to learn more, check it out in the link below: joelting.com/sap-ebook/
Microsoft Edge has replaced the defunct Microsoft Internet Explorer. Could you share about Excel VBA automation for SAP using Microsoft Edge? Thank you. 😊
Hi Joel, thanks for sharing your knowledge! I was wondering if something like this can be applied to download the PDFs of invoices in the T Code VF03. I know that bulk PDFs can be downloaded from T Code VF31, but I need input their respective names for each one.
I see. I am not too familiar with VF31 and VF03. As long as you are using PDF! transaction to export your PDF and your company allow scripting in production environment, usually it's not an issue.
Thnks for the knowledge sharing. I don't have access the c drive.So while running your code file not save.please suggest the alternative code to save the pdf. Thanks in advance.
@joel what happens when there is no attachement at all on the order? How would code look like if in a case a Sales Order no attachment, it populates next to SO in excel that "No attachment" then continues with the other orders????
Hi there, I assume the attachment is a table list in SAP? For the attachment table, you can check the number of rows available in the table to see if there's attachment. If there's more than 1 row (attachment available), then execute the remaining script, else, update Excel to label no attachment and proceed with the next iteration in the loop
Hello. So far, I am only able to get it work with LocationURL. Have you switched the Browser Control in SAP to Internet Explorer? When I use Edge as my Browser Control, then I am not able to locate the LocationURL.
Hi there, what error are you encountering? At which steps does it fail? Are you using the PDF! command? You can always use the watch window in the VBA editor to check what went wrong and how it went wrong.
@@JoelTing Thank you for the response, the error fall on the FileCopy sourceFilePath, DestinationFilePath (RUN TIME ERROR '53' , when i try to run the codes it always stopped there and the error pop up. what do i need to do to correct the code and run it smoothly, your help will be so much appreciated, It will help me with my project. THank you and keep safe! Godbless
@@Cjvllmr This error seems to be saying that it isn't not able to locate the file. Can you check what is the sourceFilePath variable value at the point of error?
@@JoelTing the sourcefilepath is saving on the hidden folder, i do not know if i can change it since its our companys laptop, can i change the sourcefilepath where the pdf is saving? Is there any work around to make this work?
@@Cjvllmr the sourceFilePath is the hidden folder where the PDF is stored. The file copy function is basically taking the PDF generated in that hidden folder and copy it over to your destination file path. The sourceFilePath should not be changed. It is generated from the previous steps
Hi there. You will need access to a SAP server. It is not free and usually they will be charging a monthly fee. You can try and google for "SAP Live Access". There's different providers for this service.
Another way to find the element ID is just to interact with the item (can be clicks) so that it is being recorded. When you are looking at the recorded script, you will be able to see the ID being recorded with its method.
Hi Joel. I wanted to ask if its possible to extract data from SAP and transport it to an existing excel tracker / spreadsheet? Is there a way to automate this so that I don't have to log on to SAP everyday and manually extract the data from SAP to my excel tracker
Hi there. If scripting is enabled, it is possible to extract data and copy it over to an existing spreadsheet. The log on step can be a bit challenging. If your company uses Single Sign On, it may not be possible to automate the process based on my understanding. Even if you are able to develop that automation, as log on requires user id and password information, we will need to think of a way to store that information securely.
Hi there! I'm not too familiar with the purchasing cycle processes. As a start, try to understand the starting point. See where you can 1st get the information you need (could be a SAP label or range of Excel cells), then think about how you can pass it into the script until it reaches its final outcome.
Hi Joel, Great Video for fetching bulk pdf files. I have one question in this regard. How to find element ID "wnd[1]/usr/cntlHTML/shellcont/shell" without using scripting tracker as I need for Tcode ME23N to download Purchase Order.
Hi there, sorry, I missed your comment. The quickest way to get the element ID is using the scripting tracker. Without the scripting tracker, it's possible but it's tedious. You can try to use Excel watch window to do that. Once you are at the Print Screen page, add "Session.findById("wnd[0]/usr")" to your watch list. Expand the "Children" property and you should see "Item 1", "Item 2" etc.... Expand further "Item 1" or "Item 2" and look for the subtype "HTMLViewer". If you are not able to find, continue to expand the Items until you find the subtype "HTMLViewer". This is the subtype containing the "BrowserHandle" property, which is the PDF viewer that you are looking for.
Hey there. I'm not able to understand what happened there with so little context. It could be the Browser Handle not returning the file name or it could be some other reason that breaks the assignment of that variable.
Hi Joel, thank you for your video. Great help! Although, I encountered some problems along the way. I can download some Sales Order smoothly without errors, but there are some that shows "the control could not be found by id" in this Set container = Session.FindById("wnd[1]/usr/cntlHTML/shellcont/shell"). can you help how to debug this?
Hi there. Are you able to tell the difference when the error happen and when it runs smoothly? This seems like the HTML container is not loaded yet, or it is using an entirely different element to load the PDF.
@@JoelTing figured out the solution to this. I had to tell my colleague who is testing my code to use internet explorer instead. However, I’m encountering several problems when I had my colleagues test out the code. It works perfectly well on my laptop but when they test it out, problem occurs like the naming and saving of files in specific folder. Do you have a work around on this?
When you mentioned naming and saving of files, is it because you are putting the destination file path as a static folder in the code itself which they dont have? If that's the case. what you could do is to check if the folder directory exist. If it does not, then create the directory before you proceed to move the file to that folder.
@@JoelTing I think the issue why it is not proceeding to download is because of the security pop-up of SAP "do you want to save this file". I think SAP scripting cannot record it. Do you happen to know the code? Unfortunately, I cannot disable security in my colleague's app.
I did some searching online. It seems like an issue with the Adobe Reader where it is not opening the file in SAP. They are not able to preview the PDF file within SAP GUI in the first place, and that basically breaks your code. Maybe you can try the following on their laptop: 1) Check if they have Adobe Reader installed 2) Check the Adobe Reader "Preferences" -> "Internet" and make sure everything is checked 3) In Internet Explorer, "Tools" > "Manage Add-ons" > "Toolbars and Extensions", make sure "Adobe PDF Reader" is enabled I found this in SAP community. community.sap.com/t5/technology-q-a/unable-to-view-pdf-files-in-infoview/qaq-p/4631345
I just launched "SAP GUI Scripting: Understanding the Basics" ebook! If you are interested to learn more, check it out in the link below:
joelting.com/sap-ebook/
Que hombre tan pro, muchas gracias por compartir tu conocimiento ❤️
Hi Joel, thank you for sharing your knowledge. It was really helpful 😊
Microsoft Edge has replaced the defunct Microsoft Internet Explorer. Could you share about Excel VBA automation for SAP using Microsoft Edge? Thank you. 😊
Great information. Thank you for sharing!
Hi Joel, thanks for sharing your knowledge! I was wondering if something like this can be applied to download the PDFs of invoices in the T Code VF03. I know that bulk PDFs can be downloaded from T Code VF31, but I need input their respective names for each one.
I see. I am not too familiar with VF31 and VF03. As long as you are using PDF! transaction to export your PDF and your company allow scripting in production environment, usually it's not an issue.
Hi Estaban,
Thanks to Joel's scripting, I was able to adapt to VF03 tcode to download the invoices and it works perfectly by using the "editing".
Thnks for the knowledge sharing. I don't have access the c drive.So while running your code file not save.please suggest the alternative code to save the pdf. Thanks in advance.
DOUBT PLS EXPIIN ME
This is insanely amazing thank you so much
@joel what happens when there is no attachement at all on the order? How would code look like if in a case a Sales Order no attachment, it populates next to SO in excel that "No attachment" then continues with the other orders????
Hi there, I assume the attachment is a table list in SAP? For the attachment table, you can check the number of rows available in the table to see if there's attachment. If there's more than 1 row (attachment available), then execute the remaining script, else, update Excel to label no attachment and proceed with the next iteration in the loop
Hi Joel, when I display the BrowserHandle, the LocationURL is not visible. Any other way to get the URL?
Hello. So far, I am only able to get it work with LocationURL. Have you switched the Browser Control in SAP to Internet Explorer? When I use Edge as my Browser Control, then I am not able to locate the LocationURL.
Hello everyone, may I know what is the element ID of VF03-PDF?
Hello! I'm not too sure what you are looking at. Do you have scripting tracker installed? You can try using that to check the ID.
I wondering can we make Error ANALYZER automation in SAP?
Hi, may I clarify, what do you meant by Error ANALYZER automation?
Hello, i cannot save the pdf to the destination file path. I followed your coding. What to do?
Hi there, what error are you encountering? At which steps does it fail? Are you using the PDF! command? You can always use the watch window in the VBA editor to check what went wrong and how it went wrong.
@@JoelTing Thank you for the response, the error fall on the FileCopy sourceFilePath, DestinationFilePath (RUN TIME ERROR '53' , when i try to run the codes it always stopped there and the error pop up. what do i need to do to correct the code and run it smoothly, your help will be so much appreciated, It will help me with my project. THank you and keep safe! Godbless
@@Cjvllmr This error seems to be saying that it isn't not able to locate the file. Can you check what is the sourceFilePath variable value at the point of error?
@@JoelTing the sourcefilepath is saving on the hidden folder, i do not know if i can change it since its our companys laptop, can i change the sourcefilepath where the pdf is saving? Is there any work around to make this work?
@@Cjvllmr the sourceFilePath is the hidden folder where the PDF is stored. The file copy function is basically taking the PDF generated in that hidden folder and copy it over to your destination file path. The sourceFilePath should not be changed. It is generated from the previous steps
hi joel..how did u install sap in ur computer? can i download and using it from our personal computer?
Hi there. You will need access to a SAP server. It is not free and usually they will be charging a monthly fee. You can try and google for "SAP Live Access". There's different providers for this service.
how if my file is in pdf form while I cant execute the "pdf!" function, how can I track the file location in order to save them?
Hi there. Usually how is the PDF file being displayed for you without the "pdf!" function? Is it like what I have shown in the video?
Is that any other way to find the element id in sap?
Another way to find the element ID is just to interact with the item (can be clicks) so that it is being recorded. When you are looking at the recorded script, you will be able to see the ID being recorded with its method.
Awesome!!!
how can I get a Scripting Tracker?
Hello. You can check it listed in the description box of this video:
ua-cam.com/video/VBmbuSXRvIg/v-deo.html
Hi Joel. I wanted to ask if its possible to extract data from SAP and transport it to an existing excel tracker / spreadsheet? Is there a way to automate this so that I don't have to log on to SAP everyday and manually extract the data from SAP to my excel tracker
Hi there. If scripting is enabled, it is possible to extract data and copy it over to an existing spreadsheet. The log on step can be a bit challenging. If your company uses Single Sign On, it may not be possible to automate the process based on my understanding. Even if you are able to develop that automation, as log on requires user id and password information, we will need to think of a way to store that information securely.
HII BRO SMALL DOUBT PLS EXPLAIN ME
really helpful 🙂
genial! puedes por favor hacer un video para grabar e imprimir ordenes de compra en base a una me53n a una me21n
Hi there! I'm not too familiar with the purchasing cycle processes. As a start, try to understand the starting point. See where you can 1st get the information you need (could be a SAP label or range of Excel cells), then think about how you can pass it into the script until it reaches its final outcome.
How to attach email backup file in sap with help of vba?
Hi, this can be done. Once you have the file path, you can use the outlook method - .Attachments.Add to attach the PDF into the email
@@JoelTing but am getting error msg, if possible pls share with your video link, i will refer the video. Thanks
Is it same for T CODE -FBL3N?
FBL3N is just GL Account Line Item Display right? So there's no PDF? unless you are referring to attachment of individual documents
Hi Joel, Great Video for fetching bulk pdf files. I have one question in this regard. How to find element ID "wnd[1]/usr/cntlHTML/shellcont/shell" without using scripting tracker as I need for Tcode ME23N to download Purchase Order.
HI,
I have same question as you have. I searched on line but was not able to figure it out ...
@@loliloucrew I also search online but unable to find any solution for it let's wait for Joel reply.
Hi there, sorry, I missed your comment. The quickest way to get the element ID is using the scripting tracker. Without the scripting tracker, it's possible but it's tedious. You can try to use Excel watch window to do that. Once you are at the Print Screen page, add "Session.findById("wnd[0]/usr")" to your watch list. Expand the "Children" property and you should see "Item 1", "Item 2" etc.... Expand further "Item 1" or "Item 2" and look for the subtype "HTMLViewer". If you are not able to find, continue to expand the Items until you find the subtype "HTMLViewer". This is the subtype containing the "BrowserHandle" property, which is the PDF viewer that you are looking for.
@@JoelTing Thank you for sharing your knowledge on this I will try as suggested.
@@JoelTinghi I am trying to find the element Id through this way however I am unable to get it. Can you do a short video on this as well
destinationFilePath = empty
how to solve ?
Hey there. I'm not able to understand what happened there with so little context. It could be the Browser Handle not returning the file name or it could be some other reason that breaks the assignment of that variable.
Hi Joel, thank you for your video. Great help! Although, I encountered some problems along the way. I can download some Sales Order smoothly without errors, but there are some that shows "the control could not be found by id" in this Set container = Session.FindById("wnd[1]/usr/cntlHTML/shellcont/shell"). can you help how to debug this?
Hi there. Are you able to tell the difference when the error happen and when it runs smoothly? This seems like the HTML container is not loaded yet, or it is using an entirely different element to load the PDF.
@@JoelTing figured out the solution to this. I had to tell my colleague who is testing my code to use internet explorer instead.
However, I’m encountering several problems when I had my colleagues test out the code. It works perfectly well on my laptop but when they test it out, problem occurs like the naming and saving of files in specific folder. Do you have a work around on this?
When you mentioned naming and saving of files, is it because you are putting the destination file path as a static folder in the code itself which they dont have? If that's the case. what you could do is to check if the folder directory exist. If it does not, then create the directory before you proceed to move the file to that folder.
@@JoelTing I think the issue why it is not proceeding to download is because of the security pop-up of SAP "do you want to save this file". I think SAP scripting cannot record it. Do you happen to know the code? Unfortunately, I cannot disable security in my colleague's app.
I did some searching online. It seems like an issue with the Adobe Reader where it is not opening the file in SAP. They are not able to preview the PDF file within SAP GUI in the first place, and that basically breaks your code. Maybe you can try the following on their laptop:
1) Check if they have Adobe Reader installed
2) Check the Adobe Reader "Preferences" -> "Internet" and make sure everything is checked
3) In Internet Explorer, "Tools" > "Manage Add-ons" > "Toolbars and Extensions", make sure "Adobe PDF Reader" is enabled
I found this in SAP community.
community.sap.com/t5/technology-q-a/unable-to-view-pdf-files-in-infoview/qaq-p/4631345