Purpose
Select a grid layout variant using an InputScript.

In certain SAP transactions, the layout variant for a grid control is selected through a dedicated entry field in the selection screen. This is the case in transactions such as IW38 and SE16N, where setting the field value with a command like
 
Set F[Layout] "/STANDARD"

is sufficient for choosing the desired variant:



In transaction SE16N:



However, in other transactions like SE16, the selection process involves handling a popup window that itself appears as a grid control. In these instances, selecting a layout variant requires clicking on the correct grid cell:


Solution
Use the GridControl.ClickCellByValue
function from the GuiXT Controls component to interact with the grid control and select the desired variant.

Example
To simplify a process for users, we provide two buttons that display customer orders in SE16, each utilizing a specific layout variant.



GuiXT script

GuiXT
// Customer orders, layout /SHORT
Pushbutton (toolbar) "Customer orders overview" _
	process="customer_orders.txt"
  using LAYOUT = "/SHORT"

// Customer orders, layout /STANDARD
Pushbutton (toolbar) "Customer orders detailed view" _
	process="customer_orders.txt" 
  using LAYOUT = "/STANDARD"
Input script customer_orders.txt

GuiXT
// Layout variant to choose
Parameter LAYOUT

// Start transaction SE16
Enter "/nse16"

// Data Browser: Initial Screen 
Screen SAPLSETB.0230
  Set F[DATABROWSE-TABLENAME] 	"VBAK"
  Enter
  
// Data Browser: Table VBAK: Selection Screen 
Screen .1BCDWB.DBVBAK.1000
  Set F[ERDAT] 		"01.01.2025"
  Set F[ERDAT TO]	"30.06.2025"
  Set F[Maximum No. of Hits] 	"500"
  Enter "/8"      	// Execute
  
  
// Data Browser: Table VBAK Select Entries        500 
Screen SAPLSLVC_FULLSCREEN.0500
  Enter "/33"      	// Goto Layout Selection
  
// Choose Layout 
Screen SAPLSALV_CUL_CONFIGURATION.1500
  CallVBasync guinet.GridControl.ClickCellByValue _
    value:="&U[LAYOUT]"  column:="variant"
  Enter

Components
InputAssistant + Controls