Good morning,
I'm testing a PAD flow that should run a SAP automation using the Pro-code approach, therefore using SAP VB scripting engine.
The PAD flow obtains dynamics values from a Cloud flow, it runs some PAD conditional logic to pass Input variables to the script.
SAP should run this script with input values to create a new customer record, and the script finally must be able to read from the status notification the newely created customer code.
I have one obstacle:
My company policies deny the execution of VisualBasic scripts in our machines, so the 'Run VBScript' action of PAD doesn't work. No problem because I used the walkaround way to dynamically write the VB script code by using 'write in a text file' action of PAD, after that I use the no-code approach of PAD to open SAP, launch the SAP Recording and Scripting feature, and give as input the just created VBS.
My problem now is that I have to read the new Customer record code from the SAP status bar, and pass this value to an Output variable of PAD, which will return it to the cloud flow.
I can get the Customer record code, but I cannot assign it to the PAD variable because with the 'write in a text' action the output variable is displayed as follows:
"" = session.findById("wnd[0]/sbar/pane[0]").Text
On the other hand, I obtained a single machine without the company policy that locks VB scripts execution, but I'm still in trouble because I have to apply conditional logic on the VBS, and with the 'Run VBScript' action you can input the script lines of code once, no conditional logic within the action itself.
In order to proceed, then I thought to read the content of the VBS file created with 'write in text file' actions that I used earlier, to pass the whole content to the 'Run VBScript' action, but doing in this way I pass a variable that contains the VBS, which in turn contains other variables namely my input data of PAD.
The only walkaround that I found is to generate a msgbox() window from the VBS, that include the SAP new customer code, and then from PAD I run the 'extract data from a window' action to pull it into the output variable... not a reliable way to work.
Can you suggest me some ways to assign SAP VBS data to an Output variable from a scenario like this?
Thank you in advance