Export SAP Data to different Excel Files with SAP GUI Scripting & Excel Macro VBA [english]

Поділитися
Вставка
  • Опубліковано 17 чер 2023
  • In today's video I will show you how to combine SAP GUI Script and Excel macros with each other. Very handy for users who regularly export data from SAP to Excel. We select different data and save them in separate Excel files. The whole thing happens with a script and a loop.
    #sap #excel #vba #export
    ▬▬ Literature 📚 ▬▬▬▬▬▬▬▬▬▬▬▬▬
    ▶ ABAP: An Introduction 2020 amzn.to/45CLTqk
    ▶ Complete ABAP 2023 amzn.to/45D5UNM
    ▶ ABAP to the Future 2022 amzn.to/42cgWGs
    ▶ Clean ABAP 2022 amzn.to/3KAqmow
    ▬▬ My Hardware 💻 ▬▬▬▬▬▬▬▬▬▬▬▬▬
    ▶ Microphone: amzn.to/3zj2UIz
    ▶ Headphone: amzn.to/3GUBRFg
    ▬▬ My Software (free) 💾 ▬▬▬▬▬▬▬▬▬▬▬
    ▶ Video Recorder: bit.ly/678fgh6
    ▶ Video Editor: bit.ly/38Rj9lb
    ▶ Thumbnail: bit.ly/CustAndCodeThumbnail
    ▶ Gamma AI: bit.ly/3nsdvgr
    ▬▬ Further Links 🔗 ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    ⭐Become my subscriber: bit.ly/CustAndCodeSub
    🎬All videos in English: bit.ly/CustAndCodeENG
    ☕Buy me a Coffee 😀: bit.ly/3dih2cl
    *The links are affiliate links. There are no additional costs.
    Microsoft excel icons created by Pixel perfect - Flaticon
    www.flaticon.com/free-icons/m...
    Sap icons created by Freepik - Flaticon
    www.flaticon.com/free-icons/sap
    SAP® and SAP GUI Scripting are registered trademarks of SAP AG.

КОМЕНТАРІ • 54

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

    This is so helpful. Thank you so much

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

      Thank you for your kind feedback and your comment! 🤗😀

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

    Very helpful for every user. Thank you so much

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

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

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

    creative as usual.

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

      Thank you very much for your feedback! 😀

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

    Big help for me , thanks a lot , keep bringing more content , any possibility that output sheets could be made part of same workbook?

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

      Good Question, I will have a look at this. 🤗

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

    Thanks!

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

      Wow! Many thanks for your support! I appreciate it! 🤗😀😀🤗

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

    Thank you 🎉🎉🎉

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

    This is so helpful, saving a lot of time!!!! What do I need to do for the excel files to get closed. Using this code for over 50 files downloads.

    • @CustAndCode
      @CustAndCode  3 місяці тому

      The closing command haven't worked for me. Don't know why. 🤔 Would be great if anybody would find a solution. 🤗

  • @user-io8ug3pj7z
    @user-io8ug3pj7z 9 місяців тому

    Great content bro, very helpful. how do i export SAP data onto the Macro enable spreadsheet, and not on the new sheet?

    • @CustAndCode
      @CustAndCode  9 місяців тому +1

      The question really comes up more often. I'll have to take a look at it. 🤗🤔

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

    This tool is exceptionally handy, and I am curious if it offers the capability to generate reports for different months. Can you please provide some examples of how to modify the date and run the report via Macro setting?

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

      Thanks for your positive feedback! You can pass your variables in the excel itself. I show this in this video: ua-cam.com/video/8nvCW-l2Jdc/v-deo.html
      🤗

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

    how can I automate download attached files related to doc SAP number? I did a scripting but I coudn't connect with file path where I would like to save files in my windows

  • @jellyacecream
    @jellyacecream 6 місяців тому

    hi, can you tell me how to close the workbooks opened after the extract from SAP? I'm running a different excel file in the next step where the extracted files are referenced. thanks
    workbook.(filename).close at the end of the macro is showing a runtime error

    • @CustAndCode
      @CustAndCode  6 місяців тому

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

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

    Nice but what to do if you have no authorization to run se16? I need download fse5n reports for each cocode…

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

      Of course, the user with which this script is executed must have the necessary rights! 🤗

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

    Thank you so much! So how can I automatically close opened excel files in this way? Pls show me!

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

      It should work with "Application.quit" but it hasn't worked for me... 🤔 I am not sure what here the problem is. Maybe I try it on another mahine of mine. 🤔

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

      @@CustAndCode Thank you for replying to me. I still expect perfect results from you. If there is any way please help me. I look forward to you sharing your results with me! 😍

  • @dawidpe1624
    @dawidpe1624 3 місяці тому

    @CustAndCode could you make a video or help me what can i do in situation like in 4:31 on upper video but in my situation i want 1 report for all carryid from column A? i got over 10 carryid. big thank you for your helping.

    • @CustAndCode
      @CustAndCode  3 місяці тому

      You mean every carrid in a seperate tab?

    • @dawidpe1624
      @dawidpe1624 3 місяці тому

      @@CustAndCode thank you for your answer. iI already solved the problem. My problem was that i wanted 1 excel file, 1 table in 1 tab but which include all carryid (more than 7 was the problem for me) :)

    • @CustAndCode
      @CustAndCode  3 місяці тому +1

      @@dawidpe1624 Ok, great to hear that you have achieved it! 🤗😀

  • @MaheshKumar-dr8xk
    @MaheshKumar-dr8xk 6 місяців тому

    Bro can we create for background executed extraction

    • @CustAndCode
      @CustAndCode  6 місяців тому

      I think not, for VBA you need an active SAP GUI session. For background execution you have to use/write an ABAP report. 🤗

  • @gabrielasiqueira5272
    @gabrielasiqueira5272 10 місяців тому

    Hi,
    When some users are saving the file opens the name and path window and others opens only the explorer window so the Macro stops. How to configure to show only the name and path window before saving?

    • @CustAndCode
      @CustAndCode  10 місяців тому

      Strange, I had never noticed this before with my users. Should there be a setting for this, I unfortunately don't know it. 🙄
      I would check whether it depends on the computer or the user. To do this, user 1 should log in in SAP on the computer of user 2 and vice versa.
      I guess it is the computer If yes, check security settings, user rights, reinstall SAP GUI, check Windows Profile... hth 🤗😀

    • @SharadG84
      @SharadG84 10 місяців тому

      excel to SAP - ua-cam.com/video/4ZBGywR5DqM/v-deo.htmlsi=31yEGE4aXDAaWB7J

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

      Please check if the scripting option for Microsoft Windows is unchecked. 🤗

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

    Does someone know why i receive this error " application defined or object defined error" for line lastRow = ThisWorkbook.Sheets("Sheet1").Cells(Rows.Count, 1).End(x1Up).Row

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

      It should be xlUp, not x1Up (a lower case letter L, not the number 1). 🤗

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

      Thank you!!@@CustAndCode

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

      @@mihais83 🤗🤗🤗

  • @mrunavailable5868
    @mrunavailable5868 7 місяців тому

    So I do this for work, but I use to have that window that asks for Directory and file name, but I changed my layout and now it opens a file explorer how can i change that?

    • @CustAndCode
      @CustAndCode  7 місяців тому

      But you use the SAP GUI or? What have you changed? 🤔

    • @mrunavailable5868
      @mrunavailable5868 7 місяців тому

      @@CustAndCode I fixed it, I guess I had the open microsoft dialog box check marked, so it was opening a File exlporer save as window that VBA couldn't interact with, but now its good! thanks!

    • @CustAndCode
      @CustAndCode  7 місяців тому

      @@mrunavailable5868 Thanks for your feedback! I think this could help other people too 🤗

    • @mrunavailable5868
      @mrunavailable5868 6 місяців тому +1

      ​@@CustAndCode Awesome, well to anyone looking to find this make sure your scripting option for microsoft windows dialog is unchecked. this will prompt the SAP save as window instead of a file explorer type. this saves me a ton of time when exporting since the other option is choosing file path and name each time, when you could just have it auto save, and auto put the date on the title.

    • @CustAndCode
      @CustAndCode  5 місяців тому +1

      Thank you for your valuable feedback and thanks that you help others in the community too! 🤗

  • @nagukanuri5885
    @nagukanuri5885 3 місяці тому

    Hello sir im getting error in last row im stuck with that. can you help me on this

  • @christophwissing4877
    @christophwissing4877 10 місяців тому

    It would be possible to run the Skripts automatically to every hour each day ?

    • @CustAndCode
      @CustAndCode  10 місяців тому

      Maybe, but what is your demand? I think there are better solutions to do that, e.g. directly with ABAP. 🤗

    • @christophwissing4877
      @christophwissing4877 10 місяців тому

      @@CustAndCode
      Directly by abab ok - but the result is pdf not excel I think ?!

    • @CustAndCode
      @CustAndCode  10 місяців тому

      @@christophwissing4877 The result can be any file, but you have to code it 🤗

    • @christophwissing4877
      @christophwissing4877 10 місяців тому

      @@CustAndCode
      Ok do you have a UA-cam video how do code excel result via abab ?

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

      @@christophwissing4877 Sure, have alook at this video: ua-cam.com/video/R06MXVZbx2k/v-deo.html
      🤗