Showing results for 
Search instead for 
Did you mean: 

Download Query execution to a File - APD

0 Kudos


I would like to download to a file the execution of a Query. I thought in APD, but I am facing an issue.

The layout of the query is the following (and as I expect to be in the flat file):

 	 					KF 1		KF 1		KF 1		KF 2		KF 2		KF 2
			Calendar day		01/02/2011	02/02/2011	03/02/2011	01/02/2011	02/02/2011	03/02/2011
Customer group		Material	 	 	 	 	 	 
A1			000000000030193470	10		12		14		16		18		20
A1			000000000030193473	12		15		18		21		24		27

But the layout of the file is:

Customer group	Material		Calendar day	KF 1	KF 2
A1		000000000030193470	01/02/2011	10	12
A1		000000000030193470	02/02/2011	12	15
A1		000000000030193470	03/02/2011	14	18
A1		000000000030193473	01/02/2011	16	21
A1		000000000030193473	02/02/2011	18	24
A1		000000000030193473	03/02/2011	20	27

My query has in Row 2 Characteristics and in Columns 2 KF and one characteristic. Is there any problem?

Regards, Federico

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Fredrico ,

APD will not be very helpful in your case as it cannot change query output format .However if you want it in mentioned format you can use function module RRW3_GET_QUERY_VIEW_DATA which will provide you t_cell_data (columns ) and t_axis_data (rows) that can be further changed into your desired format and can be written into a flat file .

For this you need to write a Report program in se38 and need to execute this function module .Later on you can convert your output as per your requirement and can write it to text file (either in your desktop or application server ).

This will be very efficient if your query have structures etc and also efficient in terms of memory .

If your requirement is for passing query output to non SAP system then it is very helpful.

Let me know If you want to go for this .I can help in writing program .



Former Member
0 Kudos


As I remember it is a normal behaviour of APD with such kind of queries (multi dimensional).

May be [this approach |] [original link is broken] [original link is broken] [original link is broken];will be helpful for you ...


0 Kudos

Hi, thanks for all yours replies.


I need the drill accross in columns for the calday.


I am trying with RSCRM_BAPI to extract to a file,but until now i can't. The warning that i have says: "INFOCUBE BWA DOES NOT EXIST". is it mandatory to have BWA for the cubes?

Regards, Federico

Former Member
0 Kudos

I guess you should at least put your calendar day in the rows...