2004 Nov 03 3:36 PM
Hi All,
While running a select query in ORACLE, we can put the table name in '<i>from</i>' clause at the runtime-Seletion Screen Parameter .
But I am not able to do so in SAP using Native Sql. Does SAP has any restrictions regarding this?
It might be possible that ,by using Embedded SQL (C/C++ precompiler ),we may be able to achive this.
Can any body please throw light on this.
Its Urgent.
Thanks in Advance.
Regards,
Gaurav
2004 Nov 03 4:11 PM
Hello Gaurav,
I don't know much about native SQL, but with open SQL this is possible with a statement like "<u>select * from (p_table)</u>" where p_table is the parameter which takes table name on the selection screen.
Thank you,
Aravind.
2004 Nov 03 4:27 PM
Have you tried macroes?
DEFINE ....
SELECT * FROM &1
....
(I will become a macroes' fan)
2004 Nov 03 7:10 PM
Hi
<u>Assuming you can also use Open SQL.</u>
Macroman's suggestion is OK. in Open SQL (this is SQL of ABAP platform) but a query statement can be constituted using some dynamic clauses. Although macro coding has some restrictions it will be less time consuming using it than a dynamic query.
<u>An example SELECT statement with dynamic clauses:</u>
SELECT (fields) FROM (table_name_variable)
INTO <target_fields>
WHERE (conditions_tab) .
For more information:
<a href="http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3983358411d1829f0000e829fbfe/frameset.htm">Open SQL -Reading Data</a>
*--Serdar