SAP GUI Scripting - Order Creation from Excel
Vložit
- čas přidán 9. 09. 2024
- This video provides and example of creating and order in VA01 from data stored in Excel. This is only a simple process to get the most important field of order populated, you most certainly need to enhance it to your needs.
GUI scripting allows external applications like MS Excel to connect to an existing GUI session and execute operations within the GUI. Excel does not hold and authorization and access information as it relies on you logging into SAP first.
Download the Excel file in this example from here:
drive.google.c...
Playlist of my SAP GUI scripting CZcams playlist: • SAP GUI Scripting 1 - ...
All my GUI scripting files on Github (in case you cannot access the above link):
github.com/nyg...
Hi Csongor, I just replicate the process and created VBA to release work orders in CO40 and CO01.. Thank you. And thanks to other comments to help me figure out the system value.
Nice work. I am glad this helped.
This is a fantastic resource! Thank you so much for sharing. I only wish I'd found this video before this weekend, I just finished writing my own version of this
I want to update SAP data from excel file for tcode MSC2N where I want to update the data for certain material/batches.
I created file to Update MSC2N, but this is for one defined value only and not from excel
Can you please to create excel which can pick data and update MSC2N like Date of Manufacturing, shelf life, vendor batch, country of origin
well done. easy to interprete and learn from. Thank You
Useful as always, I made few nice scripts in workplace thanks to your movies, many thanks ;)
I am glad you were able to re-use this concept.
Hi I need help Urgently and I would really appreciate it I'm having issues with scrolling through the table to add new items while creating orders and adding items through va02 is there a way to fix this
for further clarification I have 7 available tabs or blanks to insert the material code and quantity after they are done I can not scroll down to continue adding the other items and as a result I get an
error I would appreciate your help
This is superb
Hi Csongor,
I have adapted your code to my need for transaction VA01, however, I can't figure out how to go beyond 17 product lines.
When I get to the seventeenth, it just goes to the top and comes back up, like a keyboard "page down".
How could I modify the code for this need? I would have to enter orders of even 500 rows.
Thank you very much because your code has been very helpful
Hello Csongor,where to I find the name of the system to connect to? ("DEG210" in your case)I keep getting the error message "No active session to system XXX".Many thanks in advance!
Bottom bar, right corner, there will be 3 to 4 values, click DOWNWARD facing arrow, pick :SYSTEM value : for me it was "IRP (1) 320 ", so i took "IRP320"
@@KAMINAHARAMILOL123 Thanks. Your answer helped me to figure out my system value.
I m trying to record IW32 in load runner but when I am adding a material and replaying the script then it is showing an error " fail to read the data from table parameter data " can anyone help me out in this
Hi sir.....I'm trying to create the script but I'm receiving an error no 13 typo miss pls help on this
How to set date from - to in excel and what's the code i have to add ?
Thank you for sharing ,very usefull
Hello Cna you also advise if we cna create multiple order by this, like put all sold and ship to and running the script ones and SAP wil create all orders ? like in bulk
Yes, you would need to put the entire logic into a big loop and use something in Excel for the code to know when the line items stop and next line if for a new order.
Hi cosongor, i need your assistance, because I am facing error, and I need your help
@@user-wl9ir4pc6f what is your issue?
how to overcome if there are pop up window, which needs our action to click OK or YESmultiple times. this is not recorded in through recorder.
You need to record it at least once so you know the code for pressing OK or Yes. And you can reuse the same line multiple times in the code. You can add line 'On Error Resume Next' which will not make the code to fail if a line fails (for example if there is no pop-up) and will just continue with the next line.
Hello Csongor thank you for your great video! im new making this combination of scripting and VBA and i have some doubs hope you can help me with this. 1 i put my system value but it still says : "No active session to system QAT9200, or scriptiong is not enabled". The i click "ok" and it says O bject variable or with blocj variable not set ( i have my SAP GUI Scripting API enabled and the recording scripting on)
2. the script that you uploas on your drive thoes it only works with two line items?
THANK YOU VERY VERY MUCH FOR YOUR ATTENTION AND YOUR INCREDIBLE VIDEOS
Hi Sebastian I think that Id is incorrect the sid is usually 3 letters and client is 3 digits. So it is most probably QAT920 or similar. But it is still possie that scripting is not enabled at all in the client.
@@csongorvarga ooooh thank you very very much its now working. Again Thank you for your videos and taking the time to answer me
Hello Sir again me, the script is giving an error when its the turn to add de items, do you know what can be happen?
@@sebastianvaazquez4181 Where is the error coming from? What do you see on the SAP screen? Maybe your SAP has some custom logic that shows and error message, or expects some more data to be added which the script is not designed to handle.
Hi Csongor, What if I want to add a product ID in the same T-code where some of the had already written. Basically I want to count the number of rows which has product Id in Sap already and to add this new ID from Excel to the last row....
Put a breakpoint in your code and check the item list view. It has properties like the max lines and you can dynamically add the new product to maxlines+1
Can u teach on ima11 tcode... I got some error over there... I don't have basic in scripting but I still learning
Please help. When i try to record steps then after stop recording when i open saved script file it only shows only first step after thst it doesnt record any steps.. Please me why
This is SAP GUI scripting. The Open, Save, Print dialogs are Windows dialog boxes, those will never be scripted. There is a "Show Native Microsoft WIndows Dialogs" in SAP GUI Options under Scripting. Uncheck that. If that does not help, I am out of ideas.
thank you
We actually encounter the credit limit error on a regular basis. We would then need to get credit limit approval from senior management, who then approve the sales order using the sales order # and then we would be able to proceed to the next step. The "On Error Resume Next" will work in this case, but we would then require a notification in the excel script stating "Credit Approval Required" so that staff know to request the approval.
I assume you recorded the step when you press on the OK button on the credit limit pop-up message (or something similar). Or a similar message. What you can is add a statement: "If Not session.FindbyID(".......") Nothing Then " and so on. This checks if the OK button is not nothing (e.g. the OK button is visible) on the screen. And in that case you can add your message tot the Excel line.
please .how to know btn [?] in sap gui? Please guide the people to help me
Hi Csongor
Do you know how to do the same for multiple lines in a single Purchase order, i mean create a PO with multiple lines
I have not used the PO transaction, but it should follow the same logic
Hello, I am working for a client where we access through Citrix, that means we are accessing a different system. Now if I have this excel with vb script in my system it won't work in Citrix SAp right ?
No, it will not work. Unless your Citrix connects to a complete virtual machine. When you are accessing separate apps via Citrix, it will not work.
Got it. Thanks Sir !
How we will connect to cutrix
Hi, I have managed to get the code to work for my application on multiple line uploads. Thanks this is a great start and help.
We have to additional steps on the material code upload, which is availability check and pricing upload per line item. I have two options that I'm currently trying, 1. single line selection and then price input, after each line. 2. Complete all line uploads, select ALL and input pricing then. In both scenario's I'm hitting a wall that I'm unable to navigate. Can you possbly assist with this part? This also has another problem in the cell text format that inputs the value with comma and not dot (SAP does take comma and I cannot change the format in the cell), not sure how to navigate this issue as well. Any assistance would be greatly appreciated.
For the dot/comma problem you can use the Replace function. In the place where you assign the text to the SAP field, try Replace(yourvalue, ",", "."). That will replace the commas with dots and enter it that into SAP.
Hi, thank you for replying. I will look at your comma/dot idea.
Can you possibly assist with the other issues I have also picked up the loop runs well until line 13 and then it stops working. In the SAP window after line 13 is entered the window scrolls up so that line 13 is at the top and the next 12 empty lines are available at the bottom, not sure if this could be the cause.
I will pay you for your time, as I'm really a beginner in coding. I'm also not sure how to navigate the message prompts with various parameters that are variables not constants. @@csongorvarga
@@alteavanloggerenberg2464 I got it working. I created a script that created an order with 20 line items. The trick is that main table control has a VerticalScrollbar.Position propery. I updated that with the line item number and it scrolls the table so the new line is always on the first line. And in the rest of the code you can enter the line item details (product, quantity, price, etc. on the first line.
Check this file: github.com/nygma2004/km/blob/main/VA01%20scrolling.xlsm
Please note that the ID for the table control is different from the field within the table control which is captures by script recording when you enter the data.
Great Job @Csongor Varga.. Didn't thought that it's possible. Tried to do it and it works fine for some orders. On others i have issues with the credit limit popup and availability control screen. Do you know how I could solve them? How can I check if the credit limit popup showes up and if the availability control window opens... Thanks a lot
Probably the easiest option is that you record a script where there is a credit limit popup message. So pressing on the OK button in the pop-up is also recorded. In the code where the GUI script starts you add a line which says "On error resume next". This will simply ignore all errors in the VBA code. So if the pop-up is shown your line which acknowledges the pop-up will be executed, in other cases it will be just ignored and the execution continues. Of course this will happen for any other errors as well. Alternatively you can check if the object for the pop-up OK button exists with an if statement like "if objsess.FindbyID("xxxxxx") is nothing than objsess.FIndbyID("xxxx").Press end if" so something similar. I just wrote it from memory did not check what the correct syntax is.
Need to talk to you as i do create sales order in VA 01 and then change it again in VA 02 , i want make a script which will work on VA02 pls help me with solution thanks in advance
This whole video (and others in this playlist) is about making such Excel files. You record your steps in script recording and import the code to Excel.
Csongor Varga thanks but i did what you said may be i am wrong somewhere, need to create the same.. When we can have a talk on call or skype pls let me know.. Thanks
Csongor, awesome stuff mate ....!Greg
Thanks Greg!
Hi Csongor, Am using the recorded GUI scripting and trying to paste the status bar string back to my excel. But whenever the script reaches the comand to where it has to paste the status bar msg into the excel sheet...my SAP is showing an error message as unable to write on read only file. What could be the reason and how can I overcome it....
Your earliest reply will be appriciated.
Uh, I have never seen that before. What is the exact error message? It is possible that the cells are write protected?
Thank you so much for reverting,
Well am not a GUI Scrpting expert..but trying to learn slowly....
I wanted to extend my part location with TCode - MM02..
I had aroud 57 parts which need to be extended....so instead of doing one by one I recorded the script...and used to for doing my required task for these 57 parts. My script is able to read the parts from excel ...but unable to write on it...... And showing message as ..."unable to write on read only"......is this because am using recorded script..and my script is opening the excel file in backgroud.
Is there a way to overcome this error. 🙁🙁
@@kpk9311 What is the line where you are getting the errors? Something like xxx.Cells(a,b).Value = objSess.FindById("wnd[0]/sbar").Text?
@@csongorvarga
On the below line
Session.FindById("wnd[0]/sbar/").text = MsgText
ObjSheet.Cells(i,2) = MsgText.
@@kpk9311 oh yes, in the first statement you are trying to write to the status bar. It should be the other way around:
MsgText = Session.FindById("wnd[0]/sbar/").text
ObjSheet.Cells(i,2).Value = MsgText.
Or simply do it in one line:
ObjSheet.Cells(i,2).Value = Session.FindById("wnd[0]/sbar/").text
And also the text goes into the .Value property of the Cells object. So that was missing as well.
I Csongor, I tried creating order exactly same, the loop worked perfectly fine for 1st line but it is throwing error on second iterations, Pls help
I can't help, I don't see your screen I don't have access to the system. You need to put a breakpoint in the code in Excel and debug through the steps to see what is going wrong. Maybe there is a pop-up screen or anything which stops the script from accessing the fields again.
Here is the piece of code, I tried debugging it by f8, it completes 1st iterations perfectly on second iterations it through error starting from first line item, Pls help thanks in advance
Public Sub RunGUIScript()
Dim W_Ret As Boolean
Dim PO As String
Dim i As Integer
Dim j As Integer
Dim k As Integer
' Connect to SAP
W_Ret = Attach_Session
If Not W_Ret Then
Exit Sub
End If
On Error GoTo myerr
i = 0
j = 1
k = 6
session.FindById("wnd[0]").maximize
session.FindById("wnd[0]/tbar[0]/okcd").Text = "ME21N"
session.FindById("wnd[0]").sendVKey 0
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB0:SAPLMEGUI:0030/subSUB1:SAPLMEGUI:1105/ctxtMEPO_TOPLINE-SUPERFIELD").Text = "112280"
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB0:SAPLMEGUI:0030/subSUB1:SAPLMEGUI:1105/ctxtMEPO_TOPLINE-SUPERFIELD").SetFocus
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB0:SAPLMEGUI:0030/subSUB1:SAPLMEGUI:1105/ctxtMEPO_TOPLINE-SUPERFIELD").caretPosition = 6
session.FindById("wnd[0]").sendVKey 0
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB1:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1102/tabsHEADER_DETAIL/tabpTABHDT1/ssubTABSTRIPCONTROL2SUB:SAPLMEGUI:1226/ctxtMEPO1226-ZTERM").Text = "ZSO4"
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB1:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1102/tabsHEADER_DETAIL/tabpTABHDT1/ssubTABSTRIPCONTROL2SUB:SAPLMEGUI:1226/ctxtMEPO1226-ZTERM").SetFocus
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB1:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1102/tabsHEADER_DETAIL/tabpTABHDT1/ssubTABSTRIPCONTROL2SUB:SAPLMEGUI:1226/ctxtMEPO1226-ZTERM").caretPosition = 4
session.FindById("wnd[0]").sendVKey 0
While Cells(k + i, 1).Value ""
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211/ctxtMEPO1211-EMATN[4," & i & "]").Text = Cells(k, 1).Value
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211/ctxtMEPO1211-EMATN[4," & i & "]").SetFocus
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211/ctxtMEPO1211-EMATN[4," & i & "]").caretPosition = 0
session.FindById("wnd[0]").sendVKey 0
session.FindById("wnd[0]").sendVKey 0
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0010/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211/txtMEPO1211-MENGE[6," & i & "]").Text = Cells(k, 2).Value
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0010/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211/ctxtMEPO1211-EEIND[9," & i & "]").Text = Cells(k, 3).Value
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0010/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211/ctxtMEPO1211-EEIND[9," & i & "]").SetFocus
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0010/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211/ctxtMEPO1211-EEIND[9," & i & "]").caretPosition = 10
session.FindById("wnd[0]").sendVKey 0
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0010/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211/ctxtMEPO1211-NAME1[15," & i & "]").Text = Cells(k, 4).Value
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0010/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211/ctxtMEPO1211-NAME1[15," & i & "]").SetFocus
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0010/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211/ctxtMEPO1211-NAME1[15," & i & "]").caretPosition = 4
session.FindById("wnd[0]").sendVKey 0
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0010/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211/txtMEPO1211-NETPR[10," & i & "]").Text = Cells(k, 6).Value
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0010/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB1:SAPLMEGUI:6000/cmbDYN_6000-LIST").SetFocus
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0010/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB2:SAPLMEGUI:1303/tabsITEM_DETAIL/tabpTABIDT6").Select
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0019/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB2:SAPLMEGUI:1303/tabsITEM_DETAIL/tabpTABIDT7").Select
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0015/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB1:SAPLMEGUI:6000/cmbDYN_6000-LIST").SetFocus
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0015/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB1:SAPLMEGUI:6000/cmbDYN_6000-LIST").Key = " " & j & ""
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0015/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB2:SAPLMEGUI:1303/tabsITEM_DETAIL/tabpTABIDT7/ssubTABSTRIPCONTROL1SUB:SAPLMEGUI:1317/ctxtMEPO1317-MWSKZ").Text = Cells(k, 7).Value
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0015/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB2:SAPLMEGUI:1303/tabsITEM_DETAIL/tabpTABIDT7/ssubTABSTRIPCONTROL1SUB:SAPLMEGUI:1317/ctxtMEPO1317-MWSKZ").SetFocus
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0015/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB2:SAPLMEGUI:1303/tabsITEM_DETAIL/tabpTABIDT7/ssubTABSTRIPCONTROL1SUB:SAPLMEGUI:1317/ctxtMEPO1317-MWSKZ").caretPosition = 2
session.FindById("wnd[0]").sendVKey 0
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0015/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB2:SAPLMEGUI:1303/tabsITEM_DETAIL/tabpTABIDT3").Select
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0015/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB1:SAPLMEGUI:6000/cmbDYN_6000-LIST").SetFocus
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0015/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB1:SAPLMEGUI:6000/cmbDYN_6000-LIST").Key = " " & j & ""
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0015/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB2:SAPLMEGUI:1303/tabsITEM_DETAIL/tabpTABIDT3/ssubTABSTRIPCONTROL1SUB:SAPLMEVIEWS:1102/subSUB1:SAPLMEGUI:1319/txtMEPO1319-IDNLF").Text = Cells(k, 8).Value
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0015/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB2:SAPLMEGUI:1303/tabsITEM_DETAIL/tabpTABIDT3/ssubTABSTRIPCONTROL1SUB:SAPLMEVIEWS:1102/subSUB1:SAPLMEGUI:1319/txtMEPO1319-IDNLF").SetFocus
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0015/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB2:SAPLMEGUI:1303/tabsITEM_DETAIL/tabpTABIDT3/ssubTABSTRIPCONTROL1SUB:SAPLMEVIEWS:1102/subSUB1:SAPLMEGUI:1319/txtMEPO1319-IDNLF").caretPosition = 5
session.FindById("wnd[0]").sendVKey 0
session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0015/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB2:SAPLMEGUI:1303/tabsITEM_DETAIL/tabpTABIDT3/ssubTABSTRIPCONTROL1SUB:SAPLMEVIEWS:1102/subSUB1:SAPLMEGUI:1319/txtMEPO1319-EAN11").Text = Cells(k, 5).Value
i = i + 1
j = j + 1
k = k + 1
Wend
IDon't understand your code too much, as I don't see how your excel looks like or what are you trying to do in ME21N. I don't know ECC much. I am not sure why you are incrementing i, j and k as well in the loop. But that could be OK. Are you sure you are using your variables correctly? For example in the first line of the loop you are accessing a field using variable i, but the value depends on variable k.
Likewise in your video cell value is in 12, my cell value is starting from 6 and I have assigned it to k with value 6, I is for row 0 to n with initial value 0 and j is for selecting line item and puting tax code under it
This video is really...really helpful for users. Thanks a lot for that. Is it possible to get you to make another video of Delivery Order Creation?
I could, the problem is that I am a CRM person, and have no idea how Delivery Order works. Also I am not sure if the system I have access to is set up for sales orders.
Hi Csongor
I have managed to adapt this script to ME31K creation of contracts, the only issue I am facing now is that the script ends after 27 entries in the Excel ( I have over 400) and it seems like it is related to the SAP GUI Scrolling, as the SAP screen has only 27 entries possible in the active screen. My problem is that I can't find a way to do like a Page Down or Scroll a few rows down and continue inputting the data. Do you have any idea of how this could be accomplished? Thank you
Sorry, I don't know ME31K enough. What is it you are entering which has 400 lines? I am pretty sure you can script a pagedown or other similar action. Maybe it will be easier to copy all 400 lines into the clipboard and paste that into Excel. This of course only works for simple lists like a list of 400 document numbers to be pasted into the selection screen of se16.
Csongor Varga Hi Csongor, It is like creating orders in va01, just that when my current screen has all item lines entries filled in the active screen it expects to do a page down or scroll which seems to actually make the script not working.
Csongor Varga Basically I am inputting from excel the MATNR, Material description and a price in the line items of the document. Nothing that I couldn't handle. The scroll part is the one creating problems.
I don't have a system where I could test this out, but what do you see when you create a recording where you press the page down or scroll button? Maybe a workaround will be that you press enter after entering every single line?
Pressing Enter is already implemented, I have found the following line in one of my recorded scripts where I have clicked on the scroll bar, session.findById("wnd[0]/usr/tblSAPMM06ETC_0220").verticalScrollbar.position = 26, tried working with it but still after the line item counter gets to 27, it seems like the new item line screen is not active or the connection needs to be reestablished.
could u pls tell me how to get the w_system id that u have mentioned DEG210
You should see that in the status bar. Where it shows the session or transaction code. You can click there and see the SID and client.
Bottom bar, right corner, there will be 3 to 4 values, click DOWNWARD facing arrow, pick :SYSTEM value : for me it was "IRP (1) 320 ", so i took "IRP320"
Hello, do you hace any explanation on how change po dates ones Po was created?
Great Videos...is there possible to create a excel macro to create a PR(purchase requisiton) in SAP.
Any GUI transaction can be scripted. So yes.
Great video once again. I've started watching your videos last month and it helped me a lot in my day to day tasks!
I am curious to know more about you and your career. Any videos where you talk about your personal and professional experience related to programming and opportunities there may be for us who are interested in sap gui scripting?
Thanks. I am a SAP CRM consultant, and have been for 16 years now. Worked for big consulting firms in the past, lately as a freelancer and actually in between jobs at the moment. I never learned coding, but I started with Pascal, Delphi later Visual Basic, bit of embedded C, Javascript. Most of the programming experience is not related to work, but hobby or just wanting to do my professional work easier.
Will this work in SAP HANA too?
It works with anything that is accessed via SAP GUI. Will not work with the Fiori interface.
sir i will wait for your next videos,upload for LT31 printing TOs
I am interested for this projects
How did you create that UI
Which UI?
@@shradhakadam2623 It is Microsoft Excel
@@csongorvarga I have a database. I want to create an user interface in excel where I will be able to fetch data just by entering the PO number. And then I want to connect it to SAP
@@csongorvarga could you please give me your email address?? I need help with this.
@@csongorvarga so you didn't use developer tool in excel??
sir please upload LT31 multiple TO printing
I am not doing these on demand. Develop your own app based on the technique shown here.
Sir i try but didn't get success. Please sir
Abaid Aramex I don't have access to any SAP system at the moment. I cannot build new macros right now.