on 12-13-2012 11:42 AM
Hello,
I'm trying to find a value in a SAP field.
The field displays values like 100, 101, 102, 103, 200, 201, 300 etc. I want to identify those items that ends with two zeros and perform a action on those.
This is what i got now:
' Dimming the field
Dim SOItemNmbr
Set SOItemNmbr = session.findById("wnd[0]/usr/subSUBSCREEN_HEADER:SAPMV45A:4013/txtVBAP-POSNR")
If Not InStr(SOItemNmbr.Text, "00") > 0 Then
' <execute some code>
End If
I also tried InStrRev and it just does not seem to get me.
Anyone have a solution on this?
BR Mattias
Hi Mattias,
You can also try this:
Set SOItemNmbr = session.findById("wnd[0]/usr/subSUBSCREEN_HEADER:SAPMV45A:4013/txtVBAP-POSNR")
myText = SOItemNmbr.Text
'msgbox myText
If Not InStr(myText, "00") > 0 Then
' <execute some code>
End If
Regards,
ScriptMan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Thanks for your efforts, it still didn't work though, strangely enough...
I used this to fix it instead;
Dim SOItemNmbr As Integer
SOItemNmbr = session.findById("wnd[0]/usr/subSUBSCREEN_HEADER:SAPMV45A:4013/txtVBAP-POSNR").Text
If SOItemNmbr = itemVariable Then
<execute some code>
itemVariable = itemVariable + 100
End If
This If statement is part of a loop, so in each loop the itemVariable will increase when the If returns true.
So problem solved!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.