SAP GUI Scripting - Extract Data from SAP GUI Transaction to Excel

Поделиться
HTML-код
  • Опубликовано: 23 янв 2025

Комментарии • 60

  • @noravaladez5918
    @noravaladez5918 6 лет назад +10

    Sir, you saved my team form an extense night of copying and pastying alot of information.

  • @juniormartins4509
    @juniormartins4509 4 года назад +1

    Hey Mr. Varga! Thanks in advance! You are incredible. You explains everything quite good, really easy to understand. U have just saved a lot of time!

  • @mamedova.5513
    @mamedova.5513 4 года назад

    Thanks a lot. you helped us to optimize our work pretty much... live long...

  • @rolandmartingumapac
    @rolandmartingumapac 6 месяцев назад

    Hi im new to VBA, i always encounter complie error in Public Sub RunScript (Currentline) i cannot troubleshoot it

    • @csongorvarga
      @csongorvarga  6 месяцев назад

      Hi, what is the error message?

  • @marceloestrada1934
    @marceloestrada1934 Год назад

    sorry when "On error" mine stops and doesn't continue to the next line. What could it be?

    • @csongorvarga
      @csongorvarga  Год назад

      Did you use "On error resume next". Otherwise it will stop.

  • @noobster9212
    @noobster9212 6 лет назад +1

    Hi there good sir, for mass extraction I recommend to clear the memory at the end of VBA coding in the RunGUIScript function

  • @hemanthmaharana
    @hemanthmaharana 7 лет назад

    Can any possible using VBA macro to place any online orders.

  • @viktorsvitek8274
    @viktorsvitek8274 2 года назад +1

    Great video, great code. Thank you.

  • @dasarigayatri9278
    @dasarigayatri9278 4 года назад

    Hello Sir, i am able to run the script but i am not able to extract the fields as they are non editable fields in sap.I will be grateful if you could guide me on how to extract particular fields from SAP to excel

    • @csongorvarga
      @csongorvarga  4 года назад

      That does not matter. Each field have a Caption or Text property which holds the current value even if it is read only. I have a tips & tricks video where I explain how you can find your fields in the watch list and see which property holds the value.

  • @rodrigogoni6743
    @rodrigogoni6743 Год назад +1

    Hello,
    Thank you for sharing all of this with everyone. Quick consult. Do you know how to close all downloaded files automatically?

    • @csongorvarga
      @csongorvarga  Год назад

      What do you mean close downloaded file? Why would it be open?

  • @gowthamt7955
    @gowthamt7955 7 лет назад

    I tried but it extracts the first line only and showing error "Run-time error 91. Object variable or with block variable not set"

    • @gowthamt7955
      @gowthamt7955 7 лет назад

      Pls help me to solve this.

    • @csongorvarga
      @csongorvarga  7 лет назад

      Did you check that in the VBA editor / Options / Preferences, the SAP GUI Scripting API is added (checked) in the list of references?

  • @diegodebalcarce
    @diegodebalcarce 7 лет назад

    In case you need to extract a Status? not a field, the status, if is green, yellow or gree, it is posible? thanks!

    • @csongorvarga
      @csongorvarga  7 лет назад +1

      Uh, that is a tough question. I did a very quick test. I created a simple recording using FB50 where there is a status light. It is possible to click on that and it comes to focus, therefore the script has recorded that: session.findById("wnd[0]/usr/txtRF05A-AMPEL").setFocus. You can put this into your Excel, put a breakpoint here, and add session.findById("wnd[0]/usr/txtRF05A-AMPEL") to the watch. You should see all the properties this object has and see which one has a value which represents the green/amber/red state.

  • @Jigor969
    @Jigor969 5 лет назад +2

    Thanks for the useful information ! I've noticed that even though it is faster than a person, SAPGUI scripts run kinda slow, probably due to long response times. Would you happen to know if SAP offers some other way of automating a task ? Like an API or something similar that doesn't rely on the GUI.

    • @csongorvarga
      @csongorvarga  5 лет назад

      I am pretty sure that there are many different ways to connect to SAP. I only used GUI scripting and LSMW which is almost the same thing. I think if you need performance or volume you could use RFC or BAPIs (either standard or bespoke). That way you interact with SAP directly and not via a UI layer.

  • @leonhart48
    @leonhart48 8 лет назад +1

    Thank you very helpful and very well detailed I like your videos

    • @csongorvarga
      @csongorvarga  8 лет назад

      +Leonardo Alcantara I am glad you like it. It appears these GUI scripting with Excel seem to interest a few people. I will try to come up with a few more scenarios and package them as separate videos.

    • @emolinamrtz
      @emolinamrtz 8 лет назад

      Do you know how to create a PO using as reference a Purchasing requisition?

  • @ericsanchez8692
    @ericsanchez8692 6 лет назад

    a question, how do you do it so that you see on the screen the excel, while working the macro? please

    • @amandafernandesramospasson5862
      @amandafernandesramospasson5862 5 лет назад

      you can just reduce the size of the VBA window. another tip is that you can run the code line by line by pressing "F8", so you can see the code step by step on SAP or excel. it's easier to fix some errors

  • @hanaejabri9735
    @hanaejabri9735 6 лет назад

    Hello sir,
    I hope you are doing well. In fact, I'm in a graduation internship and I'm totally stuck in an extraction method. I have an excel sheet that contains a set of components. My goal is to extract for each component the data found with transaction md04 using excel vba. It really takes a lot of time when i use the script that allows me to extract informations for every components. Do you have an idea about another method that can help me to reduce the time of the extract data ?
    Thank you very much.

  • @tpdakc7904
    @tpdakc7904 4 года назад +1

    You can make videos automatically import data from excel to SAP NetWeaver Portal

  • @amandafernandesramospasson5862
    @amandafernandesramospasson5862 5 лет назад +2

    great!! thank you so much

  • @CentroCoronelAprende
    @CentroCoronelAprende 4 года назад

    how to get "W_System" ??

    • @csongorvarga
      @csongorvarga  4 года назад +1

      That is the SID for your system and the client. You find it in the status bar of your GUI when you are logged in.

    • @sakthivelcslm
      @sakthivelcslm 2 года назад

      @@csongorvarga Sir, not able to find this..c

  • @Medialna_Sova
    @Medialna_Sova 8 лет назад

    Hi Csongor, I have a problem, excel is not pasting data from sap. Quick watch found the text all ok but it is not pasting it into excel. Any idea? Thank you
    sht.Cells(i, 2) = session.findById("wnd[1]/usr/ctxtRIPW0-MATNR").Text

    • @csongorvarga
      @csongorvarga  8 лет назад

      Hmm, can you try sht.Cells(i,2).Value = ...? Does your session.findById() function return the value you are after?

    • @sander1128
      @sander1128 7 лет назад

      I have exactly the same problem. When i run the script with a breakpoint and add this breakpoint to the "add watch" list it does not recognize the type as a SAP field. Therefore the result is that I cannot extend the field and choose another value that I would like to extract.

  • @didi3d
    @didi3d 8 лет назад

    +Csongor Varga thx for share this video, but the script always show this error "No active session to system XXX or scripting is not enabled." how i get the SAP Active Session ?

    • @csongorvarga
      @csongorvarga  8 лет назад +1

      Do you have scripting enabled? Please watch my first video in this playlist, it has these details explained.

  • @steverandall5977
    @steverandall5977 7 лет назад +1

    Loving these videos. This is helping me automate a whole lot of stuff that used to be very painful. 1 thing i am stuck with. i need to look at table T439C passing in a 'Scope of Planning (PUWNR), and then the last Counter (PUCNT) and then add 1 to this value so i can then use the new number to input a new record. Any ideas appreciated?

    • @csongorvarga
      @csongorvarga  7 лет назад

      Maybe you can create a script in SE16 with the output turned to ALV grid. Filter in PUWNR execute the query, sort descending on PUNCT and get the top value. It should not be complicated with an ALV grid.

    • @steverandall5977
      @steverandall5977 7 лет назад +1

      worked it out. im extracting from sap to txt and then importing csv into another tab, then using "=LOOKUP(2,1/(planningScope!E:E""),planningScope!E:E)+1" to find the last value and then adding one. Probably long winded but seems to work

  • @pmorales0702
    @pmorales0702 5 лет назад

    Hello man, great videos, could you please put a link to the first video you mention ?

    • @csongorvarga
      @csongorvarga  5 лет назад

      There is a link to the SAP GUI playlist in the video description.

    • @pmorales0702
      @pmorales0702 5 лет назад

      @@csongorvarga thanks man!

  • @hanaejabri9735
    @hanaejabri9735 7 лет назад

    Hello,First i wanna thank you for this great video. I had a problem with the connection part. i'm connected with the user session so i had always the same msg: "No active session to system XXX or scripting is not enabled" is that related to the fact that i'm connected with the user session??

    • @csongorvarga
      @csongorvarga  7 лет назад

      The scripting functionality may not be enabled in your system. Watch the first video in the playlist or the trick and tips video, I talk about it there.

    • @hanaejabri9735
      @hanaejabri9735 7 лет назад

      I think that the script works because when i pressed extract i had the msg that shows that SAP GUI is connected.. but the macro stoped in the interface of SAP.. wich mean that the code is not able to enter to the session even that my session was already opened :( . In the W_SYSTEM i entered the ID of my system. Is that correct? Thank you so much.. i'm really confused..

    • @csongorvarga
      @csongorvarga  7 лет назад

      Well, you should have done everything as you said. You enter your SID and client in VBA here: W_System = "DCG210" (replace DCG210). That should work. If I could see your screen I would probably know more.

    • @hanaejabri9735
      @hanaejabri9735 7 лет назад

      On monday morning i will send to you the screen of SAP interface ( wich shows the SID) and my code ( because i can't open my session now) . i'm really so grateful to you sir, i'm stocked here from tuesday and i need to complete my project as soon as possible. Thank you so much.

    • @hanaejabri9735
      @hanaejabri9735 7 лет назад

      Hello sir,I sent to you ( you adress mail: csongor.varga@gmail.com) my code. I solved the problem of W_System but know i have another problem :( . My problem is that when i run the macro, i have the msg : error 91 object non défini.. i don't know where is exactly the problem .

  • @rennymon1
    @rennymon1 8 лет назад

    Hi Varga, while I opened your template in excel I can see as missing Sap gui scripting API
    How can I enable this, if you don't mind can you please share your mail id

    • @csongorvarga
      @csongorvarga  8 лет назад

      It is sapfewse.ocx, it should be under program files, sap, frontend, sapgui folder. Just use the Browse button to add it manually.

  • @ruhhangaikwad6572
    @ruhhangaikwad6572 7 лет назад

    Hi Csongor, Thanks for such excellent video on data extraction directly from excel. Can we download expense gl data from code fs10n on similar lines ? If yes then please share video on that as well. Thanks.

    • @csongorvarga
      @csongorvarga  7 лет назад

      I am not doing videos on request. These videos show you how you can build a script for yourself.