Skip to main content

I need help with this task. I am using a VBScript to store the option selected ina comoBox in SAP. The function is the following one:
 

How can i get the variable “vPedidoOriginalMotivo” in the output of the function. I’ve tried rescuing the variable just selecting a variable in the run function action in automation:
 

The problem is that the variable is always empty.

 

¿How can i make sure that the output is the “vPedidoOriginalMotivo” variable in my function?

Hi ​@mti.molina ,

It looks like your VBScript function RevisionBloqueo() is correctly retrieving the selected value from the combo box, but the issue is likely that the function isn't returning vPedidoOriginalMotivo. To fix this, you need to explicitly return the variable from the function. Try modifying your function like this:

 

 

Instead of just assigning the value to vPedidoOriginalMotivo, the function now returns it when called. This ensures that RevisionBloqueo() outputs vPedidoOriginalMotivo when executed.

 

 

If the issue persists, verify the following:

  • The combo box actually contains a value when the script runs.
  • The findById path is correct.
  • The script is being executed in an environment where it can properly interact with the SAP GUI. (Or check Scripting is enabled on SAP Client, if not please enable it)

 

Hope this will help.

 


Reply