Purpose Read all grid rows Solution Use the predefined VB function guinet.GridControl.GridToTable It copies the content of the grid cells into GuiXT variables, using a separate variable name for each cell. The variable name structure is like the one used for your own tables so that you can immediately display the content in a table, or address each cell content in your script. The columns to be read can be specified in guinet.GridControl.GridToTable, see the example below. An alternative way to read the grid content is guinet.GridControl.CopyText which loads the whole grid content into a single GuiXT text variable, one line for each grid row. This is appropriate if you want to pass the grid content to other programs e.g. Excel or VB.NET functions. |
GuiXT Script PushButton (1,2) "Load operations" process="load_operations.txt"InputField (1,28) "Date from" (1,42) name="opfrom" -date InputField (1,56) "to" (1,60) name="opto" -date if V[opcount>0]Table (3,2) (32,135) name="operations" rows="&V[opcount]" _ fixedColumns=6 title="&V[opcount] operations selected"
Column
"Order"
name="aufnr"
size=8 endif InputScript "load_operations.txt" // clear all table values // start transaction IW37N // Selection of Orders and Operations Title "Please wait... Reading operations" // Selection criteriaSet F[Period] "&V[opfrom]" Set F[Period to] "&V[opto]" Enter "/8" // Execute // List of Orders and Operations Title "Please wait... Reading operations" CallVBAsync opcount = guinet.GridControl.GridToTable tableName:="operations" _columns:="aufnr,ktext,vornr,ltxa1,v_arbpl:arbpl,v_sttxt:sttxt" Enter Screen SAPLSLVC_FULLSCREEN.0500Enter /n
GuiXT Script Editor Pro: Grid column names
|
Components |