Unified Functional Testing Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

How can I loop between empty cells in QTP DataTable (SAPGuiTable)

Occasional Contributor

How can I loop between empty cells in QTP DataTable (SAPGuiTable)

[ Edited ]

 

Please find attached relevant tables

 

 

One DataSource can have multiple fields, one field or no field at all.

 

When my script gets to a DataSource with multiple fields, it fails. I need a logic in my script to loop through all the fields if a DataSource has more than one field.

 

The code below works fine if there is zero to one content in the Field Column for a DataSource

 

 

SAPGuiSession("Session").SAPGuiWindow("Extractor Checker S-API").SAPGuiEdit("DataSource").Set DataTable("DataSource", dtGlobalSheet)

 

SAPGuiSession("Session").SAPGuiWindow("Extractor Checker S-API").SAPGuiEdit("Data Records / Calls").Set DataTable("Data_Records_Call", dtGlobalSheet)

 

SAPGuiSession("Session").SAPGuiWindow("Extractor Checker S-API").SAPGuiEdit("Display Extr. Calls").Set DataTable("Display_Extr_Calls", dtGlobalSheet)

 

SAPGuiSession("Session").SAPGuiWindow("Extractor Checker S-API").SAPGuiEdit("Display Extr. Calls").SetFocus

 

SAPGuiSession("Session").SAPGuiWindow("Extractor Checker S-API").SendKey ENTER


myrow = SAPGuiSession("Session").SAPGuiWindow("Extractor Checker S-API").SAPGuiTable("Selections (Internal Format)").FindRowByCellContent("Field", datatable("Field",dtGlobalSheet))

 

If  myrow = 0 Then
 else
End If

 

SAPGuiSession("Session").SAPGuiWindow("Extractor Checker S-API").SAPGuiTable("Selections (Internal Format)").SetCellData myrow,"From value",  datatable("From_Value",dtGlobalSheet)

 

SAPGuiSession("Session").SAPGuiWindow("Extractor Checker S-API").SAPGuiTable("Selections (Internal Format)").SetCellData myrow,"To value", datatable("To_Value",dtGlobalSheet)

 

 

Please find attached relevant tables.

 

Thanks!