ABAP Quries

Hi,
I have to restrict the ABAP quire based on some conditions. How to do that one. Please its urgent,
Thanks,
Bhanu Gattu

hi,
check this.
seldct_options: s_mat for mara-matnr.
select matnr mtart matkl
   from mara
        into table i_mara
               where matnr in s_mat
                 and  mtart between 'zge' to 'pre'.
like that.
rewards if it is useful

Similar Messages

  • Sd abap quries

    hello to every one , iam trying to do abap quries can any one plz send me the screanshorts , how create abap quries , my mail id :-<b><REMOVED BY MODERATOR></b>

    Hi,
    Please read the rules of engagement before posting.
    <b>- Do not ask to send you an email.</b>
    The question you ask and the solution to it is often also interesting for other users of the community. If you ask somebody to send you the answer per email, you deprive others of also learning to know the answer. Therefore any requests for sending material or answers to an email address will be modified by the forum moderators.

  • Declarations in SAP QUERY generated ABAP Programs

    hi,
    i had created a ABAP Program through ABAP Query (SQ01,SQ02,SQ03) but i have a issue that when i transport it to the PRD server i got the run time error. The Z program which i had created is the copy of the SQ01 generated program and i had done all the includes declarations in this program. but there is a problem that it is consist of the declarations of the structures,quries .
    I want to know is it necessary to always transport the Infoset and user group and the structure which is present in the program generated .
    Please provide me guidelines for this problem  .
    Edited by: ricx .s on Jul 6, 2009 5:31 AM
    Edited by: ricx .s on Jul 6, 2009 8:07 AM

    hi,
    i had copied the program bcoz i want to chekc that it is really necessary to transport the user group and infoset so that it can achieve functionality similar to the SAP QUERY.
    is there any other way without whichi can ahieve the functionality of SAP QUERY generated program and take it into the ABAP Porgram?

  • SQ01 mass generation of quries problem

    i need a sample code or FM for mass generation of SQ01 quries.bcz aftter changing in client i have to regenerate again all quries..so i want some workaround so i can perform this task in one go. any idea?

    Hi,
    i do not understand why this post is marked as "answered".
    The recommended ABAP RSAQR3TR is not usable for the requested mass generation of queries.
    (It only covers the transport aspect (export/import))
    Can you please give us a short explanation or correct the status to "not answered"
    There are two posts regarding the mass-generation of queries, but none of them contains a solution.
      SQ01 - Generate program
      Query - Mass generation
    (The first one is at least a chance and usable via CATT or SE37)
    Best regards
    Christian

  • Wrong info in ABAP Cert material:  BC400 Intro to the ABAP -mySAP Tech

    Hi
    As i was looking into the certification material BC400 Course Version: 2003 Q2, Material Number: 50061840 the information put-up @ Pg num 224 on selection-option is incorrect:
    Conditions in an internal table that
    has been declared using SELECT-OPTIONS are interpreted as follows:
    • If the internal table selname is empty, the condition field IN
    selname is always true.
    • If the internal table contains only inclusive elementary conditions,
    such as i_1, ... i_n, the result is the composite condition ( i_1 OR
    ... OR i_n )
    • If the internal table contains only inclusive elementary conditions,
    such as i_1, ... i_n, the result is the composite condition ( NOT e_1
    ) AND ... AND ( NOT e_m ).
    • If the internal table contains only inclusive elementary conditions,
    such as i_1, ... i_n, the result is the composite condition ( i_1 OR
    ... OR i_n ) AND ( NOT e_1 ) AND ... AND ( NOT e_m
    rather it shud be
    Conditions in an internal table that
    has been declared using SELECT-OPTIONS are interpreted as follows:
    • If the internal table selname is empty, the condition field IN
    selname is always true.
    • If the internal table contains only inclusive elementary conditions,
    such as i_1, ... i_n, the result is the composite condition ( i_1 OR
    ... OR i_n )
    • If the internal table contains only exclusive elementary conditions,
    such as i_1, ... i_n, the result is the composite condition ( NOT e_1
    ) AND ... AND ( NOT e_m ).
    • If the internal table contains both inclusive and exclusive elementary conditions,
    such as i_1, ... i_n, the result is the composite condition ( i_1 OR
    ... OR i_n ) AND ( NOT e_1 ) AND ... AND ( NOT e_m
    PS: I'd already opened a thread in ABAP forum.
    thkx
    P.S

    Hi
    SAP Course fee for all certification is same all over india -
    Rs 27,550 only [incase you go for TECHED/ through ur company].. otherwise, it's more
    Refer to follwing links -
    http://www.sap-img.com/ab040.htm
    http://www.sap-img.com/ab041.htm
    http://www.sapprofessionals.org/files/ABAP%20CERTIFICATION%20QUESTIONS.doc
    http://help.sap.com/printdocu/core/Print46c/en/Data/htm/english.htm
    http://help.sap.com/printdocu/core/Print46c/en/Data/Index_en.htm
    http://www.sapdomain.com
    <u><b>Contact SAP Bangalore / SAP TecHED</b></u>
    Website : http://www.sapteched.com/india/
    For registration :http://www.sapteched.com/india/confactivities/certexam.htm
    For quries : [email protected]
    www.sap.com
    Please reward suitable points, incase you get any help.
    regards
    Atul

  • About Abap Query..

    hi all,
    I have added few fields in the existing info-set and mapped these new fields in the respective quries...and added code for each field.......it is working fine...
    But, before executing/testing a message window is displaying saying that " query not current" -- "Difference between query and inforset"....
    what I have to do more ..so that this message window doesn't come..
    Thanks in advance,
    Best wishes,
    Bhaskar.

    Hi
    Have you changed the Infoset in the correct Query only
    One more thing is that these queries are User specific
    So you should also in the same user group to change it
    there should be some mismatch between the query and the infoset you changed
    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
    Reward points for useful Answers
    Regards
    Anji

  • Handling High Number Records in ABAP Table

    Hi,
    Other than creating indexes is there other option to handle in an efficient way searches in an ABAP table containing more than 30 million records?
    Thanks in advance.

    Hi Ruben,
    for me indexing would be the way to go: It totally depends on your access pattern. If you often read by a primary key and have no big volume queries around it would be ok.
    mentioned physical Partitioning is a good option IF you can find a meaningful partition key that more or less evenly spreads the data over the partitions (i.e.  12 FISCPER that divides the 30 Mio. into partitions of 2- 3 Mio records) and that this key is used by all the quries you would start on that table. The index would be equi-partitioned. You have your DBA involved for this option; SE14 supports the physical partitioning of a table.
    the other options mentioned (OPEN CURSOR...) are not much of help if you have to do number crunching;
    (however, to write good SQL is the key to good performance so avoid the common pitfalls mentioned there).
    You may consider a reliable archiving strategy that keeps your table on a certain row level while you move the "old" data in a kind of history table from time to time. If you need all data you would UNION  both tables.
    you can hint an SQL with a PARALLEL clause to speed up the processing (i.e. you retrieve all or a big amount of the 30 Mio rows)
    bye
    yk

  • ABAP Query Need to Convert ABAP Report

    Dear All,
    We have 3 queries which are linked to service management, now, user wants to consolidated one ABAP report with feilds of 3 queries, which consist of total 100 feilds. he want provision of downloading each single query (in ABAP report).
    Is ther anyway whee we can pass all the 3 quries values in internal tables and pass to ABAP report?? is there any better way so that we will reduce the writing of big logic for 100 feilds??
    Thanks in advance.
    Regards
    Ramki

    Hi ,
    you can do this way..
    for every query there is a
    *     Validating Variant name for Query Name
          CONCATENATE '%' <query group> '%' <Query name > '%' INTO w_rname.
          SELECT SINGLE * FROM varid WHERE report LIKE w_rname
                                     AND   variant EQ p_variant.
          IF sy-subrc NE 0.
         ENDIF.
    *   Submit report in background and creating spool
      SUBMIT (w_rname) USING SELECTION-SET p_variant
          TO SAP-SPOOL WITHOUT SPOOL DYNPRO
          SPOOL PARAMETERS wa_pri_params AND RETURN.
      COMMIT WORK AND WAIT.
    "create spool like above for three query and and capture in Spool and format the three spools
    "into one internal table and form one report.
    Prabhudas

  • Issue in Creation of XML file from ABAP data

    Hi,
    I need to create a XML file, but am not facing some issues in creation of XML file, the in the required format.
    The required format is
    -<Header1 1st field= u201CValueu201D 2nd field= u201CValueu201D>
       - <Header2 1st field= u201CValueu201D 2nd field= u201CValueu201Du2026u2026. Upto 10 fields>
              <Header3 1st field= u201CValueu201D 2nd field= u201CValueu201Du2026u2026. Upto 6 fields/>
              <Header4  1st field= u201CValueu201D 2nd field= u201CValueu201Du2026u2026. Upto 4 fields/.>
               <Header5 1st field= u201CValueu201D 2nd field= u201CValueu201Du2026u2026. Upto 6 fields/>
          </Header2>
       </Header1>
    Iu2019m using the call transformation to convert ABAP data to XML file.
    So please anybody can help how to define XML structure in transaction XSLT_TOOL.
    And one more thing, here I need to put the condition to display the Header 3, Header 4, Header 5 values. If there is no record for a particular line item in header 3, 4 & 5, I donu2019t want to display full line items; this is only for Header 3, 4 & 5.
    Please help me in this to get it resolved.

    Hello,
    you can use CALL TRANSFORMATION id, which will create a exact "print" of the ABAP data into the XML.
    If you need to change the structure of XML, you can alter your ABAP structure to match the requirements.
    Of course you can create your own XSLT but that is not that easy to describe and nobody will do that for you around here. If you would like to start with XSLT, you´d better start the search.
    Regards Otto

  • Logical command in ABAP.....Urgent

    Hi,
      i am pretty new using ABAP program so i neeed help urgently. i am trying to move a file on the application server from one directory to the other and i was using the open dataset function to do that. but the file i am trying to move is pretty big and because i am using internal table to store, it is causing problems with the space.
      i have consulted the basis guys and they have managed to create a logical file for copying from one directory to the other on the application server. to help you furthter. i am enclosing the mail sent to me.
    I have created a logical command which should copy the file from one location to the other but you need to pass it the source dir and file name and the destination dir and file name.
    The logical command is ZCOPY and uses cmd /c copy
    Copies one or more files to another location.
    COPY [/V] [/N] [/Y | /-Y] [/Z] [/A | /B ] source [/A | /B]
         [+ source [/A | /B] [+ ...]] [destination [/A | /B]]
      source       Specifies the file or files to be copied.
      /A           Indicates an ASCII text file.
      /B           Indicates a binary file.
      destination  Specifies the directory and/or filename for the new file(s).
      /V           Verifies that new files are written correctly.
      /N           Uses short filename, if available, when copying a file with a
                   non-8dot3 name.
      /Y           Suppresses prompting to confirm you want to overwrite an
                   existing destination file.
      /-Y          Causes prompting to confirm you want to overwrite an
                   existing destination file.
      /Z           Copies networked files in restartable mode.
    The switch /Y may be preset in the COPYCMD environment variable.
    This may be overridden with /-Y on the command line.  Default is
    to prompt on overwrites unless COPY command is being executed from
    within a batch script.
    the problem now is i have no idea about how to use the logical command. can any one help me.
    Thank you,
    Ravi.

    If memory is not an issue, then there should be no reason why this should not work.
    report zrich_0001.
    parameters: d1 type localfile default '/usr/sap/TST/SYS/Data1.txt',
                d2 type localfile default '/usr/sap/TST/SYS/Data2.txt'.
    data: itab type table of string with header line.
    start-of-selection.
    * Read old file
      open dataset d1 for input in text mode.
      if sy-subrc = 0.
        do.
          read dataset d1 into itab.
          if sy-subrc <> 0.
            exit.
          endif.
          append itab.
        enddo.
      endif.
      close dataset d1.
    * Write to new file
      open dataset d2 for output in text mode.
      loop at itab.
        transfer itab to d2.
      endloop.
      close dataset d2.
    * Delete the old file
      delete dataset d1.
    Regards,
    Rich Heilman

  • Logical Database in Abap Objects

    Hi to All
    I want do it a program report using a Logical Database.
    Is this possible ??? But when I make a GET <node>, occurs the following error:
             "" Statement "ENDMETHOD" missing.  ""
    I'm doing the following:
    CLASS MONFIN IMPLEMENTATION.
           METHOD TRAER_DATOS.
                   GET VBRK.
           ENDMETHOD.
    ENDCLASS.
    Please, somebody tell me how I use the logical database in Abap Objects.
    Thank you very much
    Regards
    Dario R.

    Hi there
    Logical databases whilst of "some use" are not really part of OO.
    If you want to use a logical database in an abap OO program I would create a special class which just does the get data from your DB and pass this either at record or table level.
    Techniques such as GET XXXX LATE aren't really part of any OO type of application since at Object Instantiation time you should be able to access ALL the attributes of that object.
    As far as OO is concerned Logical databases are a throwback to "Dinosaur Technology".
    Since however modules such as SD and FI are still heavily reliant on relational structures (i.e linked tables etc)  then there is still some limited life in this stuff but for OO try and solve it by another method.
    If you really must use this stuff in OO then do it via a FMOD call and save the data in a table which your method will pass back to your application program.
    You can't issue a GET command directly in a method.
    Cheers
    Jimbo

  • LOGICAL DATABASE IN HR ABAP PRPGRAMMING

    Hi Friends,
    what is use of LOGICAL DATABASE IN HR ABAP PROGRAMMING
    AND END-OF-SELECTION EVENT IN HR PROGRAMMING PROGRAMMING???
    regards,
    vijay.

    hi
    HR Logical Databases
    In Human Resources (HR), the following logical databases can be used as a data source for HR InfoSets:
    PNP (PNPCE)
    PAP
    PCH
    By selecting a logical database, you determine the HR data that can be reported on using an InfoSet.
    Logical Database PCH
    This logical database generally enables you to report on all HR infotypes. However, you are advised not to use this logical database unless you want to report on Personnel Planning data.
    Logical Database PNP (or PNPCE)
    Use logical database PNP to report on HR master data. It is possible to use logical database PCH to access this data, but PNP meets such reporting requirements more quickly because it is best suited to the task of selecting persons.
    Logical database PNP enables you to access HR master data and infotypes from Personnel Planning. For example, you have the following options:
    Reporting on the costs, number of attendees booked, and instructor for a business event on which an employee is booked
    Reporting on working time and planned compensation for a position that an employee occupies
    Reporting on the validity and proficiency of a qualification that an employee fulfils
    From a technical perspective, this means you can use PNP to report on all of the infotypes that exist for objects (infotype 1000) that have a direct relationship (infotype 1001) with the Person object.
    The ability to access infotypes from Personnel Planning using logical database PNP is a special feature that you can only use in the context of SAP Query and Ad Hoc Query. You cannot use this functionality for ABAP reports you programmed yourself.
    You can also use logical database PNP to report on data from Personnel Time Management (infotypes 2000 to 2999) and Payroll (special payroll infotypes for the USA and customer infotypes; for more information, access Customizing for the Human Resources Information System and see Payroll Results).
    Logical Database PAP
    Logical database PAP enables you to access data from Recruitment.
    regards
    navjot
    reward if helpfull

  • FileName in ABAP XSLT Mapping

    Dear SDN,
    In an integration scenario we are using sender File Adapter and a  ABAP XSLT Mapping.
    Is there any way to get the source FileName from such mapping.  Im trying to use the adapter-specific message attributes, but it doesn't work, and I didn´t find an example, probably I and doing somthing wrong.
    regards,
    GP

    Thank you for your help,
    I just try to access the adapter-specific attibutes using:
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
    <xsl:variable name="filename"  select="key:create('http://sap.com/xi/XI/System/File', 'Directory')" />
    </xsl:stylesheet>
    but the following error raised:
    <SAP:Stack>Error while calling mapping program YXSLT_TEST (type Abap-XSLT, kernel error ID CX_XSLT_RUNTIME_ERROR) Call of unknown function</SAP:Stack>
    have you had this situation?

  • ABAP-- diff between sy-sy-tabix and sy-index

    Hi Guru's,
    Pleae can anybody expalins me what is the difference between sy-tabix and sy-index(Loop Index) ?
    Because in one case i am Modifyimg the internal table inside the do loop by giving sy-index ((Index of Internal Tables)(MODIFY scarr_tab INDEX sy-index FROM scarr_wa TRANSPORTING currcode. )  in the syntax and in other case inside loop statement i am modifyng same record by giving sy-tabix MODIFY scarr_tab INDEX  sy-tabix FROM scarr_wa TRANSPORTING currcode.) in the syntax.
    in both cases its working fine but i am not getting which one i have to use  where to modify the internal table?
    regards
    SATYA

    Hi Henry,
    SY-INDEX is the value of the current iteration. It is applicable for the following programming constructs in ABAP -
    DO...ENDDO.
    WHILE...ENDWHILE.
    SY-TABIX (TABle IndeX) is applicable to internal tables. If you scroll down in the link which Eddie has given, you will find a more detailed explanation for sy-tabix and which statements affect its value.
    Regards,
    Anand Mandalika.

  • Comas(,) are not getting displayed in the output while using OO ABAP

    Hi All,
    I am using ABAP objects to display the ALV report in which there is a requirement to output Quantity fields. The Quantity fields are getting displayed without comas ','. Please help me in getting back the comas in the output.
    Eg:
    Below logic is used in my program.
    Class name: cl_salv_form_layout_grid
    Code:
      obj_footer->create_text(
            row    = v_row_cnt
            column = v_col_cnt
            text   = Quantity).
    Expected output:
    39,545.000
    Current Output:
    39545.000
    Thanks in advance for your help.
    Thanks & Regards,
    Siva.

    Hi,
    Please check if the images are in the server and in the /images alias path.
    thanks,
    Sharmila

Maybe you are looking for