2021 Nov 27 8:38 PM
Hi
I need some help to collect the value from column 1 based on the value in column 4
See example:

So I need to iterate each row to search for the value '000000000000010035'. I'm still trying to learn some Visual Basic looping, but can't get it to work, I have something like this:
Dim Row as Integer
Dim ConsumptionProfile As String
Dim ValidUntil as Date
Dim Value as String
ConsumptionProfile = "000000000000010035"
Row = 1
' I want this first two rows to be in a loop, so that the Row variable adds +1 for each iteration
session.findById("wnd[0]/usr/tblSAPLE_LP_ASSIGNMENTTC_LOAD_PROFILE/ctxtELPASSLP-LOADPROFILE[4,"&Row &"]").setFocus 'The Focus isn't needed, but I have it here for debugging
Value = session.findById("wnd[0]/usr/tblSAPLE_LP_ASSIGNMENTTC_LOAD_PROFILE/ctxtELPASSLP-LOADPROFILE[4,"&Row &"]").text
'I wan't to exit the script when I have found the correct Value and then check in another cell but on the same Row as above
IF Value = ConsumptionProfile Then
ValidUntil = session.findById("wnd[0]/usr/tblSAPLE_LP_ASSIGNMENTTC_LOAD_PROFILE/ctxtELPASSLP-BIS[1,"&Row &"]").text
ValidUntil = CDate(ValidUntil)<br>
Would apreciete help with these kind of problem where I need to loop through rows to get a specific value, as I need to do this several times
Maybe some sort of exception handling when rows become an empty value (or last row) is also needed
Hi
I need some help to collect the value from column 1 based on the value in column 4
See example:

So I need to iterate each row to search for the value '000000000000010035'. I'm still trying to learn some Visual Basic looping, but can't get it to work, I have something like this:
Dim Row as Integer
Dim ConsumptionProfile As String
Dim ValidUntil as Date
Dim Value as String
ConsumptionProfile = "000000000000010035"
Row = 1
' I want this first two rows to be in a loop, so that the Row variable adds +1 for each iteration
session.findById("wnd[0]/usr/tblSAPLE_LP_ASSIGNMENTTC_LOAD_PROFILE/ctxtELPASSLP-LOADPROFILE[4,"&Row &"]").setFocus 'The Focus isn't needed, but I have it here for debugging
Value = session.findById("wnd[0]/usr/tblSAPLE_LP_ASSIGNMENTTC_LOAD_PROFILE/ctxtELPASSLP-LOADPROFILE[4,"&Row &"]").text
'I wan't to exit the script when I have found the correct Value and then check in another cell but on the same Row as above
IF Value = ConsumptionProfile Then
ValidUntil = session.findById("wnd[0]/usr/tblSAPLE_LP_ASSIGNMENTTC_LOAD_PROFILE/ctxtELPASSLP-BIS[1,"&Row &"]").text
ValidUntil = CDate(ValidUntil)<br>
Would apreciete help with these kind of problem where I need to loop through rows to get a specific value, as I need to do this several times
Maybe some sort of exception handling when rows become an empty value (or last row) is also needed
2021 Nov 27 8:38 PM
Thank you for visiting SAP Community to get answers to your questions. Since you're asking a question here for the first time, I recommend that you familiarize yourself with Community Q&A , as it provides tips for preparing questions that draw responses from our members.
For example, you can:
- outline what steps you took to find answers (and why they weren't helpful)
- share screenshots of what you've seen/done
- make sure you've applied the appropriate tags
- use a more descriptive subject line.
The more details you provide, the more likely it is that members will be able to respond. Feel free to also take our Q&A tutorial Q&A tutorial
Should you wish, you can revise your question by selecting Actions, then Edit.
By adding a picture to your Profile you encourage readers to respond.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |