on 06-23-2015 11:12 AM
Hi,
is is possible to execute queries within a custom action block to a MDO? I'm using MII 15.0 SP4.
Thanks in advance for answering.
Regards,
Holger
Hi Holger,
Yes it is possible.
One of the possible ways is making a HTTP call to illuminator service of the MII.
Find more information about making http call from java code here:
html - How to send HTTP request in java? - Stack Overflow
More information about illuminator service can be found here:
URL Format for Queries - Content Development - SAP Library
Regards,
Rohit Negi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Holger,
Yes you can create a dynamic query for your MDO.
Here is the format for MDO Query:
<protocol>://<server>:<port>/XMII/Illuminator?Server=<Name of the MDO Data server>&Mode=<Mode of the query>&MDO=<Path of the MDO>
Here in the URL you have to add the necessary parameter names and values expected by the query.
For checking the proper names of the parameters check the Link Editor of a MDO Query.
E.g.:
Suppose I want to do a select query on a MDO, then this will be my URL:
<protocol>://<server>:<port>/XMII/Illuminator?Server=MDOConnector&Mode=SelectMDO=<Path of the MDO>&Attributes=<name of the attribute>
Regards,
Rohit Negi.
Hi, Rohit Negi,
thanks for your answer. That's the way it works for me. But what I want is to execute my own SQL-Query, written within the custom action block. The link URL Format for Queries - Content Development - SAP Library (see the Node) implies that it's also possible to query a SQL command directly with the Illuminator Service. But I dont't know how the syntax of the URL has to look in this case.
Regards,
Holger
Hi Holger,
Ir would be same as for MDO query:
http://<Server>:<Port>/XMII/Illuminator?Server=<Server Name>&Mode=FixedQuery&Query=<Write the Qeury here>&Content-type=text/xml
Also have a look at the characters you need to replace in your query to their hexadecimal equivalent:
Special Characters in HTML and HTTP - Content Development - SAP Library
Regards,
Rohit Negi.
Hi Rohit Negi,
first of all thanks for your patience.
Sorry for asking again: what name have I to fill in for <Server Name> it seems not to be the <Server>. Up to now I was only successfull to use the following URL:
http://<server>:<port>/XMII/Illuminiator?QueryTemplate=<queryTemplateName>
Using your template I got a response with invalid servername
Regards,
Holger
Hi Holger,
Another way would be connecting to the database of MII using the JDBC connection of Java.
You can find more information here:
Getting a Connection to the Database - Using Java - SAP Library
MII creates a JDBC datasource named "XMIIDatasource". You can use that or create your own also.
This is the path for JDBC datasources in the net-weaver server:
Configuration-->Infrastructure-->Application Resources
Once you get the connection object then you can query any table in the net-weaver/MII database.
Each MDO is a table created in the net-weaver/MII database thus you need to know the name of table generated by MII. Table for MDO will have names like MDO and a number.
The before mentioned approach of making http call to MII is better, clean and easy way to execute the queries.
Regards,
Rohit Negi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.