Find the internal name of a column in a grid control
In order to use SAP GUI scripting methods or native control methods for the SAP grid control you will often need the internal column names, for example "AUFNR" for the column "Order". Here we describe three possible ways to ascertain these internal names.
Solution 1: Use the SAP GUI scripting recorder
Then change the width of each column for which you want to find
out the name. Stop the recording and display the generated .vbs file; it
will contain the internal column names. Example:
The column names in this example are AUFNR, AUART,GSTRP, KTEXT.
Solution 2: Use a SAP GUI trace
Then start the transaction so that the grid is displayed. Switch off the trace and display the trace file. It will contain lines of the following kind:
Here you see the internal column names and the corresponding column titles.
Solution 3: Use the GuiXT "Native control Interface"
The "Native conrol interface" is available in GuiXT Controls version 2019 Q1 1 and above. You can use it to write a small helper function that returns the column names and titles.
Add the following Visual Basic function in one of your VB.NET dlls in a suitable class, e.g. dll "utilities.dll" and class "grid":
Add a GuiXT button in the SAP grid screen which calls up the "DevHelpColumnNames" function via an InputScript:
pushbutton (toolbar) "Show column names" process="show_column_names.txt"
The InputScript (see below) will also insert the column names into the Windows clipboard so that you can paste the names into your script or VB program:
/ Development only: show internal column names
Message "&V[column_names]" title="Column names Insert via Ctrl+V"
// copy to Windows clipboard for script insertion
CopyText fromText="column_names" -toClipboard