ABAP Query(HR)

I am using ABAP query using LDB. I want to fetch the record(current) within a particular dates for the corresponding pernr.
But when i gives validity dates it fetches all the record for the particular pernr.
Actually our requirement is to display only current status record for particular date periods.
Plz help.Its urgent.

Hi
use the following code
GET PERNR.
<b>rp_provide_from_last p0001 space pnpbegda pnpendda.</b>
this will fetch the only last record for that PERNR.
use this and see
<b>Reward points for useful Answers</b>
Regards
Anji

Similar Messages

  • How to create an ABAP Query with OR logical expression in the select-where

    Hi,
    In trying to create an ABAP query with parameters. So it will select data where fields are equal to the parameters entered. The default logical expression is SELECT.. WHERE... AND.. However I want to have an OR logical expression instead of AND.. how can I attain this??
    Please help me on this.. Points will be rewarded.
    Thanks a lot.
    Regards,
    Question Man

    Hi Bhupal, Shanthi, and Saipriya,
    Thanks for your replies. But that didn't answer my question.
    Bhupal,
    You cannot just replace AND with OR in an ABAP QUERY. ABAP QUERY is a self generated SAP code. You'll just declare the tables, input parameters and output fields to be displayed and it will create a SAP standard code. If you'll try to change the code and replace the AND with OR in the SAP standard code, the system will require you to enter access key/object key for that particular query.
    Shanthi,
    Yes, that is exactly what need to have. I need to retireve DATA whenever one of the conditions was satisfied.
    Saipriya,
    Like what I have said, this is a standard SAP code so we can't do your suggestion.
    I have already tried to insert a code in the ABAP query (there's a part there wherein you can have extra code) but that didn't work. Can anybody help me on this.
    Thanks a lot.
    Points will be rewarded.
    Regards,
    Question Man

  • Logical database of ABAP query

    Hi,
    Can anybody please let me know what is the Logical database for ETXDCI, ETXDCH & ETXDCJ (Tax tables) with any sales document tables? I need to develop one ABAP query for the users.
    I am a Functional person so I would like to know Can anybody please let me know how I can find out the Logical database?
    Your time and help will be really appreciate.
    Thanks & Regards,
    Niki Shah.

    Try the BRF logical database.
    I found it by searching in which programs the tables were used.
    It show program SAPDBBRF which is the program for logical database BRF.
    Kind regards,
    Arthur Parisius

  • Pnp- logical db in abap query

    hi.
    i need to create an ABAP/sap query. when i created the InfoSet i used logical db-pnp.
    if i want to get only the employees which entered my organization during the last month where should i add the ABAP code,  under which section => extras -> code. i have there several options - data, initialization, at selection-screen output etc, what to choose??????????
    thanks,
    Ami

    Hi
    Welcome to SDN forum
    query has got some limitatins compared to Reports which we write using SE38
    these queries are user specific and client specific and can't be transportable and you can't write your own code as you wish like reports
    see the doc
    http://help.sap.com/saphelp_46c/helpdata/en/35/26b413afab52b9e10000009b38f974/content.htm
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Introduction.asp
    Step-by-step guide for creating ABAP query
    http://www.sappoint.com/abap/ab4query.pdf
    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
    Anji

  • Wrong sequence in selection screen generated by ABAP Query

    Hi,
    I am developing a query to display the data in the view.
    My query has 8 selection fields totally.
    As part of my requirement I have added selection parameter in the
    selections tab of the infoset and maintained the sequence as 9.
    Inspite of maintaining the sequence number as 9 in the infoset, It is
    appearing first in the selection screen of the query.
    I tried putting different numbers in the sequence number, but even it
    is appearing first in the selection screen.
    Can you please let me know how to display the selections declared in
    the infoset as per the sequence required.
    Thanks,
    Madhuri.

    Actually what happen when you declare your own fields in ABAP query . you have to care about the sequence . As an example if you’re selecting lets say state name , you have two variables
    <b>1-state
    2- land</b>
    for state you have to select land first , if your state is first and land is 2nd it gave you the error of sequence .
    Because you have to get data in land first in order to get state specific to the land .
    it should be
    1-Land
    2-State
    Just see the your fields , I’m sure you’re missing that .
    <b>You can also see the NO ( field ) in Query ( Sq03 ) . where you can define the seqence on selection.</b>
    hope this’ll help you .
    Pl...Award the points .
    Thanks
    Saquib<b></b>
    Message was edited by: Saquib Khan

  • Performance tuning for ABAP Query (created from t-cd SQ01)

    Hello all,
    We created ABAP Query report from transaction SQ01.
    But the generated report has an appropriate SQL statement which causes performance problem.
    To solve this issue, I guess the easiest way is;
    0. Give up to use it.
    1. Copy it to another object in the customer namespace.
    2. Ajust SQL statement.
    But I'm wondering if there're appropriate ways to adjust SQL statement of Query.
    Could anybody give me any better idea?
    Thank you
    Yuko

    You can try this: Create 2 ranges, for objnr and cdtcode and fill like:
    ra_objnr-sign = 'I'.
    ra_objnr-option = 'CP'.
    ra_objnr-low = 'OR*'.
    append ra_objnr.
    ra_code-sign = 'I'.
    ra_code-option = 'CP'.
    ra_code-low = 'CO*'.
    append ra_code.
    SELECT objnr udate utime
    FROM jcds
    INTO TABLE it_jcds
    WHERE objnr IN ra_objnr
    AND stat = l_tj02t
    AND cdtcode IN ra_code
    AND inact = space
    Regards,
    John.

  • How to hide some fields in ABAP Query

    Hi,
    My ABAP Query has a long list of extracted fields. I wanted to set some of these output to "HIDE".
    This allow User the flexibility to decide what fields to show.
    How can I set the field to "HIDE" in my query?
    Thanks
    bye

    Hi Tim,
    You can do this by setting the Report layout variant in following steps:
    1. First define the parameter on selection screent for report variant.
    2. Data decelaration for variant.
    3. Value request to get already present variants on report:
    4. If doesn't choose the layout take out the default report layout.
    5. Initialize the report variant.
    6. Apply the variant to the REUSE_ALV_GRID_DISPLAY funtion module.
             Here to generate report variant first to open report output and then as per according to user set the layout of report using the layout icon of ALV with summation on value fields (as required) and create layout name.
    *Data Deceleration as below:
    Data :g_save(1) TYPE c,
    **      g_default(1) TYPE c,
    g_exit(1) TYPE c,
    gx_variant TYPE disvariant,
    g_variant TYPE disvariant.
    *First Define the parameter to give layout of Report variant.
    SELECTION-SCREEN BEGIN OF BLOCK 3 WITH FRAME TITLE text-003.
    PARAMETERS: p_vari TYPE disvariant-variant.
    SELECTION-SCREEN END OF BLOCK 3.
    * Process on value request
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
    PERFORM f4_for_variant.
    * Selection-Screen Checking
    AT SELECTION-SCREEN.
    PERFORM pai_of_selection_screen.
    INITIALIZATION.
    w_repid = sy-repid.
    PERFORM variant_init.
    * Get default variant
    gx_variant = g_variant.
    CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
    EXPORTING
    i_save     = g_save
    CHANGING
    cs_variant = gx_variant
    EXCEPTIONS
    not_found  = 2.
    IF sy-subrc = 0.
    p_vari = gx_variant-variant.
    ENDIF.
    FORM f4_for_variant .
    CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
    EXPORTING
    is_variant = g_variant
    i_save     = g_save
    IMPORTING
    e_exit     = g_exit
    es_variant = gx_variant
    EXCEPTIONS
    not_found  = 2.
    IF sy-subrc = 2.
    MESSAGE ID sy-msgid TYPE 'S'      NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    **  ELSE.
    **    IF g_exit = space.
    **    ENDIF.
    ENDIF.
    ENDFORM.                    " f4_for_variant
    FORM pai_of_selection_screen .
    IF NOT p_vari IS INITIAL.
    MOVE g_variant TO gx_variant.
    MOVE p_vari TO gx_variant-variant.
    CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
    EXPORTING
    i_save     = g_save
    CHANGING
    cs_variant = gx_variant.
    g_variant = gx_variant.
    ELSE.
    PERFORM variant_init.
    ENDIF.
    ENDFORM.                    " pai_of_selection_screen
    FORM variant_init .
    CLEAR g_variant.
    g_variant-report = w_repid.
    ENDFORM.                    " variant_init
    **While Showing report pass the variant :::
    g_save = 'A'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = w_repid
    i_structure_name   = 'IT_MAIN'
    is_layout          = i_layout
    is_print           = i_print
    it_fieldcat        = i_fieldcat[]
    it_events          = i_events[]
    i_save             = g_save
    is_variant         = g_variant
    TABLES
    t_outtab           = it_main
    EXCEPTIONS
    program_error      = 1
    OTHERS             = 2.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Many Thanks / Himanshu Gupta

  • A few Questions on ABAP Query

    Hi Guru's
    I would like to ask some questions on ABAP query.
    1. Can you transport abab queries? Should it only be Global or you can also transport Standard Areas?
    2. Once transported, am i able to change query?
    Thanks,
    Jograd

    hi....
    you can transport a quary but for that the quary should be an object itself or attached to some object
    and
    if once transported to production....you cannot change it there and for changing you have to get it in developement sysytem and then make any change.
    regards

  • How to set default value in select option for ABAP query

    Hi experts,
    What is the way to set up default values for select-options in ABAP query.
    e.g.
    I have one field 'Year' in my ABAP query selection screen.
    I want value of current year to be appeared here whenever user execute report
    Thanks in Advance
    -Harkamal

    Hi Harkamal,
    execute your Query via SQ01. On Selection-Screen
    goto save Variant. Mark your field
    as selection variable an press Button election variable.
    Take variable from TVARV and use it.
    Than save the Variant.
    Look at TVARV if the 'Year' is updated to the actualYear!
    regards, Dieter

  • Short Dump While selecting Variant for ABAP query

    Hi,
    ABAP query is going to short dump (CONNE_IMPORT_WRONG_COMP_LENG) while selecting a Variant. If i create and use variant then i am able to see Output of Variant.But not able to use Earlier created variants .
    I think some mismatch between variant values and selection screen fields.Can anyone tell me how to rectify this ?
    I am not able to debug the code as dump is coming in a System program(RSDBSPVD).Can anyone tell me which database table i can use to get values of the Variant.
    Thanks in Advance.
    Nirmala K

    Hi nirmala,
    chk the links:
    http://help.sap.com/saphelp_webas620/helpdata/en/c0/980398e58611d194cc00a0c94260a5/content.htm
    http://help.sap.com/saphelp_webas620/helpdata/en/c0/9803a7e58611d194cc00a0c94260a5/content.htm
    regards,
    keerthi.

  • Getting error while assigning ABAP Query to Tr.Code

    Hi Guys,
    There is a problem iam facing with ABAP query while transporting which need to solved asap. It will very greatfull if u guys can resolve this problem.
    My problem is, I created one ABAP Query with Name ASSETOVERVIEW. I had transported this even, now when iam going to assign it to one transaction code with se93 lets say ZAOR. I need to give its description and program name in se93 right. now my question is what is program name i need to give in se93. Bcoz in SQ01 where i created the query, there is no name as 'program name' rather there is 'Name' in that we will create the query name i.e, ASSETOVERVIEW. In se93 u give tr.code and when u see down there will be radiobuttons in 'start object',in that i had checked program and selection screen (report transaction) is this right button i had checked or any other i need to check?. I had assigned this name i.e,ASSETOVERVIEW and development class and then when i check the name for syntax check its giving "'ASSETOVERVIEW' does not exist". I don't understand what program name i need to give.
    If u guys can help me out with this problem it will be very much appreciable and definetly can get the reward points.
    Thanks for as usual help in advance.
    Regards.

    Hi omer,
    1. Just run the query.
    2. one selection screen will come
    3. then using SYSTEM---->STATUS, (from menu)
       look for the program name
    4. the program name will be something wired foramt.
    /asdfasdf/asdfdas etc.
    5. Give that name in se93.
    regards,
    amit m.

  • Abap Query - Creation of Report

    Hi guys,
    I do have a question to ABAP Query:
    I want to create a report that shows me all current active employees and all of their corresponding positions from Infotype 1.
    I have got it to the part where the report gives me all employees (active and withdrawn).
    The question is:
    How can I show only active employees as of todays date?
    Thanks,
    Sascha

    Thanks for your reply,
    but if I enter date 31.12.9999 and status of active. it gives me for some the latest record and for some two - though I could not find out why?!
    I should say, I am using logical database PNP for this query
    null

  • Creation of local field in ABAP Query

    Hi
    Please let me know how to create a local field in ABAP query. I am finding the option inactive in SQ01.
    Regards
    Priyadarshini

    hi priya,
         *__Adding u201CLocal Fieldu201D (user defined field) in SAP Query_ :
    There is also facility to add the user defined fields in SAP query output. Also we can provide calculation formula for calculating values for this user defined field.
    Calculation formula consists of standard fields from standard SAP tables. So the values fetched for particular standard SAP fields from standard SAP tables get calculated as per the calculation formula defined for the user defined field and displays the value accordingly.
    To do this first go to change mode for Query which automatically takes you to screen shown below and click on icon   , as below :
    Then further screen will appears. So select the Field group and again click on the same icon button   .
    Then switch on the Short names for the fields and give the short names to fields which we need to use in Calculation formula.
    Give the short names and then created u201CLocal Fieldu201D, as shown in below screen shot. Also Short names are given to fields, which can be used further for calculation.
    Defining Local Field u201CREM_QTYu201D along with its field type and Calculation formula.
      In this case we have 
      defined field type for new  
      field as similar to
      ORD_QTY and
      Calculation formula is  
      defined.
    Also its possible to have Conditional logic for Local field by putting Condition in u201CConditionu201D line.
    Now activate this newly added Local field for coming it in output screen. To do the same again go to u201CBasic Listu201D and activate the Local Field as shown below :
    i think this will help u
    regards,
    sindhu.

  • Creation of ABAP query

    Dear All,
    This may be a technical question.  I am trying to create the ABAP query by using 2 tables.  Went to SQ02, entered the  description of Infoset and given the first table name in the "Table join in the basis table" row.  When i entered to type the second table name, the program is getting terminated. (If I want to create a query by using one table, then the system accepts)
    If possible, can anybody explain me what could be the proble,?
    Regards
    Manivannan R

    You can post u r req in Expert Forums  » Application Server  » SAP GUI forum
    7.10 is now released, you can get it at
    ftp://ftp.sap.com/pub/sapgui/win/710/compilation1/
    and on
    ftp://ftp.sap.com/pub/sapgui/win/710/patches
    there are the newest patches available.
    http://iris.tennessee.edu/sapgui_vista.htm
    Message was edited by:
            SHESAGIRI.G

  • ABAP Query - Sorting Issue in Basic List (SQ03)

    Hi,
        I have developed a ABAP Query. I want to sort some of the fields, for which I need to add some output fields to the sort sequence box in the Basic List page in SQ03/SQ01. But, I am not able to drag and drop the fields directly. Please suggest how can this be done? Thanks in advance.
    Best Regards,
    Tejas Savla

    Hi Abhishek,
    There are three things related to Query.
    1) You have to create the USER GROUP in SQ03.
    2) You have to create the Infoset in SQ02. In this infoset you can write the logic of the program/Query what ever you want to perform.So you can sort the table in the infoset in the program logic.you have to create the output table of the query.
    3) you have to create the Query in SQ01 and you have to associate the User group and infoset . you have to design the layput of the output you want to have.this output fields would be same as you have defined in infoset(step 2).
    hope this will help you.
    thanks
    Tanmaya

  • Issue in ABAP query

    Hi
      I have a doubt regarding ABAP queries . I need to pass the output of an ABAP query to another program . For this i want to know if the output of an ABAP query is stored in some kind of internal table or some other logic is used in that .
    Is it possible to send the ABAP query output to a memory structure.
    Helpful answers will be suitably rewarded.
    Thanks.

    Hi,
    program 1:
    from select query get the output to internal table
    so that with export and import u can attain this
    EXPORT t_sflight1 TO MEMORY ID 'SFLI'.
    SUBMIT pgm2 AND RETURN.
    program2:
    IMPORT t_sflight1 FROM MEMORY ID 'SFLI'.
    LOOP AT t_sflight1 INTO fs_string1.
    where in use the same internal table in both reports
    Reward Points If helpful.
    Regards,
    priya.

