cancel
Showing results for 
Search instead for 
Did you mean: 

Choosing the correct tab on ME22N or ME23N

Former Member
0 Kudos

hello.

I am looking to ensure that when I run this particular TCODE that the VBA checks to ensure I am on the correct tab (confirmations tab for example), and if i am not on the correct tab then to choose it.  I already have written some code that works sometimes, however, if i'm already on the tab i get an error and sometimes, it just gives me an error regardless.


       session.findbyid("wnd[0]/usr/subSUB0:SAPLMEGUI:0010/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB2:SAPLMEGUI:1303/tabsITEM_DETAIL/tabpTABIDT16").Select

Can anybody give me some direction?  Thank you!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thanks to another thread this has been solved

       For p = 3 To 21

            Name = "tabpTABIDT" & CStr(p)

            saptab = session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0020/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB2:SAPLMEGUI:1303/tabsITEM_DETAIL/" & Name).Text

            If saptab = "Delivery Schedule" Then

              session.FindById("wnd[0]/usr/subSUB0:SAPLMEGUI:0020/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB2:SAPLMEGUI:1303/tabsITEM_DETAIL/" & Name).Select

                Exit For

            End If

           

        Next p

Answers (0)