Query in ABAP-HR

Hi,
Can you please tell me the difference between Personnel selection period and date selection period.
Thanks,
Maheedhar
Please refer SAP Help and always search the web before posting
Locked by: kishan P on Aug 24, 2010 1:15 PM

Hi Ram,
Please check this program
DATA: t0000 TYPE catsp_t2002,
       sub_subrc LIKE sy-subrc.
  CALL FUNCTION 'HR_READ_INFOTYPE'
    EXPORTING
      pernr     = pernr
      infty     = '2002'
      begda     = pdatv          "     '18000101'
      endda     = pdatb         "     '99991231'
    IMPORTING
      subrc     = sub_subrc
    TABLES
      infty_tab = t2002.
  CASE sub_subrc.
    WHEN 0.                                                 " ok
      subrc = 0.
    WHEN 4.              " missing authorization - some records skipped
      subrc = 4.
    WHEN 8.                            " no records found
      subrc = 8.
      EXIT.
    WHEN 12.             " missing authorization - all records skipped
      subrc = 4.
  ENDCASE.
Best regards,
raam

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

  • Bex Query in ABAP report

    Can i call a BEx query in ABAP report and display in ALV grid. if so please give me the syntax.
    Thanks
    Akila.R

    Look at the FM "RSDRI_INFOPROV_READ".
    With this you can read data into a internal table of your program.
    With this FM, you can do a selective read and select only the key figures and characteristics that you wish to read in your ABAP.
    I am not ure, if you can call a BEx report in your ABAP. But with what I mentioned here, you can acheive what you want.
    Ravi Thothadri

  • 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

  • Conversion from query to ABAP report

    Hi,
    I have already a query (report), displaying some data.working perfectly.
    now i want to convert that Query to ABAP report, with same selection screen and functionality?
    Is there any process for conversion or i have to create just like a normal report and writing the code....
    Thanks in advance,
    fractal

    There is no standard conversion available as such, but you can find out the Query Report name and then copy that to another program and make your changes. But it is preferable to just write it from the start as queries are notorious for their select statements.
    I don't know why you intend to write a report even though your query is working, but if you want to do it, write your own program. You can always keep the same selection screen.
    Regards,
    Srinivas

  • ABAP query vs ABAP report

    Hi Experts,
       I have a question regarding ABAP query  and report.
      what is the difference between ABAP query and ABAP report  ?
      will the query be more efficient than abap report ?
      Is there a standard SAP report that could replace a query?
    Thanks in advance,
    Manoj

    Hi,
    A report is a piece of logic that you write in (this case) in a programming language (ABAP). It uses the syntax of the normal commands of the PL.
    ABAP Query is a higher level tool, that reduces or eliminates the need to "program" in the PL, and rather uses more intuitive, graphic tools, to basically get the same results.
    Generally speaking, if the reporting needs are simple and standard, it is easy and feasible to use the query. The more complex the logic gets, the more you'll probably need to use programming.
    Regards,
    Mario

  • Dynamic query in ABAP

    Can we use dynamic query in ABAP?

    1. Dynamic where clause
    You can use an internal table to build a dynamic where clause:
    data: where_tab(30) occurs 1 with header line,                     
             where_clause(30) type c.                                     
    Build the where clause. Will look like this when finished
    WHERE ZAFSTMD02 = 'X' AND rbusa = '5145'
    With a constant, result: ZAFSTMD01 = 'X'
    concatenate 'ZAFSTMD' zcostcheck-zmaaned  ' = ''X'''  into where_clause.                              
    Append to internal table where_tab
    append where_clause to where_tab.                                  
    With a variable, result: AND rbusa = '5145'
    concatenate 'AND rbusa = '  ''''  i_tab-zgsber  ''''
    append where_clause to where_tab.                                  
    Select
    select * from zcostfreq                                           
         where (where_tab).                                              
    endselect.                                                        
    Note that you can combine static and dynamic where clauses:
    select * from zcostfreq                                           
         where bukrs = '2021' AND
                                  (where_tab).                                              
    endselect.                                                        
    2. Using a dynamic table name
    This report prints the number og entries in a table. The table name is
    specified by a parameter.
    data:
      l_count type i.
    parameters:
    p_tab type tabname.
    start-of-selection.
      select count(*) from (p_tab) into l_count.
      write: / 'Number of entries in table ', p_tab, l_count.
    3. Dynamic retrieval and writing of data
    In this example, data is retrieved from the table selected on the selection
    screen, and the contents of the
    table is written to the screen.
    DATA:
    Create variable that can contain referecene to any data
      dataref TYPE REF TO data.
    FIELD-SYMBOLS:
      <row>         TYPE ANY,
      <component>   TYPE ANY.
    PARAMETERS:
    p_tab TYPE tabname.
    START-OF-SELECTION.
    Create a workarea for the tabel selected on the selection screen
      CREATE DATA dataref TYPE (p_tab).
    The variable dataref cannot be accessed directly, so a field symbol is
    used
      ASSIGN dataref->* TO <row>.
      SELECT *
        FROM (p_tab) UP TO 10 ROWS
        INTO <row>.
        NEW-LINE.
        DO.
        Write all the fields in the record   
          ASSIGN COMPONENT sy-index
            OF STRUCTURE <row>
            TO <component>.
          IF sy-subrc <> 0.
            EXIT.
          ENDIF.
          WRITE <component>.
        ENDDO.
      ENDSELECT.
    4. Dynamic SELECT
    TYPES:
      BEGIN OF st_bseg,
        bukrs LIKE bseg-bukrs,
        belnr LIKE bseg-belnr,
        dmbtr LIKE bseg-dmbtr,
      END OF st_bseg.
    DATA:
      sel_list   TYPE STANDARD TABLE OF edpline,
      li_bseg    TYPE STANDARD TABLE OF st_bseg,
      l_bseg     TYPE st_bseg.
    START-OF-SELECTION.
      APPEND 'bukrs belnr dmbtr' TO sel_list.
      SELECT (sel_list)
        FROM bseg  UP TO 100 ROWS
        INTO TABLE li_bseg.
      LOOP AT li_bseg INTO l_bseg.
        WRITE : / l_bseg-bukrs, l_bseg-belnr, l_bseg-dmbtr.
      ENDLOOP.

  • 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

  • How to call a Bex query in ABAP

    Hi,buddies:
        Any body try to run a Bex query in ABAP and then get the result in text file etc...??
    Martin Xie

    Hello,
      Call this transaction in BW : RSCRM_BAPI.
    Download Query result in file format.
    This transaction is absulote.
    I hope it helps.
    Kishore

  • 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

  • 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...

  • BEX Query to ABAP Transaction Code

    Hi,
    RRI from BEX Query to ABAP Transaction Code When I Right clivk and select GOTO on my Delivery order
    say 120012 It shd directly go into tht particular DO The transaction code is vl33n
    but when i give ABAP Transaction as reciever object it only goes to the initial screen of query where we manually need to give the DO Number It does not show the DO 120012 directly
    thx,
    amar

    Hi Amar
    Try doing Assigning Infoobject to R/3 field in Assignment details RSBBS transaction:
    Check below thread for explaination
    Re: RRI -  Selection was not Restrcited
    Ravi

  • ABAP Query and ABAP Report

    Hi,
    1.What is the difference between ABAP Query and ABAP report?
    2.What are the advantages of LSMW over BDC?
    Regards,
    Ajit

    Hi,
    Please read the rules of engagement before you post.
    Step 1: Finding An Answer
    Rule number one: Try to find the answer first. There are tons of resources out there, show that you have tried to find the answer. A question that shows that the person is willing to try and help themselves is more likely to be answered than one which simply demands information. Tell us what you have done to try and solve the problem yourself - often we can learn from that too!
    Search the forums, the articles, the blog posts and the Frequently Asked Questions (FAQ) in the Wiki for your topic.

  • 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.

  • Diff between sap query and abap query

    diff between sap query and abap query

    Hi,
    ABAP query is mostly used by functional consultants.
    SAP Query :
    Purpose
    The SAP Query application is used to create lists not already contained in the SAP standard system. It has been designed for users with little or no knowledge of the SAP programming language ABAP. SAP Query offers users a broad range of ways to define reporting programs and create different types of reports such as basic lists, statistics, and ranked lists.
    Features
    SAP Query's range of functions corresponds to the classical reporting functions available in the system. Requirements in this area such as list, statistic, or ranked list creation can be met using queries.
    All the data required by users for their lists can be selected from any SAP table created by the customer.
    To define a report, you first have to enter individual texts, such as titles, and select the fields and options which determine the report layout. Then you can edit list display in WYSIWYG mode whenever you want using drag and drop and the other toolbox functions available.
    ABAP Query,:
    As far as I Believe, is the use of select statements in the ABAP Programming. This needs a knowledge of Open SQL commands like Select,UPdtae, Modify etc. This has to be done only by someone who has a little bit of ABAP experience.
    To sum up, SAP queries are readymade programs given by SAP, which the user can use making slight modification like the slection texts, the tables from which the data is to be retrieved and the format in which the data is to be displayed.ABAP queries become imperative when there is no such SAP query existing and also when there is a lot of customizing involved to use a SAP Query directly
    use either SQ02 ans SQ01
    or SQVI tr code
    for more information please go thru this url:
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Create_The_Query.asp
    http://goldenink.com/abap/sap_query.html
    Please check this PDF document (starting page 352) perhaps it will help u.
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf
    check the below link will be helpful for u
    Tutorial on SQVI
    once you create query system generates a report starting with AQZZ/SAPQUERY/ABAGENCY2======= assing this report to tr code for the same
    regards,
    vasavi.
    reward if it is helpful.

  • 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.

