cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Recording SAP GUI Dropdown in Enable Now

mira1102
Explorer
0 Kudos
656

Hi community, 

While recording a dropdown button like that in GUI - the button doesnt open the dropdown as in attached screenshot. Once the recording is off - the dropdown open normally and is visible. 

How can we record the click - opening of dropdown - and click on of the options so that we have it on record.

Thank you and habe a nice weekend! 🙂

Mira 

Accepted Solutions (0)

Answers (2)

Answers (2)

Rick_Croft
Explorer
0 Kudos

Hi Mira, I ran your question through our Eerly AI SAP Consultant and got the below response.  I am interested to know if this answers your question.

SAP AI Consultant

Issue Overview

You are facing issues with recording a dropdown button in SAP GUI. When you attempt to record the interaction, the dropdown does not open, but it works normally once the recording is off. This is a common issue when using SAP GUI scripting or recording tools to capture interactions with dropdowns and other dynamic elements.

Steps to Address the Issue

  1. Use SAP GUI Scripting:

    • SAP GUI scripting can be used to automate interactions with SAP GUI elements, including dropdowns. This method allows you to script the exact steps needed to open the dropdown and select an option.
  2. Record in Steps:

    • Record the interaction in steps, capturing each action separately. This can sometimes help in capturing the dropdown interaction correctly.
  3. Manual Script Adjustment:

    • Manually adjust the recorded script to include the necessary commands to open the dropdown and select an option. This might involve adding or modifying the script commands.

Detailed Steps:

Step 1: Use SAP GUI Scripting

  • Enable SAP GUI Scripting:

    • Ensure that SAP GUI scripting is enabled on both the client and server sides. This can be done in the SAP Logon options and the SAP system settings.
  • Record Script:

    • Use the SAP GUI Scripting Recorder to record the interaction. This tool can be accessed from the SAP GUI options.

Step 2: Record in Steps

  • Record Dropdown Opening:

    • Start recording and perform the action to open the dropdown. Stop recording after this step.
    • Save the recorded script.
  • Record Option Selection:

    • Start a new recording and perform the action to select an option from the dropdown. Stop recording after this step.
    • Save the recorded script.
  • Combine Scripts:

    • Combine the two recorded scripts into a single script that performs both actions sequentially.

Step 3: Manual Script Adjustment

  • Edit Script:

    • Open the recorded script in a text editor or the SAP GUI Scripting IDE.
    • Locate the commands related to the dropdown interaction.
  • Add/Modify Commands:

    • Ensure that the script includes commands to open the dropdown and select an option. The commands might look something like this:
' Open the dropdown
session.findById("wnd[0]/usr/ctxtFIELD_ID").setFocus
session.findById("wnd[0]/usr/ctxtFIELD_ID").caretPosition = 0
session.findById("wnd[0]/tbar[1]/btn[17]").press

' Select an option from the dropdown
session.findById("wnd[1]/usr/lbl[OPTION_ID]").setFocus
session.findById("wnd[1]/usr/lbl[OPTION_ID]").press
  • Test Script:
    • Run the script to ensure that it correctly opens the dropdown and selects the desired option.

Example Script:

Here is an example script that demonstrates how to open a dropdown and select an option using SAP GUI scripting:

If Not IsObject(application) Then
   Set SapGuiAuto  = GetObject("SAPGUI")
   Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
   Set connection = application.Children(0)
End If
If Not IsObject(session) Then
   Set session    = connection.Children(0)
End If
If IsObject(WScript) Then
   WScript.ConnectObject session, "on"
   WScript.ConnectObject application, "on"
End If

' Open the dropdown
session.findById("wnd[0]/usr/ctxtFIELD_ID").setFocus
session.findById("wnd[0]/usr/ctxtFIELD_ID").caretPosition = 0
session.findById("wnd[0]/tbar[1]/btn[17]").press

' Select an option from the dropdown
session.findById("wnd[1]/usr/lbl[OPTION_ID]").setFocus
session.findById("wnd[1]/usr/lbl[OPTION_ID]").press

Conclusion

To record the interaction with a dropdown button in SAP GUI, you can use SAP GUI scripting to automate the process. Record the interaction in steps, manually adjust the script if necessary, and ensure that the commands to open the dropdown and select an option are correctly included. This approach should help you capture the desired interaction for your automation or recording purposes.

mani_rathnam
Active Participant
0 Kudos

Make sure you have selected the Recording Profile as SAP GUI Signature.

mani_rathnam_0-1727441831038.png

 

BartRhoten
Participant
0 Kudos
Also in https://me.sap.com/ , Knowledge Base Article 2343079 may be helpful.
mira1102
Explorer
0 Kudos

Dear Mani, we tried also the GUI Signature - actually all the options for GUI and it still didnt help us.. Would you know another solution? BR Mira Dropdown.png