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
@fedp6309
Жыл бұрын
Please do more videos about extracting and manipulating SAP data with Python. These are amazing. Thank you!
@dcpowered
Жыл бұрын
Please post more videos about SAP data extraction using Python!
@Moyashiisan
Жыл бұрын
This was the best video on this topic I foun on KZitem so far. Complete end to end, but also straight to the point.
@JoelTing
Жыл бұрын
Thanks for your kind word Moyashiisan!
@ΣυμεώνΠαπαδόπουλος-λ4ο
2 жыл бұрын
All your videos are great. I am so excited that you started lessons with python!
@JoelTing
2 жыл бұрын
Thank you!
@reng7777
2 жыл бұрын
This is GEEEENIUS! AMIGO!! and what i see it is easier to hanlde this automation with PY than with VBA!!! Of course you should be doing a full tutorial from scratch of PY+PANDAS+Numpy
@JoelTing
2 жыл бұрын
I agree! Using python to run the script will not cause your Excel to freeze, but running VBA will. So this means that I can work on other stuff on Excel while the script is running.
@thecurebr
Жыл бұрын
Your video was a life saver! I was struggling with errors until I found your video. Keep it up! Looking forward for your next videos on python automations.
@Cuwubiq
2 күн бұрын
actually scripting tracker tool can help with the conversion part quite easily.
@JoelTing
21 сағат бұрын
yea. Agree. If there's access to the scripting tracker, I would definitely use the tool to record in python instead of using the native recorder in SAP.
@mahiizadmousa8670
2 жыл бұрын
Fluent and efficient explained, many thanks
@leeyuehchyau7206
2 ай бұрын
Hi! It’s very useful! Is there any possible create a login for script before into this SAP excel script? Or I need to open SAP 1st
@JoelTing
2 ай бұрын
Hi there. It's possible if you are using the normal way of logging in. As of now, I'm not able to reliably automate SSO login. You can refer to the link here to learn more about logging in SAP using scripts. joelting.com/articles/sap-gui-script/login-sap-using-vba/
@paulskelton8799
Жыл бұрын
Once again excellent. Thank you so much for sharing your knowledge
@reng7777
2 жыл бұрын
I also forgot to ask you something.. what type of lincese you use for SAP demostrations? is it a personal lincese( something similar to OFFICE) or is it a company lincese? if this is an invidividual lincense can you please share that link?
@JoelTing
2 жыл бұрын
I'm using SAP ABAP Demo server. You can try and refer to this video: kzitem.info/news/bejne/rqFvyqeigF-QhYo It's quite complicated and you may face a lot of issues setting this up. Took me a few days to have the server up and running locally. That being said, functionality is quite limited. There's no Finance or any other modules in it. Only tables and some demo data.
@reng7777
2 жыл бұрын
@@JoelTing Amigo you are the BEST TEACHER I EVER HAD , if you ever happend to open a full course for SAP automations PREMIUM VERSION(PAID) with python.. i will be the first sitting in from of your class! thanks you teacher!! regards from Uruguay!
@JoelTing
2 жыл бұрын
Thanks for the very kind word Rene Ramirez! I'm just getting started with SAP automation with python. I will try and share what I have learnt along the way. Appreciate your support!
@Receivable
Жыл бұрын
Very impressive information. it was helpful for me. thx
@panic_seller
Жыл бұрын
I got a new job and they use SAP HANA, I'm yet to get started but just being proactive and trying to figure out things before I start, isn't there a better way of connecting to the backend database using SQL on SAP rather than Robotic Process Automation??
@JoelTing
11 ай бұрын
Hi there. You are right. If there's a way to connect the backend database directly, that would definitely be a better approach compare to RPA when it comes to data extraction. However, based on my previous experiences, most companies do not provide end users access to the backend database. If you are in the data team, you probably will have access, but not for the normal day to day users.
@ShraddhaTusharPhalke
Жыл бұрын
Hi, for me the saving dir prompt does not come up, instead it sap opens the file browser where i need to save file manually. How should I automate the task using same file path? thanks
@JoelTing
Жыл бұрын
Hi Shraddha, you can try using key strokes (like "Tab" and "Enter") to navigate the file browser window. Then you can put in the file path and name when you reach the "File Name" field.
@geraldineseah5276
2 жыл бұрын
Hi Joel, thanks for the tutorial I can immediately apply! Just a qn, if i have the SAP Scripting n Playback enabled, can I pass my already writen python scripts to a colleague that does not have this feature enabled? Will it work for them?
@JoelTing
2 жыл бұрын
Hey Geraldine, unfortunately, if scripting is not enabled on their system, it will not work from them.
@CalebStenz
Жыл бұрын
Hi Joel, thanks for the videos. I am having trouble connecting to multiple sessions using VBA, lets say I have multiple transactions open and want to use excel vba macros between the two of them (not simultaneously) I can only seem to attach to the first session I created. Is it possible to bounce to the different transactions that are open?
@JoelTing
Жыл бұрын
Hi there. Yes, it is possible. It is when you assign the session variable when you are executing session = connection.Children(0). If you are trying to access the second session, then it will be connection.Children(1) for example. To connect the correct session, you need to loop through the SAP session, check the Transaction that they are in using Session.info.Transaction(), then assign different variables to the different sessions (ie session1, session2 etc) that you would like to connect. Then when you are executing the findbyID, use session1.findbyID or session2.findbyID to specify which session you would like to send the instruction to.
@FKAY-zg1co
Жыл бұрын
For me it doesn't record the step of saving the table. A window opens directly with "Save as", but you cannot specify a path etc. there. Please Help.
@JoelTing
Жыл бұрын
Hi, can you try unchecking the "Show native MS Windows dialogs" option in the SAPGUI options > Accessibility & Scripting > Scripting?
@FKAY-zg1co
Жыл бұрын
@@JoelTing I tried everything. It doesn't work :( i need the file as xlsx
@JoelTing
Жыл бұрын
Another way that you can try is to use keystrokes. Look for the "Save as" window, then apply keystrokes to it. Use key to navigate to the different field and press once you have done keying in the file name. Something like the following (Please adjust based on your interface): import pyautogui import time # Find the Save as window save_as_window = pyautogui.getWindowsWithTitle("Save as")[0] # Activate the window save_as_window.activate() # Wait for the window to become active time.sleep(1) # Tab three times to get to the save directory input field pyautogui.press('tab', presses=3, interval=0.5) # Enter the save directory pyautogui.typewrite('C:\\Users\\username\\Documents\\', interval=0.1) # Hit Enter to save the file pyautogui.press('enter')
@kaseox5436
2 жыл бұрын
Very great work, it seems very easy and tomorrow i will see that is good for me because you have SAP Easy Access and i have SAP Logon 770 and i wonder that i have recording options
@JoelTing
2 жыл бұрын
Hi Kaseox, usually the recording option is there, unless it has been disable by the organization admin. In that case, then there's nothing we can do, except for getting access from the IT admin.
@kaseox5436
2 жыл бұрын
@@JoelTing Yes, i need Access from my local IT. When i get it i will see how your tutorial works for me :)
@tarekgadalla30
Жыл бұрын
Please what the defrance between fund center and cost center when we create assets no.
@JoelTing
Жыл бұрын
Hi tarekgadalla30, sorry, I'm not too familiar with cost centers and fund centers set up in SAP.
@naiduvikas202
2 жыл бұрын
Great video 🎥 from India
@JoelTing
2 жыл бұрын
Thanks! 😃
@buigiang6996
10 ай бұрын
Thanks so much for your video. I love your video so much! ❤
@JoelTing
10 ай бұрын
Thank you for your support!
@hongyeegan733
Жыл бұрын
NameError: name 'session' is not defined I have this error when I ran the Run SAP script block. The "session" in front of session.findById is not defined. Can help me with this?
@JoelTing
Жыл бұрын
Hi there, did you put in the top portion of the code where you define the SAP engine and the session? session = connection.children(0)
@hongyeegan733
Жыл бұрын
@@JoelTing thanks for reminding!
@PetersonJ
2 жыл бұрын
Excellent, thanks!!😊😊
@kaseox5436
Жыл бұрын
Ehh in my company i can't extract data from program SAP Logon. I can extract data from SAP using excel "Analysis" so i can't automate it :/
@JoelTing
Жыл бұрын
Hi Kaseox. This method only applies to those extracting data from SAP GUI. For Analysis add in, it is possible to automate the refresh and changing of variables in prompts, but there's no straight forward way to record and paste.
@santiagoandresortiz5563
Жыл бұрын
is it possible to get data from SAP without having SAP opened? Maybe in a form of an api
@JoelTing
Жыл бұрын
Hi Santiago, if there's API available to pull the data from, that would be the best way for automation as it minimizes errors and everything can run at the backend. In my company's case, the API is not available for end users, and therefore I'm not able to take advantage of the convenience of getting the data directly.
@QijiaZang
Жыл бұрын
Thank you so much for your video! I can finally automate my reports because of your awesome videos. It is literally LIFE-SAVING! Quick question, I tripped over one last step. I want to replace the existing file in the folder, but the SAP scripts that I recorded doesn't seem to have captured that. It breaks the program when there is an existing file in the folder. Could you help me with this please? A million thanks!!
@JoelTing
Жыл бұрын
Hi Qijia, glad to hear that it helps! When there's an existing file, do you need to select Replace button instead of the normal save button. What u can try doing is to have an if statement. Try to check whether the file exist, then if it exist, then click on the replace button, else click on the save button.
@QijiaZang
Жыл бұрын
@@JoelTing Thanks, Joel! You're amazinggggg
@zidinho87
2 жыл бұрын
This is a great video, I'd like to know how you connect with SAP server so that you can extract the data into excel, thanks!
@JoelTing
Жыл бұрын
Hi Roy, thanks! When you mentioned SAP server, what are you referring to? Database?
@Nachiket_upadhye_23
Жыл бұрын
Hi, I am getting com_error for session.findById("wnd[0]").maximize(). any help?
@JoelTing
Жыл бұрын
Hi. Not too sure what would result in that error. Everything else is running smoothly prior to this line?
@Nachiket_upadhye_23
Жыл бұрын
@@JoelTing Yes. Everything works fine and I am also getting a pop up window that "script is attempting to access SAP GUI"
@JoelTing
Жыл бұрын
@@Nachiket_upadhye_23 Perhaps you can try to go to your settings and untick "Notify when a script attached to SAP GUI" and "Notify when a script opens a connection" under Settings -> Accessibility & Scripting -> Scripting?
@Nachiket_upadhye_23
Жыл бұрын
@@JoelTing Can you add some more information, I dont know which setting I should use? thanks
@defaultHandle1110
Ай бұрын
How do you save to custom name and folder on g:\
@JoelTing
Ай бұрын
Hi there, you can change the folderdir variable to that path. This will work for G:\ as well.
@defaultHandle1110
Ай бұрын
@@JoelTingI think my company just saves to g:\my drive\Sap exports. Some hard coded crap. I raised a ticket. In the meantime I’m using python to rename the file and move it. Question how do you have this run at 7am daily ? Sap gui timeout seems like it might be an issue. I can schedule the script to run, but it won’t work if it’s timed out.
@JoelTing
Ай бұрын
@@defaultHandle1110 Renaming and moving it after export is a good way. There's always limitations, just need to think of a way to work around them. Regarding the timeout issue, I'm assuming you're referring to SAP logging out due to inactivity? If you're not using Single Sign-On (SSO), consider programmatically opening the SAP GUI (using sapshcut.exe) when no session is available to connect to. This might help mitigate the timeout problem.
@monishkumar8910
2 жыл бұрын
Very much thank for the info it is really helpful. I have a small doubt need your help on this. How to select a range of multiple values from excel while using this?
@JoelTing
2 жыл бұрын
Hi Monish Kumar, do you mean to select a range of multiple values from Excel to be loaded into pandas?
@arunrandy8876
2 жыл бұрын
@@JoelTing adding the KZitem link of your video. kzitem.info/news/bejne/rqOvtYd7k4eKZGk How to select a range of values from excel and run the report for only those values while the range can be read from excel ?
@arunrandy8876
2 жыл бұрын
@@JoelTing range of values from excel to pandas and pandas to sap
@JoelTing
2 жыл бұрын
Hey Arun Randy, I managed to do the copy and paste with the openpyxl and pyperclip module. The code is as follows: wb= openpyxl.load_workbook('') ws = wb['Sheet1'] clipboard = [] lastRow = ws.max_row for row in range(1,lastRow+1): str = ws.cell(row, 1).value clipboard.append(str) clipboardpaste = ' '.join(clipboard) pyperclip.copy(clipboardpaste) Once the copy method in the last line is executed, you can run your script as it is, pressing the upload from clipboard button in SAP GUI. Hope this helps!
@arunrandy8876
2 жыл бұрын
@@JoelTing awesome thank you Joel Ting very much helpful and thank you so much for your quick reply Also, you have assigned a variable to the clipboard. Clipboard = ? Or clipboard = column name? a symbol because it is jut showing as a box in the above code.
@motiaelhajji8269
Жыл бұрын
Thank you
@mohamedhanafy1962
Жыл бұрын
Great
@prakashs4301
Жыл бұрын
What is children (0)?
@JoelTing
Жыл бұрын
Hi Prakash, sorry for the late reply. Children (0) in this case, just refer to the 1st element of the object.
@muhammadnauman1454
Жыл бұрын
great
@cesar1990
2 жыл бұрын
Hi, thanks for your video, very clear!!!... I just have a question since I recorded some script to train myself. I wanted to make an action from SAP Menu that is like this: """ session.findById("wnd[0]/usr/cntlCUSTOM/shellcont/shell/shellcont/shell").PressToolbarButton "&NAVIGATION_PROFILE_TOOLBAR_EXPAND" """ How can I translate this portion to python syntax?""" "&NAVIGATION_PROFILE_TOOLBAR_EXPAND" """ Is there a way to reference from any site for this kind of transactions?
@JoelTing
2 жыл бұрын
Hey Czar Delgado, would your script work with the following? session.findById("wnd[0]/usr/cntlCUSTOM/shellcont/shell/shellcont/shell").PressToolbarButton ("&NAVIGATION_PROFILE_TOOLBAR_EXPAND")
@seriousplace7756
Жыл бұрын
Big thanks for this Video. But when I start the "Import relevant libraries" - Cell i get a com_error : 'The enumerator of the collection cannot find an element with the specified index.' The Problem ist the line: session = connection.Children(0) in Detail: com_error Traceback (most recent call last) Cell In [2], line 10 8 application = SapGuiAuto.GetScriptingEngine 9 connection = application.Children(0) ---> 10 session = connection.Children(0) 11 now = datetime.now() 13 dt_string = now.strftime("%Y%m%d %H%M") File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\win32com\client\dynamic.py:226, in CDispatch.__call__(self, *args) 223 if invkind is not None: 224 allArgs = (dispid, LCID, invkind, 1) + args 225 return self._get_good_object_( --> 226 self._oleobj_.Invoke(*allArgs), self._olerepr_.defaultDispatchName, None 227 ) 228 raise TypeError("This dispatch object does not define a default method") com_error: (-2147352567, 'Ausnahmefehler aufgetreten.', (614, 'saplogon', 'The enumerator of the collection cannot find an element with the specified index.', 'C:\\Program Files (x86)\\SAP\\FrontEnd\\SAPgui\\saplogon.HLP', 393215, 0), None) Do you know any Fix for this ?
@JoelTing
Жыл бұрын
Hi, based on my understanding, this error may be happening if a SAP session have not been open yet or scripting is disabled by the company's administrator. You can try making sure that a SAP session is open and available to be connected, otherwise, you can try and check with the IT department to understand further if scripting option is available for end users.
@thecurebr
Жыл бұрын
@@JoelTing Is there a way to automate opening the SAP logon and selecting a SID?
@JoelTing
Жыл бұрын
@@thecurebr There is actually a way to do so by using sapshcut.exe. I have a video on this where the logon is done via Power Automate, but the same concept applies for Python. kzitem.info/news/bejne/pJVtu3iVpV-rqnY&ab_channel=JoelTing A word of caution though, avoid storing your credentials as text as this is quite dangerous. Anyone with access to the script file will then be able to see your credentials unless you are using services like Azure Key Vault.
@williamli1047
Жыл бұрын
Get an com_error, did anyone run into this and know how to resolve it? com_error: (-2147352567, 'Exception occurred.', (614, 'saplogon', 'The enumerator of the collection cannot find an element with the specified index.', 'C:\\Program Files (x86)\\SAP\\FrontEnd\\SAPgui\\saplogon.HLP', 393215, 0), None)
@JoelTing
Жыл бұрын
Hi there, it seems like it may be scripting have been disabled for end users. Therefore the script is not able to read the objects for SAP GUI.
@williamli1047
Жыл бұрын
@@JoelTing Thank you! Indeed it is. BTW, Do you have experience on connecting to SAP HANA database using python? I used the hdbcli module but always getting hdbcli.dbapi.Error: (10, 'authentication failed'). Just curious if you know how to fix this.
@nyashachizampeni6596
Жыл бұрын
as a dev is a free sap l can install and play around with in order to test my integration functionality @joelting
@JoelTing
Жыл бұрын
Unfortunately, SAP servers with the different modules usually require paid access.
Пікірлер: 88