cancel
Showing results for 
Search instead for 
Did you mean: 

Getting errors from ajax call to PCo query when server is selected dynamically

Former Member
0 Kudos

Hello,

We currently use PCo with Factory Talk Gateway to get tag information from our shop floor machines.

Right now the way we get that information onto our MII web screens is through an ajax/jquery call to an xacute query that executes a BLS that calls the PCo query. We have 10 different data servers that the PCo query can read from and that server is selected dynamically based on transaction input. At a high level, if the transaction input is "1" then the PCo query will read from DataServer1. If the input is "2" then it will read from DataServer2, and so on.

When run manually, the transaction and xacute queries retrieve and return correct data every time without fail. But when we run our MII Web page and the xacute query is called via ajax/jquery we get errors returned: premature end of file. This usually means an error happened within the transaction. We also never get these errors when just using the PCo query's default data server; these errors only come up when selecting the PCo server dynamically as a link through the link editor.

It's also worth noting that last week this all worked fine, even with dynamically selecting the server. I asked our basis team if they changed any settings on our server and they say they haven't. Though I don't know what else could have changed that would cause this.

To summarize:

- Manually running the transaction that calls the PCo query retrieves and returns data correctly all the time, so there's no issue with PCo.

- Selecting the server dynamically causes "premature end of file" errors MOST of the time. I've occasionally gotten it to work when trying to access the web screen in different ways but nothing's been consistent.

- Using the default PCo data server works every time, so it shouldn't be an issue with differing input.

- Everything worked just fine and error free last Friday, and to my knowledge nothing has changed as far as server, domain, etc...

Please let me know if you think this is a bug or if you need more information.

Thanks!

Luis

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

All

It turns out the problem was that our generic shop floor user didn't have the role SAP_XMII_DynamicQuery assigned to it and so the query would fail when executed on a dynamically selected server. This explains why it sometimes worked and sometimes didn't, and this explains why it ALWAYS worked when the default server was used.

When the SAP_XMII_DynamicQuery role was added it worked every time.

Luis

Answers (0)