on 08-02-2015 2:51 PM
Hi,
I am trying to write a Script that will bring the Income total from f.01.
For the same I made amendment in the layout so as the total will be always on the first line, hence I can pick it up.
I am trying to use the function getCellValue(int rowIndex, String columnName);
and my function will call the grid followed by the first row and the 3rd column like
session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/shell").getCellValue(1,"Total of reporting period");
I tried to debug, but I am getting no success.
Screenshot of the layout with total at the top.
The yellow bar is the total which is the top row.
Hi Saurabha,
That's the incorrect use of getCellValue method (you used wrong colName parameter.
Please have a look into this article. If possible, debug, so that you get an idea.
Copying Table data into a variable - SAP Imagineering - SCN Wiki
Regards,
Sushant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sushant/Script Man,
Thanks.
@Sushant - I used the debug option and had that figured out.
@Script Man - FYI - I did not find such line in the recording, else it would have been easy.
The script gives row and column index which selected.
I still dont understand as to why the function takes column name instead of taking column index. That would have been a lot easier.
--
Regards
SAurabha J
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Saurabha,
You can find the right name for the column by recording a test script.
1. Start the scriptrecorder from SAP GUI.
2. Click the column at the top with the name: Total of reporting period
3. Stop recording.
4. Look at the recorded script. Somewhere, perhaps there is a line such as:
session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/shell").selectColumn "XYZ"
5. The exemplary designation of the desired column ("XYZ") then you have to put it in the command.
e.g.
session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/shell").getCellValue(1,"XYZ")
Regards,
ScriptMan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.