I just started with VBA and SAP GUI Scripts.
I am able to enter to the operation in SAP GUI via VBA but I am unable to find how to select or copy the value of these fields.
While recording the script via SAP GUI, copying the fields into the clipboard won't appear in the script as an action.
Any help or reference is highly appreciated.
Please find code and screenshot below.
Sub XXXX()
Call SAPConnections
Session.FindById("wnd[0]/tbar[0]/okcd").Text = "Operation"
Session.FindById("wnd[0]").SendVKey 0
Session.FindById("wnd[0]/usr/ctxtP_MATRL").Text = "PartNumber"
Session.FindById("wnd[0]").SendVKey 8
Session.FindById("wnd[0]/tbar[1]/btn[1]").Press
The screen you are showing is named an "ABAP List".
It contains labels and text fields, they belong to the property Children
of the GuiUserArea object
, and their IDs are made of prefix lbl
or txt
followed by the column and row numbers. The respective SAP GUI Scripting objects are GuiLabel
and GuiTextField
, for example:
/app/con[0]/ses[0]/wnd[0]/usr/lbl[0,12]
/app/con[0]/ses[0]/wnd[0]/usr/txt[22,12]
If you want to know all the fields which are in the ABAP list, you must loop at the property Children
of the GuiUserArea
object.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.