Re: SAPGuiTable - SetCellData (527 Views)
Reply
Occasional Contributor
Tuzzled
Posts: 3
Registered: ‎11-06-2013
Message 1 of 4 (544 Views)
Accepted Solution

SAPGuiTable - SetCellData

 


I was wondering if anyone could help me figure out how to handle this situation I am in.

 
I have hundreds of extractors with different selections I am trying to run with one script. Every time I change the Datasource, the selections in the SAPGuiTable changes. I need a code that identifies which "Field" to input the "From_value" and "To value".
 
Please find below the code I recorded. Also I attached a screenshot of the SAP window. I am going to make those lines of code a variable.
 
 
SAPGuiSession("Session").SAPGuiWindow("Extractor Checker S-API").SAPGuiTable("Selections (Internal Format)").SetCellData 1,"From value","FACII"
 
SAPGuiSession("Session").SAPGuiWindow("Extractor Checker S-API").SAPGuiTable("Selections (Internal Format)").SetCellData 2,"From value","1900001"
 
SAPGuiSession("Session").SAPGuiWindow("Extractor Checker S-API").SAPGuiTable("Selections (Internal Format)").SetCellData 2,"To value","2008016"
 
SAPGuiSession("Session").SAPGuiWindow("Extractor Checker S-API").SAPGuiTable("Selections (Internal Format)").SelectCell 2,"To value"
 
'SAPGuiSession("Session").SAPGuiWindow("Extractor Checker S-API").SAPGuiButton("Extraction").Click
 
 
 
Thank you so very much for your anticipated contribution!

 

Occasional Visitor
Rich_Edwards
Posts: 3
Registered: ‎11-07-2013
Message 2 of 4 (527 Views)

Re: SAPGuiTable - SetCellData

Hi Tuzzled,

 

I think i know what you're asking - you want to be able to enter your from and to values based on the value that's in the field column, right?

 

 

Looks like you're currently hard coding the row you want to enter -  Would the .FindRowByCellContent(col, val) be the command your after?

 

Something like:

 

'get the row

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

 

'enter details

SAPGuiSession("Session").SAPGuiWindow("Extractor Checker S-API").SAPGuiTable("Selections (Internal Format)").SetCellData myrow,"From value",  datatable("from",dtLocalSheet))
 
SAPGuiSession("Session").SAPGuiWindow("Extractor Checker S-API").SAPGuiTable("Selections (Internal Format)").SetCellData myrow,"To value", datatable("to",dtLocalSheet))
 
 
Your datatable then has 3 columns: Field, From and To.  The rest should be a simple bit of data driving.
 
(please note i typed that code in the reply window - it might need debugging)

 

Cheers,

Rich

 

 

Occasional Contributor
Tuzzled
Posts: 3
Registered: ‎11-06-2013
Message 3 of 4 (499 Views)

Re: SAPGuiTable - SetCellData

Thank you so very much Rich_Edwards your solution was exactly what I needed.

 

 

Occasional Visitor
EdmundYeo
Posts: 1
Registered: ‎12-20-2013
Message 4 of 4 (445 Views)

Re: SAPGuiTable - SetCellData

Hi,

 

Thanks for the solution. I also need the find the row of my SAPGuiTable when i'm entering the Characteristics for the Variant Configuration.

 

but i got this error:

 

Cannot identify the specified item of the SAPLCEI0CHARACTER_VALUES object. Confirm that the specified item is included in the object's item collection.

Line (11): "myrow = SAPGuiSession("Session").SAPGuiWindow("Create Trade Order: Characteri").SAPGuiTable("SAPLCEI0CHARACTER_VALUES").FindRowByCellContent("options", datatable("Options",dtLocalSheet))".

 

Can you help me?

 

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.