SAP GUI Scripting - Extract SAP report data to Excel

  Рет қаралды 320,679

Csongor Varga

Csongor Varga

Күн бұрын

Пікірлер: 260
@iris8807071
@iris8807071 4 жыл бұрын
This 18 minute video saved an hour of my working time. Thank you so much for your kindness in sharing a valuable skill and knowledge.
@cesarbuitrago2760
@cesarbuitrago2760 4 жыл бұрын
Hi Csongor Varga, I am very grateful to you for being very supportive of the subject and for helping me to improve the productivity of various applications that I have automated with excel. a hug from colombia and blessings.
@esnoy
@esnoy 4 жыл бұрын
MI amigo, quizás usted no entienda español y yo muy poco de Ingles, de verdad que fue de gran ayuda en este día. Saludos.
@carolatton7017
@carolatton7017 4 жыл бұрын
Anxious to start using this to download a lot of various data on a weekly and monthly basis. Thank you for your informative videos and the template!
@tahwnikcufos
@tahwnikcufos 5 жыл бұрын
So, this could be used to run multiple transactions synchronously, while putting the results in their corresponding tabs - correct?
@csongorvarga
@csongorvarga 5 жыл бұрын
Yes of course. There is no limit. Create separate recordings, turn them to separate functions in Excel and call these functions one after the other when the button is pressed on the first worksheet.
@tahwnikcufos
@tahwnikcufos 5 жыл бұрын
@@csongorvarga My recordings are done... 7 different transactions to *.XLSX then linked as external data to MS Access. I found your video, trying to overcome the "Handling a Save as dialog box" focus dilemma. I currently put the path\filname.xlsx on the clipboard, then when the DB opens, they click the title bar, paste, and click save. But they want to run them all at once and walk away - which I agree, would be ideal. With your solution, I have one XL file and one button, while retaining my links to MS Access.
@grzegorzdziewiaty7190
@grzegorzdziewiaty7190 3 жыл бұрын
Thank you for this and the first video, it helped me to create cool application.
@omarmunozcastorena4466
@omarmunozcastorena4466 3 жыл бұрын
Thank you for this great video. I´m suscribed! One question, I am running a Script to Copy & Paste data from a SAP transaction to a Excel sheet, everything runs good but when i run the Script it is not pasting the data to Excel. Do you think that is because SAP is not allowing users to import data from SAP by just Copying and pasting? or should i add some special Command in the Script notepad that allows me to "Paste" the data to Excel? Thank yoy for any help you can give me
@csongorvarga
@csongorvarga 3 жыл бұрын
I did a trick and tips video where I show some examples you can copy paste. You should be able to copy data from SAP to Excel like objSheet.Cells(x,y).Value = objSess.findById("...").Text. Of course the Text property may change based on what SAP control that is. And if you reverse the expression you can write a cell value into SAP. No need to use the clipboard for that.
@omarmunozcastorena4466
@omarmunozcastorena4466 3 жыл бұрын
@@csongorvarga Thank you so much! i will look for your other video and give a try, i already made a script where i can export data from Excel to SAP, and worked perfectly, that´s why it was so weird to me that i couldn´t do the same but in reverse using the same logic :)
@omarmunozcastorena4466
@omarmunozcastorena4466 3 жыл бұрын
these are the commands i added to the recorded script (note pad), i want to paste the SAP text in Column 2 from the Excel file, maybe i am declaring the cells incorrect: Dim objExcel Dim objSheet, intRow, i Set objExcel = GetObject(,"Excel.Application") Set objSheet = objExcel.ActiveWorkbook.ActiveSheet For i = 2 to objSheet.UsedRange.Rows.Count cOL1 = Trim(CStr(objSheet.Cells(i, 1).Value))
@astrys
@astrys 2 жыл бұрын
Thanks for the series and the effort, though what is "DCG210"? How can I find this value for my specific system?
@work-mn8lu
@work-mn8lu 2 жыл бұрын
I have exactly this problem, he didnt explain what is DCG210
@astrys
@astrys 2 жыл бұрын
@@work-mn8lu I found the answer! If you look carefully at the SAP window in the video at 0:01 you will see a small grey triangle to the left of DCG(1) 210 So in my SAP system everything to the right of this triangle was collapsed and the triangle was to the right bottom of the window. Click on it and everything should appear as it is in the video.
@zmac5964
@zmac5964 4 жыл бұрын
Hi Csonger, Love the Videos! I have a quick question. Im looking to get tables/reports for five different tables out of SAP using this process. What would you recommend to accomplish this efficiently - Add more sheets and paste the code in each sheet and modify the gui recording and folder paths? Thx
@eechaze12
@eechaze12 3 жыл бұрын
You make this so easy to follow. Thanks
@ba_golf
@ba_golf 2 жыл бұрын
Hi, thank you for the video. How do I then format the extracted data as a table? Can this also be included in the script? Many thanks.
@robertdevadason1885
@robertdevadason1885 6 жыл бұрын
Very useful video...gonna try this...will help me save time on downloading data and preparing reports on a weekly basis. thanks man
@samueljunioryimga7914
@samueljunioryimga7914 Жыл бұрын
Hello thanks for the video. love it . But what happens when you have many variant and you need to select one in particular?
@editvarga1650
@editvarga1650 2 жыл бұрын
Hello Csongor, lehetseges riportot kesziteni SAP GUI requsition and teljesitett order and sent vegosszegekrol honapokra lebontva?
@csongorvarga
@csongorvarga 2 жыл бұрын
Valahogy biztos, de en nem vagyok FIs
@Toxice404
@Toxice404 2 жыл бұрын
You mentioned that you used to use it to extract multiple reports at once, i would like to do a similar thing and extract multiple reports (different data points) from the same sap transactions, how did you make it loop and chose to run it for multiple reports ? thanks in advance.
@julianmendoza3310
@julianmendoza3310 6 жыл бұрын
Thank you Csongor. i was able to adjust you process to extract project actual costs CJI3
@csongorvarga
@csongorvarga 6 жыл бұрын
Good job! Thanks for letting me know.
@whitedeerbella8202
@whitedeerbella8202 6 жыл бұрын
Hello Julian, could you please share your code?
@perfekt4u
@perfekt4u 5 жыл бұрын
@Julian Can you please share how you did that? It will be really helpful
@neeleshagarwal7906
@neeleshagarwal7906 6 жыл бұрын
worked wonderful. Thank you so much for your time and great attitude of sharing the knowledge. :)
@Giggio36
@Giggio36 3 жыл бұрын
Hi! Thank you for this tutorial! Quick question: I'm importing a column that contains both numbers and text infos from SAP. The text cells are not being recognized as text, it fails when I try to use the data in a Excel function. I've been trying to find a solution for a long time now.. Do you guys have some tips to fix it? Thank you
@csongorvarga
@csongorvarga 3 жыл бұрын
I am not sure I understand. I assume this is an Excel issue, right?
@Giggio36
@Giggio36 3 жыл бұрын
@@csongorvarga Yes! But I've been trying to fix it by VBA code, without success.. anyway, thank you so much for the video and for the reply!
@sebastianvaazquez4181
@sebastianvaazquez4181 2 жыл бұрын
Hello Csongor! Again thank you for your videos, hope you can read me and help me with a doubt, im trying to print PDF an invoice but as it opens adobe the Script stop workings, any idea of how can i solve this?
@csongorvarga
@csongorvarga 2 жыл бұрын
Scripting stops whenever SAP is launching any screen which is not SAP, like Windows Open, Save, Print dialogs. I never found a way to program these screens. But I think it should be possible to get the handle of the PDF window and send key commands to it (like print, save, etc.). If you google "VBA catch window handle", or "VBA send key to window" or similar phrases you will find examples. But I never spent enough time to properly research this.
@sebastianvaazquez4181
@sebastianvaazquez4181 2 жыл бұрын
@@csongorvarga thanks for your response, i will look for it, thanks again!
@romanakondrlova8220
@romanakondrlova8220 4 жыл бұрын
Thank you very much for this video and material! VERY HELPFUL! Good job! Keep up the great work! :)
@notengo7558
@notengo7558 5 жыл бұрын
Hello, I need to extract data from a long tex field where session.findbyID does not report any text or value. How can I do that? Please help.
@AnimateYa
@AnimateYa 5 жыл бұрын
I can't use the connection, I then declare next variables: dim connection, and dim application. When only paste all code of scripts, my application run perfect. But have advertised on the excel: error "esperando que otra aplicación complete una acción ole" en excel 2016. You have solution.
@joem112
@joem112 4 жыл бұрын
Thank-you for the video. Very helpful, I like the %pc tip. I noticed some times you remove SAP recorded code such as ".caretPosition = 3" and sometimes you do not. You seem to always remove the "setfocus" code. Can you explain?
@csongorvarga
@csongorvarga 4 жыл бұрын
Thanks. Actually no particular reason. Setfocus just moves the focus to a control, in most cases that does not do anything. You can change a value of a field without setting it to the active control, so there is no added benefit. And for me it makes the code more compact and easier to understand.
@JazminDeJesus-v4h
@JazminDeJesus-v4h Жыл бұрын
Is it possibble to recur the session.findByID.sendVKey 0 while the unknown repetition of pop up message is gone and proceed with the next session? If yes. Can you share how?
@csongorvarga
@csongorvarga Жыл бұрын
This is a good question. I am not sure. I noticed that all pop-up windows have wnd[1] in the key, while the main window is always wnd[0]. So maybe checking the active screen element and checking if the key includes wnd[1] will tell if there is a pop-up on the screen.
@riccardocaruso785
@riccardocaruso785 4 жыл бұрын
Cool video! Thank you. But do you know how I can find the "sid and client to connect to ": ' Set the sid and client to connect to W_System = "DCG210"??
@divided_eye
@divided_eye 4 жыл бұрын
The SID is just the name of the system you're connecting to. The top left of your SAP window should have this information. Alternatively, the system name should also be near the bottom right, close to the script icon (assuming you haven't used the drop-down to choose something else--if so, just click on the drop-down to see the info). For example, one of mine says: E6P(2)/100. The (2) just means that's the second SAP window from that system that I've opened. You can ignore that and the forward slash.
@riccardocaruso785
@riccardocaruso785 4 жыл бұрын
Thank you! The macro works well 😊
@KVAN670
@KVAN670 6 жыл бұрын
Hi Csongor, how can I call / execute a SAP BW Transaction for example "Listcube" with a Excel Macro?
@babyrabit2
@babyrabit2 6 жыл бұрын
Hi Csongor. Thank you for your well-explained video. I have a question. Why don't we extract the report to Excel directly using the spreadsheet instead of text? Is it easier that we do not have to convert from csv?
@csongorvarga
@csongorvarga 6 жыл бұрын
Thanks, I am glad you liked the video. Whenever I was using the spreadsheet output in the past I got it in a format that I could not directly load to Excel without doing some manual conversion. Maybe Excel or SAP GUI itself got better in time, but I am just sticking to old habits I guess.
@babyrabit2
@babyrabit2 6 жыл бұрын
Oh I see. Thank you for your reply :)
@Aaronetic
@Aaronetic 6 жыл бұрын
Hello Csongor, how would you change the script to filter for specific different Object _D's? If you wanted the script to run specific Object Id's from a list in Excel?
@csongorvarga
@csongorvarga 6 жыл бұрын
In most of my other videos I show how you can pass data from Excel to SAP and even back. So you create a recording in which you run SE16, you specify the object IDs. Record the steps as you paste in the list of Object IDs from the clipboard. In Excel, you can use a VBA code like: Range("A1:A10").Select. This will put the entries between A1 and A10 into the clipboard that you can paste into Excel.
@alejandrasaenz4397
@alejandrasaenz4397 3 жыл бұрын
Thanks, great video and explanation!!
@eugeniopazrodriguez8911
@eugeniopazrodriguez8911 2 жыл бұрын
Hi, I cannot get the final file (XLS file coming por SAP) I don't know why, at the end of the run, I have to write the name and the path to download the file. I want to go across the record and export automatically. Someone can help me please?
@hislombres5224
@hislombres5224 5 жыл бұрын
@csongor Varga , why in the saving file or when the save file diaglog appears the script is cut. do we have solution on that? in using SAP 7.20 inside client CITRIX
@csongorvarga
@csongorvarga 5 жыл бұрын
File save dialog is a Windows dialog, and cannot be scripted. There is no way around it. In the 7.40 GUI there is an option in the settings to use SAP dialogs only.
@MT-zy7oe
@MT-zy7oe 2 жыл бұрын
Hi Csonger, what if my report varies month to month, and when I use the t code, i always have to update the posting period to show the curren month. Is there any way to recoed this update of the posting period in the macro?
@csongorvarga
@csongorvarga 2 жыл бұрын
You can calculate the current month in Excel and set the value before you execute the report. But I think there is even dynamic date rule for current month.
@valerkowtf
@valerkowtf Жыл бұрын
Hi everyone! I know that you cannot download SAP data straight to the ".xlsx" format because of the windows window that SAP GUI does not detect. But, does anyone have any trick to do that? I mean, maybe you can run a macro in excel that does this part of the script?? I have tried some different stuff, and still with 0 positive results...
@hopethedream
@hopethedream 6 жыл бұрын
Hi Csongor, while saving the file through Local file option, unable to open excel sheet. it says file is corrupted. I am using SAP 7.4.
@hopethedream
@hopethedream 6 жыл бұрын
Please hepl me how to resolve this issue.
@AnkulBaranwal
@AnkulBaranwal 3 жыл бұрын
Hi, Can you tell me how to extract the log for the opening and closing of the accounting period? What is the T.code for extraction of a log from SAP? Thanks!
@Rajeshrai_vfx
@Rajeshrai_vfx 5 жыл бұрын
Dear Csongor Varga your videos are very helpful. Thanks for helping the newbies in GUI. I have minor issue. Showing error in "objSess.EndTransaction" when we have not logged in the SAP. I would like to put msgbox instead of error pop up. Please help.
@sofiachernylo581
@sofiachernylo581 7 жыл бұрын
Hi Csongor, what do I need to do to run a t-code for reports several times and posting tables from that same t-cde in excel either one under the other or at least in separate tabs?
@csongorvarga
@csongorvarga 7 жыл бұрын
You can call a macro over and over, that is not a big issue. Switching tabs in Excel can also be done programatically. That is not an issue at all. Just need to write some code for it which is probably a bit more than what I can explain here.
@hanaejabri9735
@hanaejabri9735 6 жыл бұрын
Thank you again and again for this great video.. i come back to you sir to ask you if there is a possibility to start a script and continue the same script in another window. I mean, when i will start my script, i want to open a new window in sap and continue my transactions in this window ( and the script is always recording my steps..) Thank you so much sir.
@boriss1976
@boriss1976 5 жыл бұрын
Thanks for sharing these tutorials. Helped me a lot. I faced one problem. When extracting the data from SAP from large tables I get a msg "waiting for another application to complete an OLE action" and SAP stops to execute unless I click OK. I have googled and found a solution how to turnoff this option in the Excel, but when I turn it off then I cannot open macro files. Have you faced this problem?
@csongorvarga
@csongorvarga 5 жыл бұрын
Sorry, I have never experienced this. I did a quick google and found this Stackoverflow page: stackoverflow.com/questions/22379815/microsoft-excel-is-waiting-for-another-application-to-complete-an-ole-action. There are few recommendations there. Give them a try.
@j.sawyer4946
@j.sawyer4946 5 жыл бұрын
This is going to make my Mondays far simpler. How can I use this to pull the last work week of data? I normally have to put in a start and finish date.
@csongorvarga
@csongorvarga 5 жыл бұрын
You have to code it in VBA. From the current day you can always calculate Monday of last week. If you are running the report on Mondays, last Monday is actually Now-7, and last Friday is Now-3.
@robertjohnson2750
@robertjohnson2750 6 жыл бұрын
Awesome video!!!! One question, what reference(s) should I make available for this to work?
@csongorvarga
@csongorvarga 6 жыл бұрын
You only need the "SAP GUI Scripting API" which is sapfewse.ocx.
@robertjohnson2750
@robertjohnson2750 6 жыл бұрын
Thank you. I watched your first video and found it :)
@FamilyBiryani
@FamilyBiryani 3 жыл бұрын
I have 1lakh records to download..its taking almost one hour time..Can you please give me an idea to download quickly.
@amythzrythere1690
@amythzrythere1690 2 жыл бұрын
Hello, i need little help to pull the data of current date
@javiergalvez938
@javiergalvez938 3 жыл бұрын
This is amazing, but is it possible to do it when you use export?? When you export to spreedsheet appears a Windows "Save As" and here I don't know how to change the path and file name...😥
@csongorvarga
@csongorvarga 3 жыл бұрын
No you cannoy script that. It is a Windows dialog and sap will not script that.
@dadagholap2140
@dadagholap2140 6 жыл бұрын
Superp !!! very thanks Csongor
@vandanabapunentertainment4798
@vandanabapunentertainment4798 4 жыл бұрын
Fantastic video
@neilhart9102
@neilhart9102 4 жыл бұрын
extracting data from SAP (via Winshuttle) is there an option to extract data into a .CSV comma delimited Excel file? (not a .txt file) is it updating the script or is there a simple drop down type menu that allows you to select how you want your data extracted? I need a client using SAP and Winshuttle to provide me with client/interaction data in .CSV comma delimited format so we can assist them in integration to our software and system
@csongorvarga
@csongorvarga 4 жыл бұрын
The only option is what you can get out of SAP. I did not use CSV before.
@kareszka1984
@kareszka1984 5 жыл бұрын
Szia Csongor Lehet par kerdesem ezzel a makroval kapcsolatban?
@csongorvarga
@csongorvarga 5 жыл бұрын
Szia, persze segitek amiben tudok.
@kareszka1984
@kareszka1984 5 жыл бұрын
Koszonom :) Lehetseges ezt a makrot ugy atirni, hogy gombnyomasra lefuttasson a sap-ban egy folyamatot, aminek a vegen az adatokat kimenti egy mar letezo excel file-ba? LX01 funkciot hasznalom, amivel a raktarban levo ures poziciokat tudom "elohuzni". Esetleg tudunk a tovabbiakban e-mail formalyaban komunikalni?
@csongorvarga
@csongorvarga 5 жыл бұрын
@@kareszka1984 Igen lehet. Mind a két irányban van kommunkáció. Ez a GUI scripting egy olyan megoldás amihez Visual Basic programozási ismeretkre van szükség. Ha ez nincs meg akkor nem tudom ajánlani. Az email címem kereszt név pont vezeték név kukac gmail pont com.
@kareszka1984
@kareszka1984 5 жыл бұрын
Irtam mailt. Azota probalgattam es a legnagyobb fennakadas ott van, mikor ranyomok az "extract data" gombra kiirja a "No active session to system DCG210, or scripting is not enabled" pedig fut a SAP...viszont fura, h 1x vegigcsinalta a folyamatot ugy, h kidobta ezt a hibat...
@izabelaranocha541
@izabelaranocha541 6 жыл бұрын
Your videos are of a great help! I just couldn't find the answer on how to select the dates range of the SAP report from Excel's cell. They are firmed in the script, while I would like them to be different every day, without changing them in the code. Does one of your videos explain the solution to that?
@csongorvarga
@csongorvarga 6 жыл бұрын
Yes, probably this is the only video in which I use variants. In most of my other video I show now to record changing values in SAP and pass those values from Excel.
@edracarvalho
@edracarvalho 4 жыл бұрын
This is amazing!
@241pedro
@241pedro Жыл бұрын
Ayuda, necesito copiar una columna de datos que esta en sap y pegarlo en excel
@hemanthmaharana
@hemanthmaharana 7 жыл бұрын
Hi Csongor Thank you for the video! I have one quick doubt 1) while you exporting data from SAP, you are using "%PC" Tcode is this SAP standard Tcode ?. while I'm using in my system it's not working 2) How to record "SAP GUI Security popup" window "Allow" button while exporting VBAK table information it's asking. Kindly do this needful support to better understand :) Thanks, Hemanth M.
@csongorvarga
@csongorvarga 7 жыл бұрын
%PC is a command which does the same as export to local file, which is usually available in the menu in an SE16 like transaction. So it is a standard GUI shortcut. I don't have SAP Logon installed on my laptop right now, but you can do two things with the security popup: 1) Tick Remember my decision and it will not be asked again for the same folder. 2) You can go into the SAP Logon settings, and in the Security group you can set if certain folders should be allowed or denies for export.
@hemanthmaharana
@hemanthmaharana 7 жыл бұрын
Thanks your best answer to solve my issue.
@paragchaudhari5860
@paragchaudhari5860 5 жыл бұрын
Hi, Wanted to know, is there any way where we can extract the specific row or column in the SAP GUI window. Like in st06: how to extract only CPU idle % or memory% to excel.
@csongorvarga
@csongorvarga 5 жыл бұрын
I do talk about gridviews in my tips and tricks video. So you can access each column and row of the gridview. So it should be possible.
@yamilastepien7895
@yamilastepien7895 4 жыл бұрын
I’m trying to download transaction MCBZ. For this particular transaction I can only export it as spreadsheet and not .txt. How can I save it once downloaded in excel? How can I connect both spreadsheets? (The one with the script and the one recently downloded) thanks!!
@josephquinones3846
@josephquinones3846 7 жыл бұрын
Hi Csongor Varga, I am trying to record tcode zv401 however, the scripting is not recording the exporting the data. could you please help me with it? Also, all the message pop-up in recorded. Thank you in advance.
@csongorvarga
@csongorvarga 7 жыл бұрын
Yes, all the message pop-ups will be recorded. You can't so nothing about that. What do you mean not recording the exporting of data? Is your transaction using a Save as dialog window? That will never be recorded.
@dejibodunwa7357
@dejibodunwa7357 4 жыл бұрын
Hi, I'm wondering if this will work for a table with 1.1m entries which exceeds the excel limit. If not , is there a workaround?
@csongorvarga
@csongorvarga 4 жыл бұрын
Yes the new excel limit is 1,048,576 lines. Maybe you can split the table by setting up a selection criteria, export in two pieces and import them into separate sheets. I don't have a better solution right now. Unless you import it to somewhere else than Excel. Maybe Access.
@AshishPandey-yz7vd
@AshishPandey-yz7vd 4 жыл бұрын
I am facing an issue with on of my report. I am running a report which export data to an excel sheet. The number of data i was expection was around more than 26,000. But i am getting close to 25,000 data in excel sheet. So i want to know is there any limitation for number of data for excel sheet? Could you please help me out here because its urgent.
@csongorvarga
@csongorvarga 4 жыл бұрын
I am not aware of anything like that. Did you set the max number of records in se16 correcly?
@AshishPandey-yz7vd
@AshishPandey-yz7vd 4 жыл бұрын
Can you please just tell me how to check if i have missed it in the video? How to check that?
@hariskhaliq2800
@hariskhaliq2800 6 жыл бұрын
Hi, I am new to SAP and scripting. I was a little confused of what happened in this video. I am attempting to write a script that takes thousands of product cost reports and store them into a folder, all every report is individually saved as an excel sheet. Would a program such as this help me with that?
@csongorvarga
@csongorvarga 6 жыл бұрын
Yes, you can pretty much do anything with scripting and VBA code. But you probably need to do your own coding in Excel.
@krishnagupta228
@krishnagupta228 5 жыл бұрын
Thank you so much Csongor
@neeleshagarwal7906
@neeleshagarwal7906 6 жыл бұрын
can we run multiple t-codes in the same file by adding new worksheet to after extract?
@hislombres5224
@hislombres5224 5 жыл бұрын
do you resolve this ? i have same question . thanks
@RaduNordenhulk
@RaduNordenhulk 8 жыл бұрын
Great, thank you for sharing!!!!
@giorgiomariani6805
@giorgiomariani6805 3 жыл бұрын
Very good indeed
@sunilkumarsalunke1703
@sunilkumarsalunke1703 4 жыл бұрын
Hi Sir, i need an help for Attach Session when i'm using the attach session function it is not reading the code while running the script your guidance will help me a lot. Thank you
@ahmedmo8918
@ahmedmo8918 3 жыл бұрын
Me too
@spuente09
@spuente09 7 жыл бұрын
I'm getting a compile error "user defined not defined". objGui As GuiApplication is highlighted in the script. I use SAP GUI "EGP 301" so not sure if that's what causing it? however, I did change name from DCG210 to EGP 301" but not change.
@csongorvarga
@csongorvarga 7 жыл бұрын
Did you check that under Tools / Preferences you have the SAP GUI Scripting added? Also, don't put spaces between the SID and client, set it as "EGP301".
@spuente09
@spuente09 7 жыл бұрын
yes, I just checked the SAP GUI scripting options under tools/preferences but it still didn't fix it and I also already had "EGP301" without spaces. The error is happening in below line for some reason. Public objGui As GuiApplication
@krasnoshchok
@krasnoshchok 6 жыл бұрын
is it possible to copy text from popup windows in R/3 into the cell of an Excel? recording of script in r/3 does not save the movement highlighting the text and copying
@csongorvarga
@csongorvarga 6 жыл бұрын
Yes you can. The recording will save as you press the ok button on the pop-up window. You can use the debugger and go to the parent object and explore all the elements in the popup.
@krasnoshchok
@krasnoshchok 6 жыл бұрын
Csongor Varga it works! thanks a lot!
@sebastianarias255
@sebastianarias255 6 жыл бұрын
Thank you for your video... it's so helpful! ..do you know if there is a way in which I can export the data in Excel format, copy it and then paste it in my Excel (the one that has the code)?
@amandafernandesramospasson5862
@amandafernandesramospasson5862 4 жыл бұрын
great!!! thank you very much.
@carlosdelacruz9910
@carlosdelacruz9910 6 жыл бұрын
Thank you so much for this video. Keep up the great work !
@ahmed_elalfy
@ahmed_elalfy 6 жыл бұрын
Hi Csongor That's brilliant. For some reason i am failing to have excel connected to SAP still. it gives an error on the line If objGui Is Nothing Then Set SapGuiAuto = GetObject("SAPGUI") ----------->Highlighted in Yellow Do you think i am putting the system wrongly? At the bottom right it says PE3 (1) 400 and the client is 400. so I have put PE3400 but still giving me this error. I have also checked and I have added the GUI Scripting in Excel as you instructed. And my SAP GUI Scripting is installed and enabled as well. I am struggling here to be honest and would love your help. thank you
@csongorvarga
@csongorvarga 6 жыл бұрын
I am confused. PE3400 is the correct setting. If you are getting an error in that line my first guess would have been that you did not add the GUI Scripting in the references, but you did. What does the error message says?
@chezni140486
@chezni140486 6 жыл бұрын
@@csongorvarga I am also trying to automate the session log on so I can schedule the guiscripts & extraction. Have you managed to automate the log on element?
@imranhyder8026
@imranhyder8026 5 жыл бұрын
Excellent video, I have a question? If we want to change date on monthly basis, how can we chance it in macro? So if wante to pull a report and creat macro for it, next month I want to change date. How can I do this? Please reply asap
@csongorvarga
@csongorvarga 5 жыл бұрын
You can use a variant, or pass it from Excel and just use and Excel function to calculate the date from the current system date.
@imranhyder8026
@imranhyder8026 5 жыл бұрын
@@csongorvarga thanks for quick response, do you have any video on this so that I can see, please
@imranhyder8026
@imranhyder8026 5 жыл бұрын
How to pass date from excel to SAP? Any video please forward me?
@carolinewidjaja5564
@carolinewidjaja5564 7 жыл бұрын
Thanks for sharing. Just a quick question, I get an error message when I try to download the spreadsheet. It says "Invalid GUI input data: FOCUS DATA (Message no. 00123)". Any idea? Thanks.
@csongorvarga
@csongorvarga 7 жыл бұрын
You mean this error comes when the script is running, right? What is happening in the GUI when you get this message?
@carolinewidjaja5564
@carolinewidjaja5564 7 жыл бұрын
Csongor Varga The error comes at the end of the script. It ran the report but it failed when it tried to save the report to xls file.
@csongorvarga
@csongorvarga 7 жыл бұрын
I am sorry, but I cannot help like this. I would need to know which line the script is failing and also see what is happening in the GUI.
@carolinewidjaja5564
@carolinewidjaja5564 7 жыл бұрын
Csongor Varga ok. that's fine. I'll try again next time. thanks. Great video. I learned so much. thank you so much :)
@mariuszdekier1
@mariuszdekier1 6 жыл бұрын
Its awesome. But i have problem with a special signs at Polish language. Where I can change coding to UTF-8?
@csongorvarga
@csongorvarga 6 жыл бұрын
I have an Encoding field on the SAP pop-up where you specify the path and filename. I have to admit I have never used it before.
@Mralexdrivesthru
@Mralexdrivesthru 5 жыл бұрын
I had the same Problem: You have to Change the .TextFilePlatform Code: .TextFilePlatform = 850 Dos-File Format 65001 UTF8 File Format will be in the right format 1252 Windows(Ansi)-Files will be shown in the right format. It works for the German ÄÜÖ etc. Hope you still need it!
@Radklifus
@Radklifus 8 жыл бұрын
Problems starts when you have different table layout (ie grid list instead of standard se16 list) , different set of fields selection criteria in sap, too low number max number of hits, etc. Two choices then: enforce user to have a specific setup or add respective code into macro (which for me is not appropriate, to change user settings) I heard about RFC method which can bypass these potential complications, but I haven't had yet 100 hours to explore it.
@csongorvarga
@csongorvarga 8 жыл бұрын
There are some more advanced tools you can pay for that can do some of the coding for you. I have stumbled upon a few myself as well. This on the other hand is free, but requires you to get your hands dirty in the process.
@joaocarloslira1367
@joaocarloslira1367 7 жыл бұрын
Awesome video, it helped me a lot to understand how to export data. Do you know which function I can use to export to .xlsx spreadsheet instead of .txt?
@csongorvarga
@csongorvarga 7 жыл бұрын
I don't think there is an .xlsx option. There is a spreadsheet option, but that is not xlsx either.
@raphaelveiga4648
@raphaelveiga4648 7 жыл бұрын
Hello Varga,Great video. It would help a lot.I did try run your code using SAP code FB03 and appear the error message after run the "StartExtract()" - "No Active session to system DCG210, or scripting is not anable" How could I check if DCG210 is the correct one for my SAP?
@csongorvarga
@csongorvarga 7 жыл бұрын
You should know in which SAP system you want to run the script. When you log into SAP you select a system and a client. It you click on the status bar where you see the transaction code or user, you will see the SID and client as well.
@raphaelveiga4648
@raphaelveiga4648 7 жыл бұрын
yes, I found here. it's working very well. thank you very much
@janinepereira4760
@janinepereira4760 6 жыл бұрын
Hi, do I need to report non-generated accounts? You can do it through a direct transaction? please.
@lengyellevente5263
@lengyellevente5263 6 жыл бұрын
Hi Csongor. Could you please upload a video while you export a report and saved as an excel.file.and not text? I can' manage to adapt your file to my gl balance export.
@luhr5kar
@luhr5kar 8 жыл бұрын
Hi all, I hope you can help me. whe run the script and in the moment is assigned the "session" Excell shows a message "The enumerator of the collection cannot find en element with the specified index" and I review in the "watches" and the connection variable don't have sessions and I have open session un SAP. do you have any idea todo fix it? thank you
@csongorvarga
@csongorvarga 8 жыл бұрын
I think it will be very difficult to help. So you click on the button to start the script. Does Excel connect to SAP. Does the GUI window comes on top of the screen? Does it start the script at all?
@luhr5kar
@luhr5kar 8 жыл бұрын
I am running your script and it shows "no active session to system" un this case for me is "ACD" I activated the scripting in SAP Options on Customize Local Layout And the next message "Not connected to Client" But client is working.
@csongorvarga
@csongorvarga 8 жыл бұрын
Rogelio Lugo Did you update the SID and client in the code? Open the VB editor and right at the end of Module1 there is a variable called W_System. Change that to whatever SID and client you use.
@oodaikiran
@oodaikiran 6 жыл бұрын
Thank you so much for the video. I am using Excel 2016 and I am unable to run the macro I have "Missing: SAP GUI Scripting API" in the excel References. is there any other way that we can exclude and run the code
@csongorvarga
@csongorvarga 6 жыл бұрын
Add the missing reference. sapfewse.ocx.
@benjamintoth1216
@benjamintoth1216 5 жыл бұрын
Awesome! Thanks for sharing!
@janewong8808
@janewong8808 3 жыл бұрын
Hi Csongor How do i skip the exporting to excel if there is no data generated?
@csongorvarga
@csongorvarga 3 жыл бұрын
The code loops through the entries in the view, so if there is nothing, nothing will get exported.
@janewong8808
@janewong8808 3 жыл бұрын
Thanks for the reply. Indeed nothing will be exported but it gives me error in my excel macro. Is there any coding to skip the export coding if no data is generated?
@csongorvarga
@csongorvarga 3 жыл бұрын
@@janewong8808 If you put a line "On Error Resume Next" before the error happens, Excel will just ignore the error and move on.
@kamakshinat6788
@kamakshinat6788 5 жыл бұрын
Hi I am trying to pull the data from SAP FBL5 to excel and format it. Can you provide me the coding as it is not matching with this coding
@csongorvarga
@csongorvarga 5 жыл бұрын
This is a tutorial how to make your own, not a request forum.
@dioniciocarrillo7562
@dioniciocarrillo7562 8 жыл бұрын
Great Video. I have a question, where do i find the reference SAP GUI Scripting API??
@csongorvarga
@csongorvarga 8 жыл бұрын
In the Visual Basic for Applications under Tools / References menu.
@dioniciocarrillo7562
@dioniciocarrillo7562 8 жыл бұрын
Thanks, by the way, I dont have SAP on my computer, so the Reference doent appear, I guess that only in a computer where has SAP I could find it, am i Correct?
@csongorvarga
@csongorvarga 8 жыл бұрын
Yes, that is correct.
@edsoncavalcante5792
@edsoncavalcante5792 7 жыл бұрын
Does this DCG210 code depend on the version of SAP we work with or on any version?
@csongorvarga
@csongorvarga 7 жыл бұрын
I used GUI scripting on GUI versions 7.20 to 7.40. DCG210 is just the sid and client id of the system I was using at that time.
@Aaronetic
@Aaronetic 6 жыл бұрын
Hello Csongor, when stepping into your code, should SAP graphic show as running when you W_Ret = Attach_Session under the RunGuiScript sub routine or at W_System = "SIDClient" in the StartExtract sub routine? My SAP GUI code works fine, but i don't believe my connection works as it should. It connects at Set W_Sess = W_conn.Children(it + 0) under Attach_Session sub routine and i error out after the 1st line .maximize on My recorded GUI code. GUI codes works independently, but I "myerr" in excel.
@Aaronetic
@Aaronetic 6 жыл бұрын
It's weird, because i have to stop "Reset" my in excel to stop the SAP GUI from running, but yet no session attached. hmmm
@vantomlol
@vantomlol 6 жыл бұрын
any idea how to make date range a dynamic? example from = today to =31.12.2018?
@csongorvarga
@csongorvarga 6 жыл бұрын
You can set dynamic dates in variants as well. It should not be a problem. Otherwise you can record setting the dates in the script and add the date from Excel dynamically.
@saturntutorial
@saturntutorial 4 жыл бұрын
Nice video
@mohammadsuheb.l9872
@mohammadsuheb.l9872 Жыл бұрын
How to set date from - to in excel and what's the code i have to add ?
@csongorvarga
@csongorvarga Жыл бұрын
What do you mean by date from - to?
@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
@rajkumargerard5474
@rajkumargerard5474 6 жыл бұрын
Hello Csongor, thanks for the video, I have one query, i'm trying to extract the data in MHT format but while recording the script this doesn't gets captured, could you help me on this??? this way I'm trying to download the extract (List>>Export>>Spreadsheet [Shift+F4]). The reason I'm extracting in MHT format is the amount and data comes in proper format but in others its jumbled. please help!
@csongorvarga
@csongorvarga 6 жыл бұрын
MTH format? Where is this? Just make sure to click on the field or option, even if it is already selected in the recording.
@rajkumargerard5474
@rajkumargerard5474 6 жыл бұрын
Csongor, I'm using the tcode: S_ALR_87011964 to get the company codes details, instead of download the file through Local File method, I'm using Spreadsheet method, where i get the HTML format extract. When recording this only the downloading part is not getting captured in the script. Is there a way to solve this ? or I need to use only local file method for extracting the file.
@csongorvarga
@csongorvarga 6 жыл бұрын
I am sorry, I could not make this transaction to work in the systems I have access to. I don't know how it looks like and why it is not recording the steps correctly.
@rajkumargerard5474
@rajkumargerard5474 6 жыл бұрын
Csongor, I somehow made it to work with a different format... Thank you so much for all your videos which helped me a lot... Please share me your personal mail ID so that if any helped required I can write you a mail...
@rajeshkumbar8117
@rajeshkumbar8117 3 жыл бұрын
Hi If I change sap password wha will be the effect should I need to change the code again?
@csongorvarga
@csongorvarga 3 жыл бұрын
The script works on a session you already logged into. So it will have no impact.
@manuelsilvestri3159
@manuelsilvestri3159 4 жыл бұрын
Thank you for your video! I’m trying to use the macro but I get the error “no active session to system PRD900, or scripting is not enabled”. Well, scripting is enabled and I found the SID in the login window..so, the only mistake could be the client..where can I find it?
@riccardocaruso785
@riccardocaruso785 4 жыл бұрын
I have the same error :(
@manuelsilvestri3159
@manuelsilvestri3159 4 жыл бұрын
Riccardo Caruso I cannot fix it! I tried every number I found in the GUI for the client but the macro does not find the active session. If you’ll find the solution please share with me! I’ll do the same!
@riccardocaruso785
@riccardocaruso785 4 жыл бұрын
@@manuelsilvestri3159 I did it! bar at the bottom right in Sap screen. Following the tutorial you will see DCG (1) 210 DCG = sid 210 = client
@manuelsilvestri3159
@manuelsilvestri3159 4 жыл бұрын
Riccardo Caruso good! Now I have to understand how show it in my interface! My bottom bar is empty!
@vinivini8858
@vinivini8858 8 жыл бұрын
How ti connect P01 or any other system connect to excel. I can see LH1100 is already updated in your excel file(example)
@csongorvarga
@csongorvarga 8 жыл бұрын
It is in the VB code in Module1, and towards at the bottom of the code, where it says W_System = "DCG210". Replace that with your SID + client.
@sohailmohamad5244
@sohailmohamad5244 4 жыл бұрын
Hi It is not working for SAP logon 760
@pratafwd
@pratafwd 8 жыл бұрын
very interesting video. I could successfully generate the code and run the script. Im running it from an Access file. Unfortunately what I couldn't do is to replace the part of the code where the inputs for SAP transaction are (dates, for instance) with a Variable that can take info from a particular field from an access table. My idea is to put fields in a form where I can complete the dates and when I run the macro, it downloads de SAP information for that dates (what it actually should do is to paste that date in an table and the code should be able to take the information from there). Do you know how to do this?
@csongorvarga
@csongorvarga 8 жыл бұрын
I am sorry I did not get this. What are you trying to do? Your issues is with the formatting of a date?
@pratafwd
@pratafwd 8 жыл бұрын
What I mean is that I recorded a macro, suppose a very simple one --> logging into SAP, entering a transaction and putting a date, then exporting it to excel and I put that code in an access. I created a form where I put a button that run that macro. Everything fine. The problem is that the date is fixed in the code. I want to replace that date for a variable (suppose "Date1") and defining that variable to take the date stored in a field of a table from the access (So I Can complete it before running the macro)
@csongorvarga
@csongorvarga 8 жыл бұрын
I have done the same in almost all of my videos. Even in this one I have a global variable for the file name and I am adding it to the script. You can do the same, and use the Format function to make sure your date is formatted in a way SAP expects it.
@divided_eye
@divided_eye 4 жыл бұрын
I've watched several of your videos, and they are incredibly helpful--thank you for your time and effort! I have a couple questions. I noticed that by exporting reports from SAP as "unconverted," any cells that contain text include trailing spaces when imported into Excel. Is there a way to exclude these during import, or to import from MHTML or xls instead of text? My normal (manual) exports include both formats, and neither includes trailing spaces when copied over. I wrote a script to apply the Trim function to all cells, but that's very slow when you're working with large datasets. The only solution I've found to this is to run Text to Columns with "Fixed Width," but the code isn't very dynamic that way. Second, is there a way to pull reports from multiple SAP applications (SIDs)? I have the code working for a handful of reports in E6P, but I also run a few reports in other systems that I would like to pull at the same time. So far I haven't figured out how to adapt this code for that purpose.
@csongorvarga
@csongorvarga 4 жыл бұрын
Hi, thanks a lot for the kind words. For the first issue, I don't have a solution either. I also use trim function. And I know it is very slow. You can speed it up, if you disable automatic calculation with Application.Calculation = xlManual and turn it back on what you finished with Application.Calculation = xlAutomatic. And you can also use Application.ScreenUpdating = False and Application.ScreenUpdating = True. That will help some. For the second question, you can updated the W_System variable that I used in most of my examples, and just call Attach_Session again, so Excel switches to another system/session. Never done it myself, but I don't see a reason why it would not work.
@divided_eye
@divided_eye 4 жыл бұрын
Appreciate the quick reply! I'll have a go at your second suggestion and reply back if successful. I think I tried pausing screen updating and such as you mentioned for the trim function, but can't recall. I think with hundreds of thousands of rows to go through it'll still be a bit slow. But if I have time, I will test that as well just to confirm.
@divided_eye
@divided_eye 4 жыл бұрын
Just wanted to confirm: setting W_System to a different SID and client worked without issue. Has anyone experienced an issue running this script on a different machine? For some reason, on certain computers, I get a run-time error: "-2147221020 (800401e4) Automation error Invalid syntax" But on other machines it runs just fine. I've been searching for solutions online but have yet to find anything substantial. If I figure it out I'll be sure to comment back. I suspect it may have to do with SAP scripting permissions, but I don't have access to RZ10/RZ11 to verify all the settings (though scripting is installed and enabled in options, the SAP scripting API is enabled in Office, and the document is in a trusted location).
@divided_eye
@divided_eye 4 жыл бұрын
To anyone stuck with the "automation error / invalid syntax" error I mentioned above: I believe this has to do with the version of SAP that is installed. I was getting the error on some machines but not on my primary, and it turned out that the ones getting the error had an earlier version installed. I had our IT department install the same version on the machines that were getting the error, and the problem went away. I'm not sure what version fixed the issue, but the one that works for me is: File Version: 7400.3.19.3373 Build: 1846739 Patch Level: 19
@divided_eye
@divided_eye 2 жыл бұрын
I know this is late, but if anyone encounters the issue I mentioned above: apparently there's a registry fix that can be applied to allow scripting to work again on newer versions. Unfortunately I don't know exactly what that is, but this is what I was told and have had success running the latest version of the SAP GUI.
@mostafaebid6256
@mostafaebid6256 4 жыл бұрын
Hi Csongor, many thanks for your tutorial, How can I know client name ? minutes 7:30
@csongorvarga
@csongorvarga 4 жыл бұрын
When you are logged in the SAP GUI, check the status bar of the gui, where it shows your user, or the transaction. If you click there you can see the system and client as well.
@DGTransformer
@DGTransformer Жыл бұрын
%pc doesn't work with me is there an alternative ?
@csongorvarga
@csongorvarga Жыл бұрын
There is save to local file or similar in the menu as well.
@fabiolalmeida3164
@fabiolalmeida3164 5 жыл бұрын
Para extrair de outra transação vl06o o que teria que mudar?
@georgeenea6332
@georgeenea6332 5 жыл бұрын
cannot make this thing work.. sorry, have no clue about VB scripts..
@madhur0612
@madhur0612 4 жыл бұрын
Hii I want to load the excel file into Sap system is there any way we can automate this process
@csongorvarga
@csongorvarga 4 жыл бұрын
I do have another video on downloading and uploading attachments to SAP. That could be useful for you.
@nikonalli3182
@nikonalli3182 8 жыл бұрын
Thank you for the video! I am almost done with the code but I am getting error from the last rows: Sub StartExtract() ' Set the sid and client to connect to W_System = "DCG210"
@csongorvarga
@csongorvarga 8 жыл бұрын
I am pretty sure your system is DCG210. So you need to update that. The SID and the client ID is on the lower right of the GUI. Scripting should also be enabled in your SAP system.
@nikonalli3182
@nikonalli3182 8 жыл бұрын
It works! Thank you so much.
@hanaejabri9735
@hanaejabri9735 6 жыл бұрын
Hello Niko Nalli Please can i ask you a question. did you run your code with the W_System = "DCG210" or you changed the W_System?? because i have the same problem you already had.Thank you.
@BeerusHoldings
@BeerusHoldings 5 жыл бұрын
Encounter the same issue
SAP GUI Scripting 1 - Running scripts from Excel
47:34
Csongor Varga
Рет қаралды 445 М.
Automate Data Extraction with SAP GUI Scripting & Excel Macro VBA [english]
14:20
Fake watermelon by Secret Vlog
00:16
Secret Vlog
Рет қаралды 26 МЛН
小蚂蚁会选到什么呢!#火影忍者 #佐助 #家庭
00:47
火影忍者一家
Рет қаралды 120 МЛН
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 269 #shorts
00:26
SAP GUI Scripting - Extract Data from SAP GUI Transaction to Excel
20:33
GUI Scripting - Extract Large Tables
41:54
Csongor Varga
Рет қаралды 19 М.
SAP & Excel - 10 SAP GUI Scripting Tips 🚀
27:37
ERP UP
Рет қаралды 3,1 М.
SAP GUI Scripting - Office Reporting
34:39
Csongor Varga
Рет қаралды 21 М.
Import Web Data to Excel using VBA Macros
20:29
TeachExcel
Рет қаралды 176 М.
SAP GUI Scripting - Order Creation from Excel
20:49
Csongor Varga
Рет қаралды 49 М.
Fake watermelon by Secret Vlog
00:16
Secret Vlog
Рет қаралды 26 МЛН