on 06-25-2015 2:35 PM
For anyone out there that has done work to automate material master data entry, you run up to the issue with the views potentially being different from material to material dependent upon how the material was initially created. One material may have been created without the Forecasting tab activated, whereas other have been activated. The tab can be selected like this:
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP22").select
However, that selection criteria may be incorrect dependent upon load characteristics. That selection may be the Work Scheduling Tab, Warehouse view, etc.
Does anyone know of a good way to either make a tab/view selection via script while within the material master or make a default selection from the "select views" button based upon tab text name rather than the tab number?
Note: Our company does not allow for access within the tables. I'm restricted away from SE16, SE16N, SE17 and similar based on home office policy.
Hi Ehren,
you can try the following:
Public Sub SelectTab(ByVal Suchtab As String)
With SapSession
For i = 1 To 50 'Sorry but there is no Count-Property
If i <= 9 Then
TabIndex = "0" & CStr(i)
Else
TabIndex = CStr(i)
End If
On Error Resume Next
Debug.Print "tabpSP" & TabIndex & "|" & .FindById("wnd[0]/usr/tabsTABSPR1/tabpSP" & TabIndex & "").Text
If Err.Number = 0 Then
If Trim(.FindById("wnd[0]/usr/tabsTABSPR1/tabpSP" & TabIndex & "").Text) = Suchtab Then
.FindById("wnd[0]/usr/tabsTABSPR1/tabpSP" & TabIndex & "").Select
Exit For
End If
Err.Clear
End If
On Error GoTo 0
Next i
End With
End Sub
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.