Thank for the response.The final objective of the flow is to extract info from SAP using a SAP Script.
Im new to PAD, but yes Im using Fx flow and follow your instruction of selecting variable from menu.
Structure of the flow
First, I used a box to get input from user to select 2 dates which will be stored in variables. Stored as datetime.
Variables: Selecteddate and secondselecteddate
Then i convert it to string in mm.dd.yyyy format using a powershell script (variables values recognized without problem):
$fecha = Get-Date "${SelectedDate}"
Write-Output ($fecha.ToString("MM.dd.yyyy").Trim())
Variables: SelectedDateString and SecondSelectedString}
Then i want to run a VBS script setting parameters values based on the inputs.
At the moment Im using this way to declare the values inside the VBS script.
session.findById("wnd[0]/usr/ctxtIT_WADAT-LOW").text = "${SelectedDateString}"
session.findById("wnd[0]/usr/ctxtIT_WADAT-HIGH").text = "${SecondSelectedString}"
ERROR ON VBS detected: UNTERMINATED STRING CONSTANT
Entire VBS Script:
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
session.findById("wnd[0]").maximize
session.findById("wnd[0]/tbar[0]/okcd").text = "vl06f"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/ctxtIT_WADAT-LOW").text = "${SelectedDateString}"
session.findById("wnd[0]/usr/ctxtIT_WADAT-HIGH").text = "${SecondSelectedString}"
session.findById("wnd[0]/usr/ctxtIT_LGORT-LOW").setFocus
session.findById("wnd[0]/usr/ctxtIT_LGORT-LOW").caretPosition = 10
**session.findById("wnd[0]/usr/btn%IT_LGORT%APP%-VALU_PUSH").press
session.findById("wnd[1]/usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL_255-SLOW_I[1,0]").text = "1001"
session.findById("wnd[1]/usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL_255-SLOW_I[1,1]").text = "2001"
session.findById("wnd[1]/usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL_255-SLOW_I[1,2]").text = "2220"
session.findById("wnd[1]/usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL_255-SLOW_I[1,2]").setFocus
session.findById("wnd[1]/usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL_255-SLOW_I[1,2]").caretPosition = 4
session.findById("wnd[1]/tbar[0]/btn[8]").press
session.findById("wnd[0]/tbar[1]/btn[8]").press
session.findById("wnd[0]/tbar[1]/btn[18]").press
session.findById("wnd[0]/tbar[1]/btn[33]").press
session.findById("wnd[1]/usr/lbl[1,12]").setFocus
session.findById("wnd[1]/usr/lbl[1,12]").caretPosition = 7
session.findById("wnd[1]").sendVKey 2
session.findById("wnd[0]/tbar[1]/btn[43]").press
session.findById("wnd[1]/usr/ctxtDY_PATH").text = "My internal address in the computer"
session.findById("wnd[1]/usr/ctxtDY_PATH").setFocus
session.findById("wnd[1]/usr/ctxtDY_PATH").caretPosition = 53
session.findById("wnd[1]/tbar[0]/btn[0]").press