Execute BW query using ABAP Part II
In the Execute BW query using ABAP Part I we have seen how to
execute BW query using ABAP. Now in this part we will see how the result in XML
format can be transformed to internal table format and also sample code for
testing the whole solution.
<!column ><xsl:apply-templates/></column>
<xsl:copy>
<xsl:apply-templates select=”@||text()”/>
<!column ><xsl:apply-templates/></column>
<xsl:copy>
<xsl:apply-templates select=”@||text()”/>
This is really great stuff.
Can we get the PDF o/p of the query result. I have seen your related articles in the BSP forum, can we use the smart forms functionality along with BW to get the PDF o/p. Also have you tried XSL FO which can produce PDF o/p.
Thanks.
-Deepu
thanks for the comments.
Now that the query results are in a internal table you could generate PDF either using OTF to PDF (Smart form) or spool to PDF.
I haven't tried XSL FO. Thats my next target, i will post the results once its done.
Regards
Raja
Dear Raja,I am not getting the values. Can you help me out?
META table will just have the structre definition of the output. the actual output is in xml_out as xml.Raja
Regards
Raja
Hi Raja,Sheetal
Thanks for your comments.
Its really difficult to address your question with the given explanation. If you just debugg the FM, you yourself will easily resolve the issue.
Regards
Raja
The values of wa_set-chavl is what i was looking for.
Thanks again your weblog was very helpful.
Regards,
Sheetal.
modify the FM code as below.Raja
This is really fantastic. Is it also possible to run a query view using abap and get the XML result?
Cheers,
Apurva
The following method will give the view definition.
CALL METHOD cl_rsz_www_db_interface=>get_view
this would also return the query of the view.
Get the query name and then create instance of cl_rsr_request like below.
CREATE OBJECT r_request
EXPORTING i_genuniid = p_genuniid .
I have checked some of the standard code of SAP this is what they are doing.
For example you can check out the code at
IF_SOAP_APPLICATION_RT~EXEC_PROCESSING
Hope this helps.
Regards
Raja
please use released BAPI's to get data from a query! Your workaround is not supported by SAP.
Kind regards
Michael
SAP RIG
Are you talking about the BAPI methods of ODBO Reporting? (using MDX). My knowledge of MDX is very poor and transaction MDXTEST dosent help much in generating the required MDX statements.
The solution talked here is a pure custom one. Which uses the standard classes/methods.
The closest FM which i found doing this kind of processing is RRW3_GET_QUERY_VIEW_DATA.
It would be really helpful for us if you could give us the BAPI names which can be used for getting data from query.
Regards
Raja
Could you please provide the name of BAPI's to get data from a query as you suggested.
Thanks,
Gary Ramage
You have left us in a cloud of confusion! Please reveal the names of those released BAPIs you were talking about.
Thank you for your time.
Regards,
Mahesh M.S.
Hi raja,Nicola Commari
Regards
Raja
Regards
Raja
we have a problem with a query where there's a Infoobject with a compound.
the details structure returned by this BAPI gives me the right output length. we also have exactly the same scenario (coarea/costcenter)(4+6). this works very well.
Can you debug and see whats going wrong?
Regards
Raja
Best Regards
Stefan
This is really wonderful and also useful. I tried with very simple query and it worked fine. Now the query which i am trying to download has 2 dates and it is not extracting properly.
Could you please guide on this.
Thanks in advance.
Bharat
It should not be a problem, i guess i have tested this scenario as well. Anyhow can you tell me what exactly happenning- what is meant by not extracting properly.
why dont you just debugg and see where it goes wrong.
Regards
Raja
Hi Raja<br/><br/>Thanks for reply. I did some amount of debugging abd found that it reads dates properly from query byt while assigning it assigns 10 digits to 8 digits and makes a mess of data.<br/>According to me following code is not working properly on my side..Bharat
Hello,<br/> I am a beginer in XSLT programming. I was reading SAP given transformation STRANSDEMO_FLIGHTS_A2X in was 6.4. Here i was not able to get following statement<br/><xsl:for-each select="asx:abap[1]/asx:values[1]/FLIGHT_LIST[1]/*"><br/>I know that xsl:for-each select is for loop but<br/>wats the output of line <br/>asx:abap[1]/asx:values[1]/FLIGHT_LIST[1]<br/>also here why they have used index .<br/>Even in the example given by you , you have used similar index notation. what is the significance of this.<br/> Also Sir, I tried to understand xslt through SAP help but as there is not proper documentation for each tag , I wasn't able to understand to greater extent. If you have any better documentation about xslt then please provide the same.<br/> Thank you.
is just to read the first record in the loop.
XSLT is not different in SAP (SAP has its own transformation based on XSLT call ST -Simple transformation, you can choose to use XSLT or ST).
as far learning XSLT, this will be a good start
http://www.w3schools.com/xsl/default.asp
Regards
Raja
Hello sir,<br/> Thank you for the reply. I am already reading the documentation given in the link specified by you. <br/><br/>In the statement below<br/><xsl:for-each select="asx:abap[1]/asx:values[1]/FLIGHT_LIST[1]/"><br/>as we use <xsl:for-each select for loop,<br/>why do we need to need to specify the first line of the table . why cant we simply say /FLIGHT_LIST instead of /FLIGHT_LIST[1]/.<br/>also kindly let me know the significance of prefix asx:abap[1]/asx:values[1]. I know that they are used for accessing abap data but why do we require index in this case.<br/>Awaiting for the favourable response.<br/><br/><br/><br/><br/><br/>
Kudos ..!!
I want to display the BI report data in bsp or webdynpro abap which is in arabic language.The BI system doesn't support the non-unicode.so i have to get that report data into unicode sytem in webdynpro or bsp and encode that data and pass to Bi system.
Is there any functionmodule to encode the data?
How to display that report data in bsp and which UI element support the Browser.
Please help me in the same.
Thanking you in advacne..
My query is regarding the parameters we are passing to the FM.
According to the requirement, I have to execute a BI query from CRM system. So I was planning to use the RFC RRW3_GET_QUERY_VIEW_DATA. I have the query name also the variable names. The mandatory parameters to execute the query has multiple values. So my doubt here is it possible to pass the multiple values for a single variable to the input parameter I_T_PARAMETER of the FM RFC RRW3_GET_QUERY_VIEW_DATA. Please share your thoughts/input.
you will have to use
VAR_OPERATOR_1
VAR_SIGN_1
VAR_VALUE_LOW_EXT_1
etc
I know this is an old topic but any help would be appreciated
Richard
I'm delighted to find that a way exists for reading BW query using ABAP. Now my doubt is, can a BW Workbook be also extracted, just as in the case of a BW query, using ABAP?
I have been looking all over, but nobody could crack this.
Thank you for your time.
Regards,
Mahesh M.S.
Thank you so much for your reply!
In fact I've used a function module RRMX_WORKBOOK_READ to read the above mentioned table for getting the workbook contents. But it's there in a binary format. So using neither the FM nor reading the table directly will make any difference.
Could you please suggest a way to convert this binary format to the readable format? The conventional FMs for doing this, provided SAP is not yielding any result.
Thank you again, for you time.
Regards,
Mahesh M.S.
Sorry for the delayed reply. What do you want to do with the read workbook content, open in excel? from where an ABAP program or web app? In my case i have a BSP page which lists the workbook and on clicking it will open the particular workbook in excel. Is this something you would like to do ?
Thank you for your reply.
My requirement is to extract the workbook contents into an internal table, just as it appears in the workbook. Is there really a way to do so?
All my research regarding the extraction of data from a BW workbook into an internal table has so far been futile.
Is there really a way out?
Thank you for your time.
Regards,
Mahesh M.S.
RSRWBINDEXT = worbooks header table
RSRWBSTORE = workbook contents