cancel
Showing results for 
Search instead for 
Did you mean: 

SAP GUI Appearance Changes After VBScript Manipulation

former_member709020
Participant
0 Kudos


I can't seem to find any posts on this issue in the forum; perhaps someone out there knows how to fix this via VBScript.

I have an Excel macro that manipulates SAP via embedded VBScript. The script was recorded using the SAP Script recorder.  After the code has run, the GUI appearance for popups (session.findById("wnd[1]) forms and subsequent forms look different and less user-friendly. The original session.findById("wnd[0] appearance seems unaffected and looks fine.  Is there a way to ensure that the original, default appearance for session.findById("wnd[1] is maintained after manipulating SAP via VBScript?  The only way I found so far is to log out of the SAP GUI

Example:

After drilling down to find a WBS code by clicking the drop down icon indicated below:

The subforms (popups - session.findById("wnd[1]) look like the screenshots below (before and after):

Before Running Script (every day user look and feel):

After running script:

Accepted Solutions (0)

Answers (2)

Answers (2)

holger_khn
Contributor
0 Kudos

Hello Gary.

Add Parameter id F4METHOD to your user Profile own data on paramter tab with Parameter value ActiveX

This should ensure to get the Dialog modal view automatically after script end.

Best regards,

Holger

former_member709020
Participant
0 Kudos

Thanks Holger,

I'm afradi I don't know how to do this.  I found the parameter tab; are you saying to add the ID programmatically?  I don't see a way to add it on the form.

holger_khn
Contributor
0 Kudos

Hello. Then you have no authorization for self maintain. Seems like you Need to raise an ticket to your Support Team for adding this Parameter.

former_member213011
Participant
0 Kudos

At the end of your script, did you clear the object variables by assigning it to Nothing? i.e.

set session = nothing

set connection = nothing

etc?

former_member709020
Participant
0 Kudos

Yes, but not in the same procedure.  The procedure with the script in it calls a Release_Obj_Variables() procedure which resides in another module.  This should serve the same purpose, correct?


Sub Release_Obj_Variables()

     'close forms
     DoCmd.Close acForm, "frmProgress"

     'release object variables
     Set SAPGUIAuto = Nothing
     Set SapGuiApp = Nothing
     Set SapGuiConn = Nothing
     Set session = Nothing

End Sub

former_member213011
Participant
0 Kudos

Correct.

I have no other idea on why this happens except that it could be a glitch in SAPGUI.