2008 Jul 02 1:07 PM
HI Friends
I have got a bunch of requirements, related to SAP Queries.
I was serching for that, in that regards I am seeking your kind help.
1) I have to write a function module to retrive what are the tables and fields are using in a query.
2) I need execute a SAP Query through a function module and retrive the result into a table and export that to the function module.
One more thing which I need where these all SAP Queries will save, are there any tables where the information store and what are the fields, tables and join conditions for that queries.
Can you please help me with your suggestions.
Points will be rewarded.
Awaiting for your reply.
Thanks in advance
Praveen
2008 Jul 02 1:13 PM
hi,
check these tables.
AQGQDOC
AQLQDOC.
when ever a query is generated a program will be created internally ,u can get that program name from system - status.
now give that program name in function module GET_TABLES,it will give u all structures and tables used in program.
HI Friends
I have got a bunch of requirements, related to SAP Queries.
I was serching for that, in that regards I am seeking your kind help.
1) I have to write a function module to retrive what are the tables and fields are using in a query.
2) I need execute a SAP Query through a function module and retrive the result into a table and export that to the function module.
One more thing which I need where these all SAP Queries will save, are there any tables where the information store and what are the fields, tables and join conditions for that queries.
Can you please help me with your suggestions.
Points will be rewarded.
Awaiting for your reply.
Thanks in advance
Praveen
2008 Jul 02 1:13 PM
hi,
check these tables.
AQGQDOC
AQLQDOC.
when ever a query is generated a program will be created internally ,u can get that program name from system - status.
now give that program name in function module GET_TABLES,it will give u all structures and tables used in program.
2008 Jul 02 1:41 PM
Hi Gautham
But both of these tables are not having the information about the query which I have created.
I would like to ask you one thing, what will be the prefix name for the program which has been generated from the sap query.
I have created the query with the name of ZTEST1, but the program name is AQTGSYSTQV000024ZTEST1========. Can you please tell me what all those infront of ZTEST1.
Regards
Praveen
2008 Jul 02 1:45 PM
hi,
there will be some default naming convention followed for the programs that r created in ternally whenever we generate any query.
u can get query names from TADIR table.
give object type as AQBG
object name as <ur PROGRAM NAME>.
u will get the details.
2008 Jul 02 1:17 PM
Hi,
when you start a query (F8) you get the query´s name as a program (a query is at the end nothing else but a program). If you then go to transaction SE38 and enter the query´s name, you can then explore the core in order to get the objects that you need:
Search for tables
SELECT tabname FROM d010tab
WHERE master = program
AND tabname =
Search for function modules
SELECT NAME FROM cross
WHERE include =
AND type = 'F'
AND name =
Search for data elements
SELECT rollname FROM dd03vv
WHERE tabname = myline-objekt
AND rollname =
Something specific and quick for you to get should not exist. This is going to be a difficult task.