cancel
Showing results for 
Search instead for 
Did you mean: 

SAPGUI script in Excel Macro

Former Member
0 Kudos

I am running a SAPGUI script from an Excel macro.

My SAPLogon Release is 720 and Patch level is 15.

When I run the script from my workstation, the script run successfully.

When the customer runs the script from their workstation a script error "The control could not be found by id" occurs on statement "session.findById("wnd[0]/usr/ctxtRCGBVSEL-LDEPID").Text = "Test".

The customer's SAPLogon Release is 720 and Patch level is 8.

If I logon to the customer system with the customer's user id from my machine and run the script, the script runs successfully.

Also when the customer performs a recording for a particuler screen, the generated script is different than the script generated on my machine.

Example: A statement other than "session.findById("wnd[0]/usr/ctxtRCGBVSEL-LDEPID").Text = "Test" is generated

Does this mean that the problem lies in the different SAPLogon patches?

Is there any additional configuration required?

Any steps to follow to determine cause of failure?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I believe you are experiencing what I have just experienced with sap.

Check the LAN connection for the client and ensure its set to High Speed.

Then the script will function without issues.

This is accessible from the Logon Pad by selecting the connection and configuring it under Network High Speed.

If the client can't change it you will need to modify the script to read the reduce text version which is issued in Low speed mode.

There is a SAP note about limitations of the SAP scripting interface which indicates that certain items will not be sent in Low speed mode.

Hope this helps.

Regards

John

Answers (1)

Answers (1)

script_man
Active Contributor
0 Kudos

Hi Raynald,

I do think that the different patch level can be the cause. But you could try this:

. . .

on error resume next

session.findById("wnd[0]/usr/ctxtRCGBVSEL-LDEPID").Text = "Test"

if not err.number = 0 then

'Here is the other version of the command, recorded directly from the user.

  session.findById("wnd[0]/usr/ctxtRCGBVSEL-LDEPID-OTHER").Text = "Test"

end if

on error goto 0

. . .

Regards,

ScriptMan