cancel
Showing results for 
Search instead for 
Did you mean: 

Getting table name using getTables() method in iCommand Applet

Former Member
0 Kudos

Hi All,

I need to fetch the table names from the SQL query in my irpt page

and my SQL query will look like..

SELECT * FROM EMPLOYEE.

I found there is a direct method in iCommand Applet to get the table names from that SQL Query

iCommand.getQueryObject().getTables();

but it is not returning me anything ..

is that the right way to get the table names from SQL query [ Fixed query mode ] or any other way to get the table names??

thanks in advance..

Accepted Solutions (1)

Accepted Solutions (1)

jcgood25
Active Contributor
0 Kudos

I think you should be working more closely with your TCS colleague (as Marcelo pointed out above):

Per the other thread you'll see that when using Query mode the portions of the select statement are kept separately and could be retrieved for simple queries. Columns, Tables, FilterExpr, SortExpr, and others would be available to you in the query object (http://help.sap.com/saphelp_mii121/helpdata/en/45/cca31a93696f74e10000000a1553f6/content.htm)

If you are using a FixedQuery you could consider using

[Param.1]

for the FROM clause and then you could simply request document.APPLETNAME.getQueryObject().getParam(1) to retrieve it at runtime, otherwise you will have to parse the Query property string yourself.

Try using

SELECT * FROM [Param.1]

and defaulting the value Employees in the Parameters tab of the Template, then you can easily retrieve this in javascript with the syntax above.

Former Member
0 Kudos

Hi Jeremy,

Ir's a nice idea to get the table names from Fixed Query.

Thank you Jeremy.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Lino,

Hello,

I believe that this method works only on Query mode the SQLQuery. Not works to FixedQuery mode.

I think the Michael's sugestion in the thread is a better way.