cancel
Showing results for 
Search instead for 
Did you mean: 

Call Bex Query result from ABAP

jan_balek
Explorer
0 Kudos

Hello BW Community, what is the best way for call Bex Query result from ABAP program?

thanks

Accepted Solutions (1)

Accepted Solutions (1)

hendrik_brandes
Contributor
0 Kudos

Hello Jan,

you can use the Function Module  RS_VC_GET_QUERY_VIEW_DATA_FLAT to execute a query.

In this FM you can also pass Parameters to your query.

The result-Structure will give you a list off cells and a definition about your axis.

Kind regards,

Hendrik

hendrik_brandes
Contributor
0 Kudos

Hello Jan,

I assumed, that you are running you BW with Release < 7.30. With 7.30 you will have a very easy access point by using the so called "Easy Queries": http://scn.sap.com/community/data-warehousing/netweaver-bw/blog/2012/02/17/my-first-steps-with-easy-...

WIth those, you will have a clear function module with a typed structure for your concrete query and you do not have to deal with cells, rows, axis and so on.

Kind regards,

Hendrik

jan_balek
Explorer
0 Kudos

Hello Hendrik,

thanks for helpfull answer,I have BW 7.01, do you know which FM is better for calling Bex Query result , RRW3_GET_QUERY_VIEW_DATA or your RS_VC_GET_QUERY_VIEW_DATA_FLAT?

thanks

sapna_jgurudutt
Active Contributor
0 Kudos

Hi,

Can you please refer the following link regarding RRW3_GET_QUERY_VIEW_DATA  and check whether it is relevant:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/44/b7a332352056a4e10000000a1553f6/frameset.htm

Thanks & Regards,

Sapna

jan_balek
Explorer
0 Kudos

Hi Sapna,

but I need all data of query, not only key figures. With RRW3_GET_QUERY_VIEW_DATA I see only KFs.

Do you know, how Can I get all query data?

thanks

hendrik_brandes
Contributor
0 Kudos

Hello Jan,

the parameter e_axis_data has the informations about the rows and columns. Look in the debugger and you will see that AXIS = 0 is the column-axis and AXIS = 1 is the row-axis. Within this structure you will have a field called "SET" as internal table with the concrete data.

The structure within these data tables is organized by so called tupels. Each tupel represents one row and you have to fill it up with the cell-data.

Hope this helps.

Kind regards,

Hendrik

Answers (3)

Answers (3)

amine_lamkaissi
Active Contributor
0 Kudos

This message was moderated.

former_member186696
Active Contributor
0 Kudos

Hello Amine,

Check the FM (Se37) RRW3_GET_QUERY_VIEW_DATA.


Put the query technical name on I_QUERY and run it.


If you need more help, please consider to open a new thread to our SCN. This one has 4 years old.

Kind Regards,
Edward

jan_balek
Explorer
amine_lamkaissi
Active Contributor
0 Kudos

Hi Edward and Jan,

Thanks for your answers.

The issue with using this FM, i am not able to display the data in an abap internal table as in the analyzer.

Can you answer me on this thread or should i open a new one?

Thanks.

Amine

hendrik_brandes
Contributor
0 Kudos

Hello Jan,

sorry for so many different posts;-)

Look at this: http://wiki.sdn.sap.com/wiki/display/BI/Expose+BI+Query+as+RESTful+Service

This describes very well, how to use the FM RRW3_GET_QUERY_VIEW_DATA. Although it is not so easy to read, it works as designed. If you replace the part of creating the XML-Response with a XSL-Transformation for filling internal tables, you get your desired result.

Kind regards,

Hendrik

jan_balek
Explorer
0 Kudos

Hello Hendrik,

big thanks for help,I want to use FM RRW3_GET_QUERY_VIEW_DATA or FM RS_VC_GET_QUERY_VIEW_DATA_FLAT to call all query result from ABAP.

But I don't know how to transform export from these FM's to result, which is similar to simple query result in RSRT.

Do you know any FMs how to transform it? or can you send me abap code?

thanks


michael_devine
Employee
Employee
0 Kudos

Hi,

In transaction SQ01. Follow this path: Query->More Functions->Display Report Name.

Check this report in transaction SE38 and analyze this and find the Select statement in the report.

Use the same Select statement for getting the data in an Internal table.

Regards,

Michael

jan_balek
Explorer
0 Kudos

Hi Michael, Thanks for your answer,but my question is about BW Bex Query, not SAP Query.

What is the SAP recommendation for How to execute a BEx Query(BI7 using ABAP)?

thanks

sapna_jgurudutt
Active Contributor
0 Kudos

Hi,

Can you please try executing a BEx Query using transaction RSRT and check whether it helps you.

Thanks & Regards,

Sapna

jan_balek
Explorer
0 Kudos

Hi, I need call Bex query result in ABAP program,how can I call RSRT from ABAP?