cancel
Showing results for 
Search instead for 
Did you mean: 

VB-scripting: What is the rule behind the numbering of the GUI-controls in SAP

Former Member
0 Kudos

I have opened item details in Me22n:

The Controli-id of "Confirmations" Tab is

"wnd[0]/usr/subSUB0:SAPLMEGUI:0019/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB2:SAPLMEGUI:1303/tabsITEM_DETAIL/tabpTABIDT16"

if I click to DeliverySchedule and want back to Confirmations the Control-Id is

"wnd[0]/usr/subSUB0:SAPLMEGUI:0015/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB2:SAPLMEGUI:1303/tabsITEM_DETAIL/tabpTABIDT16"

The difference between this both IDs is "0019" in the first id and "0015" in the second id.

How can I catch this in my vbscript?

Accepted Solutions (1)

Accepted Solutions (1)

stefan_schnell
Active Contributor

Hello Matthias,

this part of the ID /subSUBO:SAPLMEGUI:0019/ identifies from the function group MEGUI the screen 0019.

The difference to screen 0015 is the height of SUB3. In screen 0019 it is 18 height and in screen 0015 11.

Which screen is used is a question in the event handling.

To detect the correct container name you can use this snippet:

Set User = session.findById("wnd[0]/usr")
For i = 0 To User.Children.Count - 1
  Name = User.Children(CInt(i)).Name
  If Left(Name, 15) = "SUB0:SAPLMEGUI:" Then
    Exit For
  End If
Next

MsgBox Name

MsgBox session.findById("wnd[0]/usr/sub" & Name & "/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB2:SAPLMEGUI:1303/tabsITEM_DETAIL").Children.Count

I scan on the user screen the children names and if I found one with SUB0:SAPLMEGUI: I can use it as variable part inside my ID.

Let us know your results.

Best regards
Stefan

sophia-jg
Discoverer
0 Kudos

Fantastic explanation, your fix has helped me immensely.

Thank you!

-SJG

Answers (2)

Answers (2)

Former Member

Thanx for that.

It works fine. :-))

Best Regards

Matthias

kksingh01
Discoverer
0 Kudos

I have used same but still showing error. Please help me to find the solution..Code as under :

Set User = session.findById("wnd[0]/usr")

For i = 0 To User.Children.Count - 1

Name = User.Children(CInt(i)).Name

If Left(Name, 15) = "SUB0:SAPLMEGUI:" Then

Exit For

End If

Next

session.findById("wnd[0]/usr/sub" & Name & "/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/btnEDITFILTER").press
session.findById("wnd[0]/usr/sub& Name & "/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211").getAbsoluteRow(0).Selected = True session.findById("wnd[0]/usr/sub& Name & "/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211/btnMEPO1211-STATUSICON[0,0]").SetFocus session.findById("wnd[0]/usr/sub& Name & "/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/btnDETAIL").press session.findById("wnd[0]/usr/sub& Name & "/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB2:SAPLMEGUI:1303/tabsITEM_DETAIL/tabpTABIDT15").Select On Error Resume Next session.findById("wnd[0]/usr/sub& Name & "/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB2:SAPLMEGUI:1303/tabsITEM_DETAIL/tabpTABIDT15/ssubTABSTRIPCONTROL1SUB:SAPLMEGUI:1329/subTEXTS:SAPLMMTE:0200/cntlTEXT_TYPES_0200/shell").selectedNode = "F01" session.findById("wnd[0]/usr/sub& Name & "/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB2:SAPLMEGUI:1303/tabsITEM_DETAIL/tabpTABIDT15/ssubTABSTRIPCONTROL1SUB:SAPLMEGUI:1329/subTEXTS:SAPLMMTE:0200/cntlTEXT_TYPES_0200/shell").selectedNode = "F02" session.findById("wnd[0]/usr/sub& Name & "/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB2:SAPLMEGUI:1303/tabsITEM_DETAIL/tabpTABIDT15/ssubTABSTRIPCONTROL1SUB:SAPLMEGUI:1329/subTEXTS:SAPLMMTE:0200/cntlTEXT_TYPES_0200/shell").selectedNode = "F03"