Maybe you are looking for

  • OnChange="submit();" in flash form

    Hi, I am using a form to sort a query on my page, however I am updating all of my forms to flash now, and can't seem to get the onChange="submit();" to work on a cfselect tag. It doesn't throw an error, th epage just doesn't load. Is this an acceptab

  • Windows 7  pdf generation

    Has anyone out there created .pdf files using Windows 7 and would like to share their experience. I ask because several of the online printers are specifically not accepting .pdf files output from Pages, but are accepting PC files. Things to check fo

  • Does my time capsule HAVE to join my existing wireless network please?

    ok i am trying to get my TC to join my wireless network but its not having it!! (it was but now i cant seem to get it to work) so my question is....can i just have its as its own separate wireless network just to talk with my macbook & imac so they c

  • My macbook pro will not let me stay on a certain desktop.

    I created multiple desktops and was able to put my open application into different desktops. For example, I had Safari open on one desktop and powerpoint on the second. However, when I switched over from my first desktop to the second it switch back

  • Disk Utility hangs while initializing internal hard disk in Core Duo iMac

    I have a 20" Core Duo iMac. Recently the internal hard drive crashed ("invalid B-tree node size" or something reported when Disk Utility tries and fails to repair it). I have all my data on an external hard disk used as a Time Machine volume, so reco