Maybe you are looking for

  • Won't play 16:9

    I've just made a video that plays at 16:9 in quicktime but it comes up letterboxed and in 4;3 in iDVD. Never had this problem before but I need to fix this quick.

  • JBO-25014: Another user has changed the row with primary key...

    Hello, could you help me please with resolving this error "JBO-25014: Another user has changed the row with primary key..." - I am just getting a row from a view by bind "filter" variable, then I am assigning new values for some of the attributes - a

  • OWM and error of application

    I have the JAVA application under OracleAS9.0.3 Yesterday, when I started OWM for creation of new CSR, JAVA application issued the error 500. What could cause for such error? Should I stop the application before owm started? Thanks in advance.

  • Can I use other ink types for my printer?

    Hi! I'm currently using this HP Deskjet 2050 ALL-IN-ONE J510 Series. And suddenly, I ran out of ink. I have these inks here:  - 45 Black Noir-78 XL Tricolor- Ofiicejet 901 XL BlackAnd the rest is for HP Photosmart.My question is, can I use those 3 ty

  • Linking a numbers spreadsheet in a keynote page

    I created and saved a spreadsheet in Numbers. I copy a portion of a spreadsheet in numbers.  I then paste it on a page in Keynote.  I save the Keynote file. I then make changes in Numbers. The changes do not show in Keynote. There is no REFRESH butto