Automate Bulk PDF Extraction with Excel VBA and SAP GUI Scripting

Поділитися
Вставка
  • Опубліковано 13 гру 2024

КОМЕНТАРІ • 63

  • @JoelTing
    @JoelTing  5 місяців тому

    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/

  • @micuentaotakumats4083
    @micuentaotakumats4083 Рік тому +1

    Que hombre tan pro, muchas gracias por compartir tu conocimiento ❤️

  • @loveenasukhija3015
    @loveenasukhija3015 5 місяців тому

    Hi Joel, thank you for sharing your knowledge. It was really helpful 😊

  • @guan_meng
    @guan_meng Рік тому +1

    Microsoft Edge has replaced the defunct Microsoft Internet Explorer. Could you share about Excel VBA automation for SAP using Microsoft Edge? Thank you. 😊

  • @Receivable
    @Receivable Рік тому

    Great information. Thank you for sharing!

  • @estebanrocco942
    @estebanrocco942 Рік тому +1

    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.

    • @JoelTing
      @JoelTing  Рік тому +1

      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.

    • @loliloucrew
      @loliloucrew Рік тому +2

      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".

    • @saikatdasgupta5433
      @saikatdasgupta5433 11 місяців тому

      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.

    • @DeivaKumar-l9m
      @DeivaKumar-l9m 9 місяців тому +1

      DOUBT PLS EXPIIN ME

  • @BenAngel-b1b
    @BenAngel-b1b Рік тому

    This is insanely amazing thank you so much

  • @MlungisiSimelane-j3v
    @MlungisiSimelane-j3v Рік тому

    @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????

    • @JoelTing
      @JoelTing  Рік тому

      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

  • @williamrinversi5785
    @williamrinversi5785 Місяць тому

    Hi Joel, when I display the BrowserHandle, the LocationURL is not visible. Any other way to get the URL?

    • @JoelTing
      @JoelTing  Місяць тому

      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.

  • @chengyixie4761
    @chengyixie4761 25 днів тому

    Hello everyone, may I know what is the element ID of VF03-PDF?

    • @JoelTing
      @JoelTing  22 дні тому

      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.

  • @fechedenes522
    @fechedenes522 Рік тому

    I wondering can we make Error ANALYZER automation in SAP?

    • @JoelTing
      @JoelTing  Рік тому

      Hi, may I clarify, what do you meant by Error ANALYZER automation?

  • @Cjvllmr
    @Cjvllmr Рік тому +1

    Hello, i cannot save the pdf to the destination file path. I followed your coding. What to do?

    • @JoelTing
      @JoelTing  Рік тому

      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.

    • @Cjvllmr
      @Cjvllmr Рік тому

      @@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

    • @JoelTing
      @JoelTing  Рік тому

      @@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?

    • @Cjvllmr
      @Cjvllmr Рік тому

      @@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?

    • @JoelTing
      @JoelTing  Рік тому

      @@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

  • @fakhrullnoor4102
    @fakhrullnoor4102 Рік тому

    hi joel..how did u install sap in ur computer? can i download and using it from our personal computer?

    • @JoelTing
      @JoelTing  Рік тому

      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.

  • @winniechin-l5f
    @winniechin-l5f 9 місяців тому

    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?

    • @JoelTing
      @JoelTing  8 місяців тому

      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?

  • @prakashsparrow3842
    @prakashsparrow3842 Рік тому

    Is that any other way to find the element id in sap?

    • @JoelTing
      @JoelTing  Рік тому

      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.

  • @reng7777
    @reng7777 Рік тому

    Awesome!!!

  • @albeehernandez7920
    @albeehernandez7920 2 місяці тому

    how can I get a Scripting Tracker?

    • @JoelTing
      @JoelTing  Місяць тому

      Hello. You can check it listed in the description box of this video:
      ua-cam.com/video/VBmbuSXRvIg/v-deo.html

  • @monke8478
    @monke8478 Рік тому +1

    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

    • @JoelTing
      @JoelTing  Рік тому +1

      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.

    • @DeivaKumar-l9m
      @DeivaKumar-l9m 9 місяців тому

      HII BRO SMALL DOUBT PLS EXPLAIN ME

  • @s1ngularityxd64
    @s1ngularityxd64 Рік тому

    really helpful 🙂

  • @JohanSebastiánAgudelobejarano
    @JohanSebastiánAgudelobejarano 9 місяців тому

    genial! puedes por favor hacer un video para grabar e imprimir ordenes de compra en base a una me53n a una me21n

    • @JoelTing
      @JoelTing  8 місяців тому

      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.

  • @subramaniyamm7200
    @subramaniyamm7200 Рік тому

    How to attach email backup file in sap with help of vba?

    • @JoelTing
      @JoelTing  Рік тому

      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

    • @subramaniyamm7200
      @subramaniyamm7200 Рік тому

      @@JoelTing but am getting error msg, if possible pls share with your video link, i will refer the video. Thanks

  • @sarfarazalam459
    @sarfarazalam459 Рік тому

    Is it same for T CODE -FBL3N?

    • @JoelTing
      @JoelTing  Рік тому

      FBL3N is just GL Account Line Item Display right? So there's no PDF? unless you are referring to attachment of individual documents

  • @786VIMAL
    @786VIMAL Рік тому +1

    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.

    • @loliloucrew
      @loliloucrew Рік тому +1

      HI,
      I have same question as you have. I searched on line but was not able to figure it out ...

    • @786VIMAL
      @786VIMAL Рік тому

      @@loliloucrew I also search online but unable to find any solution for it let's wait for Joel reply.

    • @JoelTing
      @JoelTing  Рік тому +1

      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.

    • @786VIMAL
      @786VIMAL Рік тому

      @@JoelTing Thank you for sharing your knowledge on this I will try as suggested.

    • @loveenasukhija3015
      @loveenasukhija3015 5 місяців тому

      @@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

  • @JP-br7eh
    @JP-br7eh 4 місяці тому

    destinationFilePath = empty

    • @JP-br7eh
      @JP-br7eh 4 місяці тому

      how to solve ?

    • @JoelTing
      @JoelTing  4 місяці тому

      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.

  • @PatriciaClaireCruz
    @PatriciaClaireCruz 9 місяців тому

    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?

    • @JoelTing
      @JoelTing  9 місяців тому

      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.

    • @PatriciaClaireCruz
      @PatriciaClaireCruz 9 місяців тому

      @@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?

    • @JoelTing
      @JoelTing  9 місяців тому

      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.

    • @PatriciaClaireCruz
      @PatriciaClaireCruz 9 місяців тому

      @@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.

    • @JoelTing
      @JoelTing  9 місяців тому

      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