How can I loop between empty cells in QTP DataTable (SAPGuiTable) (433 Views)
Reply
Occasional Contributor
Posts: 3
Registered: ‎11-06-2013
Message 1 of 1 (433 Views)

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!

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.