Dim TableColumns
SAPGuiSession("Session").SAPGuiWindow("Access").SAPGuiOKCode("OKCode").Set "me23n"
SAPGuiSession("Session").SAPGuiWindow("Access").SendKey ENTER
TableColumns = SAPGuiSession("Session").SAPGuiWindow("PO").SAPGuiTable("SAP").ColumnCount
If TableColumns < 4 Then
SAPGuiSession("Session").SAPGuiWindow("PO").SAPGuiTable("SAP").SelectCell 1,"item"
SAPGuiSession("Session").SAPGuiWindow("PO").SAPGuiButton("Set filter").Click
SAPGuiSession("Session").SAPGuiWindow("filter").SAPGuiGrid("GridView").SelectCell 5,"ColumnName"
SAPGuiSession("Session").SAPGuiWindow("filter").SAPGuiGrid("GridViewCtrl").SelectRow 5
SAPGuiSession("Session").SAPGuiWindow("filter").SAPGuiButton("Add filter criterion").Click
SAPGuiSession("Session").SAPGuiWindow("filter").SAPGuiButton("Enter").Click
End If