on 12-19-2011 3:42 PM
Hello,
I have a Excel/SAPscript macro that closes WBS elements in CJ20N. This macro will fail upon trying to close a WBS that is already closed, because the close alternative is faded and unavailable in the menus. Therefore I want the macro to check the WBS element system status field if it contains the "CLSD" status before setting the status.
I have tried this which does not work, the .Contains("CLSD")-part, I have also tried .Text.Contains("CLSD"), .Text = "CLSD", and no one of those are working. If it finds CLSD in this field in the code, it should move on to "Redanstangdhoppaover" in my code (this skips the actual setting of the status).
If session.findById("wnd[0]/usr/subDETAIL_AREA:SAPLCNPB_M:1010/subVIEW_AREA:SAPLCJWB:3999/tabsTABCJWB/tabpGRND/ssubSUBSCR1:SAPLCJWB:1210/subSTATUS:SAPLCJWB:0700/txtCNJ_STAT-STTXT_INT").Contains("CLSD") Then GoTo Redanstangdhoppaover
What else is there left to try?
Thanks, Mattias
Hello Mattias,
try this:
Dim oName
Set oName = session.findById("wnd[0]/usr/subDETAIL_AREA:SAPLCNPB_M:1010/subVIEW_AREA:SAPLCJWB:3999/tabsTABCJWB/tabpGRND/ssubSUBSCR1:SAPLCJWB:1210/subSTATUS:SAPLCJWB:0700/txtCNJ_STAT-STTXT_INT")
If InStr(oName.text, "CLSD", 1) > 0 Then
MsgBox "Found"
Else
MsgBox "Not found"
End If
Hope it helps.
Cheers
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi and thanks for the answer.
Got it to work with this edit:
Dim oName
Set oName = session.findById("wnd[0]/usr/subDETAIL_AREA:SAPLCNPB_M:1010/subVIEW_AREA:SAPLCJWB:3999/tabsTABCJWB/tabpGRND/ssubSUBSCR1:SAPLCJWB:1210/subSTATUS:SAPLCJWB:0700/txtCNJ_STAT-STTXT_INT")
If InStr(oName.Text, "CLSD") > 0 Then session.findById("wnd[0]/tbar[0]/btn[3]").press
GoTo Redanstangdhoppaover
Thanks again :]
Mattias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.