Automate Data Extraction with SAP GUI Scripting & Excel Macro VBA [english]

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 พ.ย. 2024

ความคิดเห็น • 112

  • @lisay5302
    @lisay5302 2 หลายเดือนก่อน

    This so amazing! Worked perfectly..already creaded 3 macros today after watching this video!

    • @CustAndCode
      @CustAndCode  2 หลายเดือนก่อน +1

      Awesome to hear. And thank you for watching and your feedback! 🤗

    • @lisay5302
      @lisay5302 2 หลายเดือนก่อน

      ​@CustAndCode question...what code do I use to dynamically change the from and to date. Using transaction COID need the from basic date field to = today date + 1 day and the to field to change from 7 days from today. The report would be ran every week.

  • @jeslaravishuda
    @jeslaravishuda 11 หลายเดือนก่อน

    Thank you so much, I learnt how to download a report that takes 1 hour of my time.

    • @CustAndCode
      @CustAndCode  10 หลายเดือนก่อน

      I'm glad you liked it. And thank you for watching! 🤗

  • @TheFundamentalChristian
    @TheFundamentalChristian 9 หลายเดือนก่อน

    This is great stuff! I look forward to utilizing this code into updating 100s of lines of balances from SAP into Excel. Right now the process is done manually and it takes my team many hours.

    • @CustAndCode
      @CustAndCode  9 หลายเดือนก่อน

      Great to hear! Hope you can save some time with this! 🤗

  • @atikkhan5121
    @atikkhan5121 หลายเดือนก่อน

    Very Informative and good explanation 👏 👍

    • @CustAndCode
      @CustAndCode  หลายเดือนก่อน

      I appreciate it and thank you for watching and commenting! 🤗

  • @juliusowan671
    @juliusowan671 10 หลายเดือนก่อน

    Too beautiful! Thank you for sharing this. Is there a way to automate a change of date

    • @CustAndCode
      @CustAndCode  10 หลายเดือนก่อน

      You mean export the same data in different excel sheets with different date parameter? 🤔

    • @zahirahannah557
      @zahirahannah557 หลายเดือนก่อน

      @@CustAndCode yes can we do it automatically?

  • @mrronaldino7298
    @mrronaldino7298 ปีที่แล้ว

    Thank you so much this will help me a lot as data analyst. However I am not authorized to use tcode RZ11. I will definitely raise a ticket for this for automation purposes!

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      I'm glad you liked it. And thank you for watching! 😀🤗

  • @lisay5302
    @lisay5302 3 หลายเดือนก่อน

    This is so awesome..thanks for sharing!

    • @CustAndCode
      @CustAndCode  3 หลายเดือนก่อน

      I'm glad you liked it. And thank you for watching! 🤗

  • @vijaysenthil7023
    @vijaysenthil7023 ปีที่แล้ว

    Thanks for your vedio its very easy to understand

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      I'm glad you liked it. And thank you for watching! 😃

  • @TheWanderercontent
    @TheWanderercontent 7 หลายเดือนก่อน

    That was great !! How would you adapt the script to pull the table each month ? Like a monthly report

    • @CustAndCode
      @CustAndCode  7 หลายเดือนก่อน +1

      For a monthly report I would implement it in ABAP. If you want to do it with VBA you have to call it manually every month. 🤗

    • @TheWanderercontent
      @TheWanderercontent 7 หลายเดือนก่อน

      @@CustAndCode thanks for the information ! do you have a video on that ?

    • @CustAndCode
      @CustAndCode  7 หลายเดือนก่อน

      @@TheWanderercontent Unfortunately not, I would use a ABAP Report for that. This repord I would call every month, or I would plan it as a job. 🤗

  • @GabrielSantos-ui2qi
    @GabrielSantos-ui2qi หลายเดือนก่อน

    Very useful! Do you know some way to automaticly disable the SAP message that shows up when you start the macro ? I mean using the macro itself to disable It...

    • @zahirahannah557
      @zahirahannah557 หลายเดือนก่อน

      i think you can search over the options > scripting > deselect all the notification..

    • @CustAndCode
      @CustAndCode  หลายเดือนก่อน

      Right 🤗

  • @Karimsalah92
    @Karimsalah92 ปีที่แล้ว

    thanks the video is very helpful i did it in a few minutes, but Sap needs to be opened, can you please support on how to embed in the VBA Code to open SAP automatically? and also how to make it extract automatically at a certain timing

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      I will check how to open the connection automatically. But I am not sure if it works at a certain timing. For this I would do it in ABAP and I would work here with Jobs. 🤗

  • @ZEESHANAHMADSIRHINDI
    @ZEESHANAHMADSIRHINDI ปีที่แล้ว

    Use full video, one question "Can we use VBA (macros) to upload file from excel to SAP" ?

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      No, for this you should use ABAP because you have to process the data from the Excel in SAP. I have already uploaded a video where I show this. 🤗

  • @그냥아는사람-q3y
    @그냥아는사람-q3y ปีที่แล้ว

    Thank you for your video. That was very helpful. Can I ask you a question? Is there a way to download all the files attached to the Sap accounting slip by using Guiscript? I don't know how to download the whole thing because the number of attachments is different for each slip.

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      I am not sure if SAP GUI Script the right solution for this. 🤔 I think I don't know too much about the SAP accounting slip. 🙄

  • @covid699
    @covid699 7 หลายเดือนก่อน

    Helped a ton. Thank you

    • @CustAndCode
      @CustAndCode  7 หลายเดือนก่อน

      You are welcome! 🤗 and thanks for watching! 🤗

  • @cegaraujo
    @cegaraujo ปีที่แล้ว

    Very didatic video. Thanks a lot!

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      Thanks for your feedback and thanks for watching! 🤗😀

  • @kapibara2440
    @kapibara2440 ปีที่แล้ว

    Fantastic video! Thank you sir 😊

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      You are welcome! Thanks for your feedback! 🤗

    • @kapibara2440
      @kapibara2440 ปีที่แล้ว

      ​@@CustAndCode I just realized I have no Access to Rz11 in my SAP, in my organization. I Wonder if there is a way to get there and enable script writing? Maybe an ADP ticket will help.

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      @@kapibara2440 RZ11 is normaly limited to Basis Administrators because it is used to access the system profile maintenance screen. This transaction allows system administrators to view and modify various parameters and settings that control the behavior and configuration of the SAP system. Perhaps sap basis can temporarily set the setting to true? 🤗

  • @pritirawat2616
    @pritirawat2616 ปีที่แล้ว

    This was very helpful!

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      I'm glad you liked it. And thank you for watching! 😀🤗

  • @DavidRelphWorkLife
    @DavidRelphWorkLife 5 หลายเดือนก่อน

    great thanks for the code can you read mutil codes from a range in xL say from A1 to A5 thanks

    • @CustAndCode
      @CustAndCode  5 หลายเดือนก่อน

      You mean to use it as an input for a SAP selection? 🤔

  • @satyammalhotra6503
    @satyammalhotra6503 ปีที่แล้ว

    Hi Sir, Hope you are doing good.
    Could you please help me with any formula/vba code for taking dynamic date. Means i always have to extract the data for open line items appearing in end of the month.
    Your help would be highly appreciated.
    Many thanks for the video and sharing knowledge with us😊

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      Thank you! 🤗 What is your usecase? You can pass the date in the excelfile? Then the date is a parameter for ABAP. 🤗

    • @satyammalhotra6503
      @satyammalhotra6503 ปีที่แล้ว

      @@CustAndCode Can you help me with any modifications I need to do in vba code which we copied from sap script. Yeah! If I enter the date in excel and vba code take that date and pull the report for that respective date.

  • @JesseNethononda
    @JesseNethononda ปีที่แล้ว

    awesome stuff man. How do I export SAP data/excel to the Macro enabled spreadsheet. In a way the spreadsheet becomes an app for data extraction...

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      I am not sure if this is possible, because you have to write the data in an already open excel sheet 🤔

  • @surajkumarmahto8631
    @surajkumarmahto8631 ปีที่แล้ว

    Hi thanks for this its very helpful ....just one query that i wanted to extract data in same. Excel file in which i have created button pls.. help in this

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      That could be difficult, because the file is already open... 🤔

  • @ezginagihanGokler
    @ezginagihanGokler ปีที่แล้ว

    wow tahnk you , you are a hero :D

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      Yeahh! thank you! 🤗 I always enjoy reading feedback like this very much 😀

  • @nathanmartin66
    @nathanmartin66 ปีที่แล้ว

    Tanks for the video it Washington vers helpful!! I just have à question : how do I do to work on a Excel sheet after closing the SAP part ? My code "Application.ScreenUpdating = False" doesn't work...

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      I am not sure if I understand you right? You can normly work after the SAP script stuff. What do you want to do? 🤔

    • @nathanmartin66
      @nathanmartin66 ปีที่แล้ว

      @@CustAndCode after the SAP script, some functions don't work like workbooks.close ... it was the case for application.screenupdating=false until il create a second application : dim application2 which i use in my SAP script part

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      @@nathanmartin66 Yes, workbooks.close was not working for me as well. I wanted to analyze that, but haven't the time yet. 🙄 Thanks for your feedback!

  • @YasirRaza-gc4ty
    @YasirRaza-gc4ty 10 วันที่ผ่านมา

    Hi. If I want to do dynamic dates, how can I add this in coding?

  • @dineshshelke631
    @dineshshelke631 ปีที่แล้ว

    Thanks for making this video
    I need your help where can we connect?

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      Unfortunately, I cannot provide individual support here. Write your question in the comments. Maybe I can help. 🤗

  • @chauhannaman98
    @chauhannaman98 10 หลายเดือนก่อน

    Thank you for the video sir!
    I have a query. At 02:56 when after selecting the option from Available formats, you select XLSX format. I did the same but the dialog box for Directory and Filename doesn't come up. File Explorer comes up to save the file. This moves the handle out of SAP's scope and that can't be included in the scripting. Is there any settings I need to tune in my SAP GUI app? I can share further info over the email if you need.
    Thank you!

    • @CustAndCode
      @CustAndCode  10 หลายเดือนก่อน

      Thank you! Make sure your scripting option for microsoft windows dialog is unchecked. This will prompt the SAP save as window instead of the windows file explorer. 🤗

    • @alsantour8835
      @alsantour8835 7 หลายเดือนก่อน

      @@CustAndCode I tried this and it still uses the Windows Dialogue even though it is unchecked! using 7700, i tried searching online and people have the same problem.. .any advice?

    • @CustAndCode
      @CustAndCode  7 หลายเดือนก่อน

      @@alsantour8835 you have already restarted the SAP GUI?

    • @alsantour8835
      @alsantour8835 7 หลายเดือนก่อน

      @@CustAndCode yes , I eventually got it to work! Thanks!!

    • @CustAndCode
      @CustAndCode  6 หลายเดือนก่อน

      Good to hear! 🤗

  • @مريومالعشوان
    @مريومالعشوان ปีที่แล้ว

    Thank you for your video.what if l want to write a code to close excel file after export it??? Please your support will be appreciated

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      I also wanted to test this in my example, unfortunately closing did not work. I will have a closer look. 🤗😀

  • @jaybeid490
    @jaybeid490 11 หลายเดือนก่อน

    Hi, please show how to extract commodity code from Md04 using vba in excel

    • @CustAndCode
      @CustAndCode  11 หลายเดือนก่อน

      Unfortunately I don't have access to this SAP module. But the technique is the same which I have showed in the video 🤗

    • @jaybeid490
      @jaybeid490 11 หลายเดือนก่อน

      @@CustAndCode thanks, let me try

    • @CustAndCode
      @CustAndCode  11 หลายเดือนก่อน

      @@jaybeid490 Good luck! 🤗

  • @carlaarenas6537
    @carlaarenas6537 ปีที่แล้ว

    Hi Sir do you have a video that I can follow regarding for example I need to create Info record using transaction code ME11 then I will create Macros and I will run using that. I believe I need to create some headers right?

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      mhm I am not sure if there is an advantage to do this with a script, because you have every time different input fields? What do you mean with "to create some headers" ? 🤗

  • @furkandirik2491
    @furkandirik2491 ปีที่แล้ว

    Awesome

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      Thank you very much! I'm glad! 🤗😀

  • @lukban1825
    @lukban1825 9 หลายเดือนก่อน

    Keep in mind that only the last declared variable (session) was actually declared as Object. The rest is Variant in this case (default one)

    • @CustAndCode
      @CustAndCode  9 หลายเดือนก่อน

      Thank you for your feedback! I appreciate it! 😀

  • @ahmadghozie8686
    @ahmadghozie8686 ปีที่แล้ว

    Hi Sir,
    I just try to follow your video. After I create the Macro, and Run the Macro, it didn't work. There's a notif on Microsfot Visual Basic dialog box said that " Run-Time error '619' : The Control Could not be found in id".
    please help
    thank you

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      Have you an open connection to the SAP GUI? Try its again with an open SAP GUI window. 🤗

  • @Kruse1
    @Kruse1 8 หลายเดือนก่อน

    Unfortunately the record button is greyed out for me and not authorised to use RZ11.

    • @CustAndCode
      @CustAndCode  8 หลายเดือนก่อน

      Yes, this depends on your security policy or your SAP BASIS Team. 🙄

    • @Kruse1
      @Kruse1 8 หลายเดือนก่อน

      @@CustAndCode ..however the playback button is not greyed out and it lets me load a vbs file so hopefully that means I can write the code manually and run it in Excel.

    • @CustAndCode
      @CustAndCode  8 หลายเดือนก่อน +1

      @@Kruse1 Then, have fun with scripting 🤗

    • @Kruse1
      @Kruse1 8 หลายเดือนก่อน

      @@CustAndCodewell, I did have fun programming three standard transactions by copying your code and modifying screen field names which I found by clicking on the element and pressing F1 for help which had the technical information
      ...only one sticking point though. There is a custom "z" transaction we use, I have found and used about ten screen fields but one gives 'control not found by id" error even though I found and copied it the same way as the others 🤔

    • @CustAndCode
      @CustAndCode  6 หลายเดือนก่อน

      I think I can not help you with custom things. 🤔

  • @RaMeShBaBu-gf1wc
    @RaMeShBaBu-gf1wc 10 หลายเดือนก่อน

    Hi, once open the Excel file from SAP then I want to close by using VBA code. Could you please let me know how to do because I have download more than 30 files. So each workbook need to close automatically. Please help on this

    • @CustAndCode
      @CustAndCode  10 หลายเดือนก่อน

      I have tested several suggestions from the internet but unfortunately none of them have been successful. 🙄

    • @RaMeShBaBu-gf1wc
      @RaMeShBaBu-gf1wc 10 หลายเดือนก่อน

      @@CustAndCode thanks for confirmation even I have checked 2 days not working but finally I have informed to user you have to close manually after downloaded 30 files.

    • @CustAndCode
      @CustAndCode  10 หลายเดือนก่อน

      @@RaMeShBaBu-gf1wc 🤗🤗🤗

    • @AmitKumar-cs2gx
      @AmitKumar-cs2gx 5 หลายเดือนก่อน

      May use it in combination with power automate

  • @Bitza00
    @Bitza00 ปีที่แล้ว

    Hi, getting a runtime error 614, any help please?

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      When you use the script you need an open SAP GUI connection to the system. Maybe this is the problem. 🤔

  • @kaviyarasu315
    @kaviyarasu315 2 หลายเดือนก่อน

    💌

    • @CustAndCode
      @CustAndCode  หลายเดือนก่อน

      Thank you! 🤗

  • @xikingxblack7687
    @xikingxblack7687 ปีที่แล้ว

    Thanks for this video!
    Today i made a similar macro for a transaction i need.
    But i would like to improve the macro a bit.
    I want it to check, whether SAP is already open, if not it should open SAP and log in with my username and password, if its already open, i should just start doing the steps
    Do you know how i could do this?

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      When it is possible to open the SAP GUI automatically it is necesarry to write your password plain in the macro. Thats not a good idea. But I don't know if that's even possible. If you find a solution I would be happy if you would share it. 🤗

    • @xikingxblack7687
      @xikingxblack7687 ปีที่แล้ว

      @@CustAndCode wir können auf deutsch schreiben 😄 habe erst im Nachhinein gesehen dass du ein deutscher Kanal bist
      Eine Möglichkeit gibt es bestimmt. Frage ist wie aufwändig und wie gut sie verhebt.
      Mit der Eingabe des Passwords ins Makro mache ich mir keine Gedanken, da es lokal bei mir abgelegt wäre und nur ich es für wiederkehrende Auswertungen verwenden würde

    • @CustAndCode
      @CustAndCode  9 หลายเดือนก่อน

      Man könnte natürlich auch eine Variable hinterlegen. Dann müsste man halt das Passwort jedes mal eingeben aber das muss jeder selber entscheiden ich biete nur die technische Lösung 🤗😉

  • @mohammadsuheb.l9872
    @mohammadsuheb.l9872 ปีที่แล้ว

    How to set the date from and to?

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      The same way how I set the carrid. Do it the same way like the variable carrid. 🤗

    • @mohammadsuheb.l9872
      @mohammadsuheb.l9872 ปีที่แล้ว

      In my SAP I have to regularly use the date for example from 07/24/2023 - To 07/23/2023 to pull the report. So how do I do this in vba

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      @@mohammadsuheb.l9872 would you you like to start your report from excel? and would you like to pass your date values from an excelcell? 🤔

    • @mohammadsuheb.l9872
      @mohammadsuheb.l9872 ปีที่แล้ว

      Yes, I would like start from excel the report and pass the date as well from excel cell

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      @@mohammadsuheb.l9872 Then you have to do the same like I did with the carrid. Define the variable. Read the value from the excel to the variable abd use the value in your script. Follow the steps like I did for the carrid. It is totally the same step. 🤗

  • @samuvelrajan8857
    @samuvelrajan8857 ปีที่แล้ว

    copy paste function is not working while recording scripts

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      But that works, have just tested it. 🤗

    • @samuvelrajan8857
      @samuvelrajan8857 ปีที่แล้ว

      Actually it works, but I just created a script without VB codes.
      So once we copied a data, it was stored in the script file.
      So while running second time the script is not copy new data instead it take the value from stored data which copied previously.
      I want It should copy the particular data everytime when it's running
      Kindly help me on this.
      It will be great initiative of my process

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      @@samuvelrajan8857 Ok, I understand. I don't think that this is possible with scripting. What you need ist dynamic selection, the script can only static selection. 🤔

    • @samuvelrajan8857
      @samuvelrajan8857 ปีที่แล้ว

      @@CustAndCode can I have your email id, so that I can send my script through email

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      @@samuvelrajan8857 Unfortunately, i cannot provide an indvidual suport here. I am also not an expert in SAP GUI scripting. 😐