Access to SIGADW Query inside Remote

To access either the chart or the table of a SIGADW query through the menu of any Protheus® module, follow the steps below:

For the System user a corresponding user must exist in SIGADW with the same name and password. Besides, Siga User option in user register in SIGADW must be defined.
Create a function in AdvPL with a meaningful name and add the call code of the query below. Compile it and, then, put the call of this function in the menu of any of the System modules.
Code to call SIGADW query: DWRemote (URLDW, NomeDW, NomeConsulta, Tabela/Grafico, TipoConsulta)

Where:

URLDW: SIGADW url
NomeDW: Name of Data Warehouse used.
NomeConsulta: name of the query that is being called
Tabela/Grafico: it specifies if the definition of table or  chart must be executed. Enter 1 to access the table and 2 to access the chart.
TipoConsulta: type of query. Enter U for user queries and P for pre-defined queries. Optional parameter: if you do not enter any of them, P is used as a parameter.

 

Example 1:

User Function <Nome_Function>

return DWRemote(\"http://apd.microsiga.com.br/dw\",\"cpr_templatesdw\",\"Faturamento\",1)

 

Example 2:

User Function <Nome_Function2>

return DWRemote(\"http://apd.microsiga.com.br/dw\",\"cpr_user\",\"Faturamento\",2, “U”)

Important:

You must have access privilege for the query above.