on 2022 Oct 20 11:30 AM
Hi all,
I want to help my team save precious time by removing the manual encoding process in FB05.
I've been trying to look for loop function in encoding that will only finish the loop until the last blank row (column AC)
Here is my code:
Dim SapGuiAuto As Object
Dim application As Object 'SAPFEWSELib.GuiApplication
Dim connection As Object 'SAPFEWSELib.GuiConnection
Dim session As Object 'SAPFEWSELib.GuiSession
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
Set connection = application.Children(0)
Set session = connection.Children(0)
session.FindById("wnd[0]/usr/ctxtRF05A-NEWBS").Text = "09"
session.FindById("wnd[0]/usr/ctxtRF05A-NEWKO").Text = Cells(2, "AC")
session.FindById("wnd[0]/usr/ctxtRF05A-NEWUM").Text = "9"
session.FindById("wnd[0]/usr/ctxtRF05A-NEWUM").SetFocus
session.FindById("wnd[0]/usr/ctxtRF05A-NEWUM").CaretPosition = 1
session.FindById("wnd[0]").SendVKey 0
session.FindById("wnd[0]/usr/txtBSEG-WRBTR").Text = Cells(2, "T")
session.FindById("wnd[0]/usr/ctxtBSEG-ZFBDT").Text = "10/20/2022"
session.FindById("wnd[0]/usr/txtBSEG-VERTN").Text = Cells(2, "AD")
session.FindById("wnd[0]/usr/ctxtBSEG-VERTT").Text = "9"
session.FindById("wnd[0]/usr/ctxtBSEG-SGTXT").Text = Cells(2, "AE")
session.FindById("wnd[0]/usr/ctxtRF05A-NEWBS").SetFocus
session.FindById("wnd[0]/usr/ctxtRF05A-NEWBS").CaretPosition = 0
Hi,
As it is very specific to Excel VBA programing, I would recommend you consult Microsoft for more help, because I think they have more expertise on this topic.
Best regards,
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
12 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.