Executinga BW query using ABAP

I saw this blog on how to execute a BW query using abap. My question is, where do we create the function module Y_EXECUTE_QUERY? I mean under which function group? Thanks.

This is the blog I was referring to:
/people/durairaj.athavanraja/blog/2005/04/03/execute-bw-query-using-abap-part-i

Similar Messages

  • Getting an error when i am execution a BI query using ABAP.

    Hi Expert,
    I am getting an error when i am execution a BI query using ABAP. Its Giving me this Error "The Info Provider properties for GHRGPDM12 are not the same as the system default" and in the error analysis it saying as bellow.
    Property Data Integrity has been set differently to the system default.
    Current setting: 0 for GHRGPDM12
    System default: u2019 7 u2018
    As I am very new to BI and have very limited knowledge, so I am not able to understand this problem. Can any one help me to resolving this issue. Previously it as working fine, I am getting this error last 2 days.
    when i am debugging , I am getting error from
    create instance of cl_rsr_request
    CREATE OBJECT r_request
    EXPORTING
    i_genuniid = p_genuniid.
    this FM. Its not able to create the object. Can any one please help me out.
    Thanks in advance.
    Regards
    Satrajit

    Hi,
    I am able to solve this problem
    Regards
    Satrajit

  • Execute a query using ABAP  (XSLT transformation issue)

    Hello,
    I made the steps from this blog (part I, II and III).
    /people/durairaj.athavanraja/blog/2005/12/05/execute-bw-query-using-abap-part-iii
    When trying to run the XSLT transformation, I got the message that : XML invalid source file.
    I am not sure what are the steps for running a transformation, or running it for this case ,maybe something it's not ok. I just run it, did not provide any information.
    Any suggestions ? Did anyone use the function module described in this blog ?
    Thank you very much in advance.

    try giving
    CALL TRANSFORMATION (`ID`)
    SOURCE meta = meta_data[]
    output = <ltable>[]
    RESULT XML xml_out
    OPTIONS xml_header = 'NO'.
    and check - sometimes the codepages configured in the BW system tend to cause an issue... I am not sure if the syntax is right though - but you are basically trying to bypass any encoding that is happening in the query transformation....
    http://www.sapetabap.com/ovidentia/index.php?tg=fileman&sAction=getFile&inl=1&id=4&gr=Y&path=ABAP%2FABAPENANGLAIS&file=ABAP-XML+Mapping.pdf&idf=41
    Edited by: Arun Varadarajan on May 18, 2009 11:28 PM

  • Rename RKF and CKF in query using ABAP

    Hi guys,
    I am supposed to rename RKF and CKF in query using ABAP.  (RKF: restricted key figures, CKF: calculated key figures)
    Right now, I am using FM RSZ_X_COMPONENT_GET to load query definition. I can find and rename all used RKF and CKF technical names and rename them in returned tables and then save it using  RSZ_X_COMPONENT_SET.
    But  I see that both RKF and CKF are reusable elements and they are can be probably used somewhere else.
    Can you tell me where can I find information in what header table are they saved or maybe some "where used" table.
    What FM am I supposed to use to rename CKF and RKF in given query and also in other parts of SAP system?
    Even some information how to get deeply into this problem would be very helpful.
    Thanks.

    Hi,
    You can see the query element definitions in RSZ* tables, but not sure if you will be able to find complete info, like a particular RKF is restricted by following selections by looking at the tables. Also, please do not try to change the info directly in the tables even though you seem to have a lot of objects to changes.
    Hope this helps...

  • Execute BW query using ABAP

    Hello ,
    1) I used the function module from this link :
    /people/durairaj.athavanraja/blog/2005/12/05/execute-bw-query-using-abap-part-iii
    When I run it , I see the metadata correct and this is all. No more data to display.
    2) Then I used the code from here :
    /people/durairaj.athavanraja/blog/2005/12/05/execute-bw-query-using-abap-part-iii
    MOVE: <variable name> TO wa_var-vnam ,
       'I' TO wa_var-sign,
       'EQ' TO wa_var-opt,
       <variable value> TO wa_var-low .
         query_variables       = var
    FUNCTION z_test_query.
      FIELD-SYMBOLS: <outtab> TYPE ANY TABLE,
        <l_line>  TYPE ANY,
        <l_field> TYPE ANY.
      TYPE-POOLS: rrx1 .
      DATA: wa_var     TYPE     rrx_var ,
            var TYPE STANDARD TABLE OF rrx_var ,
            xml_out TYPE string ,
            breturn TYPE STANDARD TABLE OF bapiret2 ,
            rpt_tech_id(50) ,
            wa_meta TYPE zbw_query_output_metadata ,
            xslt_error TYPE REF TO cx_xslt_exception ,
            is_fieldcat     TYPE     lvc_s_fcat,
            it_fieldcat       TYPE     lvc_t_fcat,
            new_table  TYPE REF TO data ,
            xslt_message TYPE string ,
            meta TYPE STANDARD TABLE OF zbw_query_output_metadata . " this structure was created in the previous part
    *fill all the variables like below.
      MOVE: 'SEM_PSG01/PSG___00000_080_V1' TO rpt_tech_id .
      APPEND wa_var TO var .
      CLEAR :xml_out .
      REFRESH breturn .
      CALL FUNCTION 'Z_QUERY_EXECUTE'
        EXPORTING
          query_name            = rpt_tech_id
        IMPORTING
          xml_out               = xml_out
        TABLES
          return                = breturn
          meta                  = meta
        EXCEPTIONS
          bad_value_combination = 1
          user_not_authorized   = 2
          unknown_error         = 3
          query_not_found       = 4
          OTHERS                = 5.
      CASE sy-subrc .
        WHEN 0 .
          CLEAR: is_fieldcat, wa_meta .
          REFRESH: it_fieldcat .
          LOOP AT meta INTO wa_meta.
            is_fieldcat-fieldname = wa_meta-fieldname.
            is_fieldcat-outputlen = wa_meta-outputlen .
            is_fieldcat-datatype = wa_meta-datatype.
            is_fieldcat-scrtext_l = wa_meta-scrtext_l.
            APPEND is_fieldcat TO it_fieldcat.
            CLEAR : is_fieldcat .
          ENDLOOP .
          IF NOT it_fieldcat[] IS INITIAL .
            CALL METHOD cl_alv_table_create=>create_dynamic_table
              EXPORTING
                it_fieldcatalog = it_fieldcat
              IMPORTING
                ep_table        = new_table.
            ASSIGN new_table->* TO <outtab>.
          ENDIF .
          TRY .
              CALL TRANSFORMATION ('Z_GPS_TR')
              SOURCE XML  xml_out
              RESULT     outtab = <outtab>.
            CATCH cx_xslt_exception INTO xslt_error.
              xslt_message = xslt_error->get_text( ).
          ENDTRY.
        WHEN 1 .
        WHEN 2 .
        WHEN OTHERS .
      ENDCASE .
    {ENDFUNCTION.
    'Z_GPS_TR' is my transformation (exactly the code from the blog).
    'Z_QUERY_EXECUTE' is the function from 1). I did not use variables for the query parameter.
    I see with  the debugger that <outtab> is filled corectly, with the values from my query.  Still , the function, when is runed normally, does not display anything.
    3) If I run only the transformation Z_GPS_TR alone, it says invalid source XM source file.
    Please, some suggestion? I don't know hot to proceed.
    Many thanks.
    Edited by: Ariana D on May 19, 2009 11:40 AM

    Hi All
    I able to solve this problem
    Regards
    Satrajit.

  • Change query using abap

    hi all,
    i find a situation when i need to change many queries to include a common variable of a characteristic. is it possible to create a program to change query? are there any function modules for this?
    thanks.

    Hi,
    You can run or get an URL for query with ABAP Function modules. but for creation, it may not possible.
    As this is a different tool.
    Regards,
    Ravi Kanth

  • RRi for query using ABAP program

    For a report, we are using RRI (jump to target) functionality to see invoices in R/3 system using an ABAP program. I do not have much idea on R/3 systems how invoices are setup in R/3 Dev, test and prod. The ABAP report is done by a backend person. I need to place that in RSBBS. Here, my doubt is that do we need to follow the same procedure for this to move it to production system i.e, first create that RRI and ABAP in respective dev systems and transport both to test and then to Prod? Could anyone please explain me the steps on how this will work in real-time?
    Points will be assigned.
    Thanks

    Hi,
    I am not able to find how the two reports are conncted.
    You can check in RSBBS t-code. RRI will be defined here to jump from One Query yo another and many more options.
    My work is to copy the parent query a nd do some modification to it. Please let me know how to check and achieve that.
    You can do this BEx Query Designer itself.
    Regards,
    Suman

  • Help! I want to add check number field to a query using ABAP.

    I need to select PAYR-CHECT and add this field to a query where BKPF-BELNR = PAYR-REC_BELNR.
    How would I write the select statement? HELP!

    Would this work?
    SELECT        CHECT FROM  PAYR
           WHERE  REC_BELNR  = BKPF-BELNR.
    ENDSELECT.

  • Execute query with drill down using abap

    Hello together,
    I need to execute a query using abap and I need the result of the drill down on one characteristic in the query.
    I try to use RRX_GRID_CMD_PROCESS to execute query, but I don't understand how to do the drill down.
    I thought I have to specify somehow the name of the object on which I need to make the drill down. I tried to send this as a parameter to e_t_drill... but this is not working. I have also seen that
    e_t_drill[] = g_sx_buffer-r_request->n_sx_request-drill, but this is empty.
    Could you, please explain how to do this?
    Thank you,
    Iuliana

    Our RKF def is as follows:
    Keyfigure: 0deb_cre_lc
    Chars:
    Posting Keys: 01,02,11,12
    Year start date: Restricting it with a variable created on it. Variable is of type Customer exit.This variable
    gets value from key date which is entered by user dynamically.
    Specified the offsets of Yr start date as 0 to 365.
    Regards,
    smitha.

  • Execute Bex query from ABAP

    Hi,
    I am using the method mentioned by Durairaj (@  /people/durairaj.athavanraja/blog/2005/04/03/execute-bw-query-using-abap-part-i )
    to execute queries from ABAP.
    When I try to execute a query with characteristics in rows and if the characteristics name is large then i get a dump:
    'Field symbol has not yet been assigned'
    @ <l_field> = wa_set-chavl .
    I tried the same for another cahracteristic of lesser length and it works fine.
    Initially the chara name was like:
    <8 letter dim name>__<7 letter chara name >
    when i used a dim name with lesser no of letters:
    <7 letter dim name>__<6 letter chara name >
    It works fine.
    is there any restricition on the lenght of characteristics ?
    Thanks,
    Message was edited by:
            Rithesh Vijayakrishnan

    Matthias,
    I have tried to use this method before, but with the follow URL:
    /SAP/BC/WebDynpro/SAP/YWEBTEMPLATE_TEST/bi_template_page.htm?&varn1=0pcalmon&varv1=200901&varn2=0p_cocd&varv2=b047&url=/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex
    didn't work as I image.
    Do I have to transform this url before execute the method?
    Tnks for your patience.

  • How to use ABAP Class to modify Web Query Result ??

    Hi all !
    We are using Web Templates to display our Query.
    What I would like to do ( and seems a really important issue for our users! ) is to have a "PAGE BREAK" everytime the value of a charateristics change in the report
    For Example :
    -Page 1-
    Division     Project
       A               1
                        2
                        3
    -Page 2-
    Division     Project
       B               1
                        2
                        3
    and so on....
    I read threads about using ABAP CLASS but no example what so ever...
    We are presently under BW 3.1 but are considering upgrading to 7.0 by the end of the year so if there is a solution to my problem on either version i'd like to know.
    If anyone has any information about how I can do this it would be most appreciated
    Thx
    JB.

    Hi Yong,
    Ravi is right, first check the blogs by Jocelyn, and if you still have specific questions you can ask them. I have used ABAP classes in workflow and I know Mike Pokraka tries to use classes exclusively.
    Regards,
    Martin

  • How to extract a query in EXCEL Form using ABAP?

    Hi,
      is there a way using ABAP to extract the results from a specific BW Query and save them in an EXCEL format file?

    Hi,
    You can do it by using InfoSpoke or RSCRM_BAPI.
    see in the following URL, there one blog  in(https://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy)
    How to transfer the Data from SAP-System to Non-SAP system without additional Cost/License
    /people/surendrakumarreddy.koduru/blog/2009/03/11/how-to-transfer-the-data-from-sap-system-to-non-sap-system-without-additional-costlicense
    Re: Running Quaries automatically and saving them in as a Excel file in Server
    Re: Data transfer to external systems
    Re: Loading from a Custom R/3 Table
    Re: How can I schedule my Bex report to execute in background
    Re: How can I insert the RSCRM_BAPI into Process chain?
    Thanks
    Reddy

  • Generating a report using ABAP query

    Hi All,
    I want to generate a anlytical report using ABAP query, There are 3 different transactions/steps have to be executed to get this data in an actionable form.
    1. MB52 - Unrestricted Stock
    2. ZCustomquery - Custom query in SAP R3
    3. Combine above two in a single report.
    Please suggest me how can i proceed,
    1. Example i have created query name called Finalrepot
    2. How can i call above zcustomquery and Transaction (MB52) in the Query.
    Thanks for your help
    Pradeep

    Hi,
    Check below link to create ABAP query (SAP Query)
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Create_The_Query.asp
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf
    Best regards,
    Brijesh

  • ABAP Query Using LDB

    Hello Frn's
    I need to develop a abap Query using LDB , for this a Infoset is allready created , which uses PNPCE LDB .
    Below i am Descrbing the scenerio , for which we need to develop the query ....
    Dept/Div Transfer
    Employees who transferred dept or division within specified date range:
    EmpID
    Last Name, First Name
    Date of transfer
    New department
    New division
    Current supervisor
    Old department
    Old division
    How can i fitler out the data of our requirment ... because i want to use same infoset in diffrent query .
    Please provide some solution
    Thanks and Regards..
    Priyank Dixit

    Hi Priyank,
    First you need to check whether all the required fields are available there in the LDB PNPCE(I guess you are using the same).
    I think old department, old division must not be available there. Then you need to add it in your Infoset and write custom code for these fields. Once you are done with custom coding, you can use this infoset for creating queries.
    Use trnx SQ02 to create queries, either SAP or Infoset.
    Hope it helps. Let me know if you need some more help.
    Raveesh

  • ABAP query using PSJ

    Is there a way to get the company code project profile and the co amount using an Query .
    something similar to CJI3 but with the comapny code and project profile.
    Or if i have to use ABAP.

    There are  two things. ( Your question is not quite  clear, post question clearly, so platform can help you better way )
    1. Restrict you report selection  based on project  Project profile, company code  etc. give * in project filed and use  dynamic selection functionality
    2. If after execution you wanted to display some additional filed
    First check change layout option after executing CJI3, if your required field is not there in that case, your requirement can be addressed via Exit COOMEP01 (Actual      EXIT_SAPLKAEP_001)
    With Regards
    Nitin P.

Maybe you are looking for

  • Where can I get the material about EJB Design?

    I am working with EJB for a short time.I know that a well-designed architecture is very important.So I want to learn more about the EJB Design.Can anyone tell me where to find such material?And which book shall I choose? Thank you.

  • Equium P200: sometimes looses WLan connection

    Hi there Looking for help, my Equium P200 sometimes looses connection to the net. My partners do not! Also when in other peoples it losses signal so I know its the laptop, its very intermittent , it can go for months and nothing then it can do it twi

  • Database creation in oracle 8.0.4

    Hi, I'm creating a database in Oracle 8.0.4. I choose the custom option to give all the parameters. One of these parameters is the password of internal user. I give it as oracle. After giving all the other parameters and then click on finish to creat

  • Azure In Role Caching Doesn't start on server with "Not running in a hosted service or the Development Fabric."

    I started to use Azure in-role caching and everything works great in Azure compute emulator on my local machine, but not on server. I've already dealed with some problems, like lack of msshrtmi.dll on server, but now can't understand why get this err

  • Binding in OO4O

    I've inherited some Excel 2002 VBA code which makes a number of similar calls to the database (9.2 client/10.2 server), I'd like to put a bind variable in to speed everything up and be nicer to the server. I've altered the SQL and put the Parameters.