New Ranks & Badges For The Community!
Notice something different? The ranks and associated badges have gone "Star Fleet". See what they all mean HERE
Highlighted
Absent Member.
Absent Member.
169 views

QTP Output to Table from InputBox

Jump to solution
I need to store the test patient name and new location input from an InputBox object. The global sheet has columns titled "Name" and "NewLocation". There are defined variables (ConcatName and Input) that need to go to these respective column rows. Here is what I have so far:

If TeWindow("TeWindow").TeScreen("ADMISSION C").TeField("NoBedsMsg").Exist (1)Then
UserChoice=MsgBox ("There are no beds available in this location. Press OK to change the location for this admission.Press Cancel to halt the run", vbOKCancel)
Select Case UserChoice
Case vbOK
Input=InputBox("Please enter a valid location for Pavilion" &xPav &",using CAPITAL letters")
Reporter.ReportEvent micDone, "MainBranch", "New location of " &Input &"chosen for " &ConcatName
'ENTER CODE HERE FOR PUTTING NAME AND LOCATION TO GLOBAL SHEET
TeWindow("TeWindow").TeScreen("ADMISSION C").SendKey TE_PF3
TeWindow("TeWindow").TeScreen("ADMISSION C").Sync
TeWindow("TeWindow").TeScreen("ADMISSION C").TeField("LOCATION").Set &Input
TeWindow("TeWindow").TeScreen("ADMISSION C").SendKey TE_ENTER
TeWindow("TeWindow").TeScreen("ADMISSION C").Sync
Case else
Reporter.ReportEvent micWarning, "MainBranch", "Run stopped on patient " &ConcatName &" for location problem."
ExitRun 'ENTER CODE HERE TO STOP THE RUN AND EXIT LOOP
End Select
End If

I hope you can help. Thanks!
0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.
Absent Member.
Not sure if I have understood the requirement correctly but I can see both location and contact name are stored in the variables input and ConcatName. Think you are trying to store the values of these variables in global datatable. You can simply add the below lines.

DataTable.value("Name", Global) = ConcatName
DataTable.value("NewLocation", Global) = Input

Not sure this is what you are looking for.

Thanks,
Arpan

View solution in original post

5 Replies
Highlighted
Absent Member.
Absent Member.
Not sure if I have understood the requirement correctly but I can see both location and contact name are stored in the variables input and ConcatName. Think you are trying to store the values of these variables in global datatable. You can simply add the below lines.

DataTable.value("Name", Global) = ConcatName
DataTable.value("NewLocation", Global) = Input

Not sure this is what you are looking for.

Thanks,
Arpan

View solution in original post

Highlighted
Absent Member.
Absent Member.
Arpan,

Thanks for verifiying this for me! I gave the format a try and it matches what I thought it might be.

Will calling the data table Global instead of dtGlobalSheet accomplisht he same thing?

K
0 Likes
Highlighted
Absent Member.
Absent Member.
Yes..Both can be used.

Regards,
Arpan
0 Likes
Highlighted
Absent Member.
Absent Member.
Kathy,

You from NJ?
0 Likes
Highlighted
Absent Member.
Absent Member.
Nope - not from NJ. In Nashville - Music City!
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.