cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi Experts,

I am having a task to write a script which can be executed in different SAP systems , explained as below.

I have created a script to do password reset for mass users in one system (TC6) & it's working fine. But when i load same script in other system(QR5) to do the same activity , the system unable to execute the same script.

One thing i found that by comparing in the two systems that the screen-ids in QR5 system is different than TC6 system.

My question

1-> why it is different even though the scripting language is same.

2-> How can i overcome it & make a common script for all the systems.

Please help me to resolve this.

Thanks in Advance,

Khagendra

0 Likes
View Entire Topic
Stefan-Schnell
Active Contributor
0 Likes

Hello Khagendra,

you can use this solution to solve your problem:

'-Begin-----------------------------------------------------------------

    If Not IsObject(application) Then
      Set SapGuiAuto = GetObject("SAPGUI")
      Set application = SapGuiAuto.GetScriptingEngine
    End If

    If Not IsObject(connection) Then
      Set connection = application.Children(1)
    End If

    If Not IsObject(session) Then
      Set session = connection.Children(0)
    End If

    Set Info = session.Info()
    If Info.SystemName() = "QR5" Then
      'Here you can set a variable for the screen ID of QR5
    ElseIf Info.SystemName() = "TC6" Then
      'Here you can set a variable for the screen ID of TC6
    End If

    'Here your code, with the variable of the screen ID

'-End-------------------------------------------------------------------


Cheers

Stefan

khagendra_padhy
Explorer
0 Likes

Hi Stefan,

Thanks for your nice reply. But still i can't solve my complete problem. Because in the landscape i can't find which systems is upgraded one & which is not. Can you please help me for any other solution like platform independent methods which can be called for a certain task or can we make regular expression for GUICOMPONENT.

Any other solution if having also welcome.

Thanks in Advance,

Khagendra