Reg. SAP Query

Hi
I have written an SAP Query for Selection Criteria.
Example Scenario:
I want to download list of sales orders in my BAPI.
The download criteria is maintained as a SAP Query, like, Order Type, Creation Date, Plant etc.
Can i invoke this query in my report program to fetch the values the user has maintained in the Query Variant?
Regards
Meera

Hi
I have written an SAP Query for Selection Criteria.
Example Scenario:
I want to download list of sales orders in my BAPI.
The download criteria is maintained as a SAP Query, like, Order Type, Creation Date, Plant etc.
Can i invoke this query in my report program to fetch the values the user has maintained in the Query Variant?
Regards
Meera

Similar Messages

  • Reg : SAP Query  in LDB

    Hello ,
    I would like to know more about how infosets are used in LDB's.
    I was recently testing a LDB of Hedge Mgmt. i selected seveal param's  and found that the order of fields in the query really makes a  diff. LDB's are very senstive to ordering ?? Can any one give me more info on how Infosets and SAP queries work ?
    Regards,
    Sri

    Hi,
    look here:
    http://help.sap.com/saphelp_47x200/helpdata/en/d2/cb4138455611d189710000e8322d00/frameset.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/d2/cb43b2455611d189710000e8322d00/frameset.htm
    A.
    Message was edited by:
            Andreas Mann

  • How to create drill down report in sap query

    how to create drill down report in sap query ,

    hi,
    The pdf below gives the steps to create drill down report.
    http://www.sappoint.com/abap/eis.pdf
    also check.
    <a href="http://72.14.203.104/search?q=cache:k-SFYy_rjPIJ:www.hrexpertonline.com/archive/Volume%252003%2520(2">http://72.14.203.104/search?q=cache:k-SFYy_rjPIJ:www.hrexpertonline.com/archive/Volume%252003%2520(2</a>
    regs,
    jaga

  • SAP Query and infoset rename

    HI
    Is it possible to rename sap query and infoset at a same time instead of changing one by one.?
    Thanks
    reg
    cns

    Dear Sathya,
    SAP does not allow you to rename SAP Query & Info set at a same time.
    Note:
    The system has to lock the following objects before you are able to use the Rename SAP Info set function:
    User group catalog
    Info Set catalog
    Query catalogs for user groups to which the Info Set that you are renaming is assigned,
    Queries using this Info Set
    Once all these locks have been set, the system can carry out the function.
    Renaming an Info Set can, however, be very time-consuming. These locks may also prevent other users from working in the system for as long as it takes to rename the Info Set.
    Thanks & Regards
    Dinu

  • Creation of SAP Query in SQ02 with Single Table With Condition

    Hi All,
    I want to Create SAP Query in SQ02 using single Table MCHA.
    ii) I dont want all entries of MCHA Table I mean , I have to apply some Condition on this Table.
    i.e  Suppose I am having actual data in MCHA table is like this for Material M1.
    Plant    Material   Batch   BatchCreationdate
    P1          M1         B1       20.06.2007
    P2          M1         B1       04.05.2009
    P3          M1         B1       04.05.2009
    But I want the Output of SAP Query is like this:
       Material   Batch   BatchCreationdate
          M1         B1       20.06.2007
    That is irrespective of Plant if Material & Batch are equal ---> 1st record with Lowest date shoud get at the output.
    Please help me How write the code on single table in the SAP Query.
    Thanks,
    Kiran Manyam

    Hi,
    Your query should be like this:
    Select MATNR CHARG HSDAT
    from MCHA
    into table t_mcha
    where matnr = Materlal number from selection screen.
    The structure of t_mcha should contain the fields that you select.
    Then sort the table by date ascending
    Sort t_mcha by HSDAT.
    Hope this solves your problem.
    Thanks,
    Sowmya

  • SAP query

    Hello ABAP Guru
    I need a help here. trying to create SAP query joining three table VBAK VBAP KONV since KONV being cluster table I am not able to do that
    thpough I am suceesfully establishe dthe link
    VBAK-VBELN=VBAP-VBELN
    VBAK-KNUMV=KONV-KNUMV & VBAP-POSNR=KONV-KPOSN
    OSS msg says we have to write routine in sap query
    but I never used that option
    anyone has any clue on how to use cluster table in SAP query?
    Thx
    Praveen

    Hi,
         Inner Join can't be  used for cluster tables.
         Write a routine in SAP query as follows.
          do inner join on vbak,vbap into internal table  
          itab.
           select for konv for all entries itab .           
    Regards
    Amole

  • How to call SAP query in a program

    Hi experts
      I have created a query in SQVI its gives a result. Now i want this query to be used in my program. Is there any FM which gets the quary name and populates the result in iternal table. So that i can use that result.
       I know without query you can write using the tables you can fetch the records but i just want to explore a new way to do things. If any body done such type let me know and also give some sample code or process how to achieve it.
    Regards
    Vijay

    Hi Siva
      My final option is that only. That you can do any how. But my intension is to learn something new way. How to do copy the query and where to inject the code is there any example in wiki or artical for that. I want to something new. Old way of creating a report program is possible i want to do this way. If some body could help me out.
    @ karthik
       I have generated the SAP query and i got the program but when i view the code i dont find any select statment or where storing my input data. How to identity that i did in debug mode but am not sure where it pulls the data and where it put in internal table. Can you throw some light with example code or an article.
    Regards
    Vijay

  • SAP QUERY report for vendor line items

    Hi
    I have created a SAP QUERY report for vendor line items with fields vendor no.,vendor name,amount,company code and period.But there is one line item i donot know from wher system is getting it picked with is not in that vedor account,when i compare with fbl1n.I checked the document number too...the same doc number is twice in my query report.One with correct amount and another with wrong one.How do i chk.Where did i go wrong in creating query.I used logical database KDF.
    Please advise.

    i chked...how do we get the amount displayed in query...it just displays amount no debit credit symbol... i have selected BSEG-DMBTR field but no -/+ sign,how is it done in query,please suggest.

  • SAP Query- Reporting on SOD

    Hello everyone,
    I need some help in creating a report in SAP Query based on user's processing Vendor Invoices and also Vendor Payments?
    I would like to have the following columns to report on:
    USNAM u2013 User Name (from BKPF)
    BLDAT u2013 Document Date (from BKPF)
    BELNR u2013 Document Number (from BKPF)
    BUKRS u2013 Company Code (from BKPF)
    BLART u2013 Document Type (from BKPF)
    LIFNR u2013 Vendor Number (from BSEG)
    NAME1 u2013 Vendor Name (from LFA1)
    WRBTR u2013 Amount (from BSEG)
    Vendor Invoice- I would like to restrict to only document type fields that are KA,KR,RC,RE,RN and ZE
    Vendor Payment- I would like to restrict to only document type fields that are ZV,ZS,ZP,ZH and KZ
    I have a few questions:
    First is i am using a logical database (BRM as BSEG cannot be joined) to select my columns however i do not know how to pull the 'Vendor Name' from LFA1. I understand that this table is not in BRM but is there a way to add any extra tables to work along side the logical database?
    Secondly, i have managed to report on all columns except the vendor name (from LFA1) and although i can restrict my output data based on document type fields, i need the report to only show the user's that have process vendor invoices & vendor payments only?
    At the moment i have a list of restricted document type but cannot seem to jsut show only those users who have processed both in both processes. For example User A has processed a vendor invoice (which is shown) and the same user may have processed vendor payment (after searching through the long output list!)
    I want all users who have doen one of the other process and only interested in those that have done both?
    Any feedback is much appreciated and pelase let me know if i have not explained this problem properly (as i am a newbie in this area)
    Many thanks
    Amar

    Hi Pascal,
    Since the IT2501 is a "Simulated Time Infotype" you cannot look at the data in it, but you can confirm the data from the ZL cluster and the data from the employee.  Since it is only this employee or a few employees, it is probably not the configuration of the time buckets for the IT2501, but you may want to make sure all time times are captured as you want.  Then look at the time entries for this individual or individuals.  Did they enter a time type that was not expected or configured?  Is all their time approved and passed through Time Evaluation?  Finally check the Master Data for the employee - is the Planned Working Time (IT0007) infotype correct or has it been recently changed?  Is he in a special Cost Center (IT0027) or Project that is captured differently for time purposes? 
    Since it just one or a few individuals, I would suspect the Master Data and some inconsistant entry that affects the time cummulation for the IT2501.
    Paul

  • How can I define Double Click Processing in SAP Query ?

    The first question is : How Can I define drill-down for SAP Query report ?
    The second one :  How can I program Double Click in SAP Query report for Different columns like ALV Grid processing ?

    you can attach a repot or at tcode etc in an SAP query using report assignment in SQ01 but as far as i remember you cannot attach multiple reports.
    regards,
    khusro habib

  • How to find the report for the SAP query (Query exists in table AQLQCAT)

    Hello Experts,
    I need to find the tables used in the SAP Query but i don't have access to transaction SQ01,SQ02 and SQ03 to check the same.
    Therefore i checked table AQLQCAT and got the SAP Queries in the system. Then searched for the reports that would have been generated for the same passing  AQusergroupquery name*  in transaction SE38.
    But unfortunately the program does not exists for the given paramenter.
    Could you please let me know how to get the report name for the SAP Query.
    Secondly please suggest any other way of checking the tables used in the SAP Query.
    Also the table name from where i can download the SAP Queries.
    Thanks in advance.
    Regards,
    Rahul Sinha

    I suggest you a simple method.
    Execute the query. When the selection screen is showed,  go to menu and click to SYSTEM->STATUS.
    Check the program name and double click it to access the program code.
    Search for tables or functions into the source code in order to understand where data are taken.
    If you do not find anything , go to the program atttribute and check for logic database, sometimes they are used....
    Best regards.

  • Error 'Unable to open file' when downloading SAP Query to Excel

    Hi all
    I'm running a SAP Query which is set to download straight to a spreadsheet (Pivot Table / Microsoft Excel).  Intermittently it does not work -  apparently at random (at least, I've can't recreate the error at will).
    It does one of the following:
    - Works ok, and creates the pivot table
    - Gives an Excel error message 'Unable to open file', then returns to the 'save the data in a spreadsheet' popup when enter is pressed on the error.
    - Does not issue error message, just goes to the 'save the data in a spreadsheet' popup.
    In the last two cases, the excel pivot table sheet is not created.
    Has anyone seen anything similar, or have any idea as to what is causing the problem?
    Any help gratefully received!
    Not urgent as I've found a way round -  further testing seems to show that I don't get the error is Excel is already open - but in the past I've run many SAP query downloads without needing to open Excel first.  I suppose it's possible that this is just something to do with the Excel setup at the user site
    Message was edited by:
            E Gregory

    Hi,
    Ensure that file name with same name and in same path should not be open while saving the data.
    Award if it helps.
    Jogdand M B

  • Sales Order Text Lines in SAP Query

    I have a requirement to output several text lines into a SAP query based around sales orders.
    I have included some code to read the details into my query and get no syntax errors, however the report gives a blank output for each of the text fields included, despite there definitely being some text with the specified attribute ID and text object in the table STXL.
    Where am I going wrong?
    Please find the coding below for one of the text field I'm trying to extract:
    TABLES:STXL.
    DATA:
        VBELN LIKE VBAP-VBELN,
        POSNR LIKE VBAP-POSNR,
        TDNAME LIKE STXL-TDNAME,
        MYLINE LIKE TLINE-TDLINE,
        ZE18_LINE(1200) TYPE C.
    DATA:BEGIN OF LINES OCCURS 0.
            INCLUDE STRUCTURE TLINE.
    DATA:END OF LINES.
    DATA:BEGIN OF MYHEADER.
            INCLUDE STRUCTURE THEAD.
    DATA:END OF MYHEADER.
    CLEAR TDNAME.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      INPUT = VBAP-VBELN
    IMPORTING
      OUTPUT = VBELN.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      INPUT = VBAP-POSNR
    IMPORTING
      OUTPUT = POSNR.
      CONCATENATE VBELN POSNR INTO TDNAME.
    CALL FUNCTION 'READ_TEXT'
        EXPORTING
            ID = 'ZAT2'
            LANGUAGE = SY-LANGU
            NAME = TDNAME
            OBJECT = 'VBBP'
         IMPORTING
            HEADER = MYHEADER
         TABLES
            LINES  = LINES
    EXCEPTIONS
            ID = 1
            LANGUAGE = 2
            NAME = 3
            NOT FOUND = 4
            OBJECT= 5
            REFERENCE_CHECK = 6
            WRONG_ACCESS_TO_ARCHIVE = 7
            OTHERS = 8.
    IF SY-SUBRC = 0.
      LOOP AT LINES.
        MOVE LINES-TDLINE TO TEXT.
        ENDLOOP.
    ENDIF.

    Hi -
    Please check in debuging.
    check the value of TDNAME correctly populated with sales order no and sales order item.
    You can cross check with the table STXH with TDNAME and see if any entries is available for TDID 'ZAT2' as your case.
    Here are sample code.
    DATA :    lv_tdname TYPE tdobname,
                     lw_line TYPE tline,
                    li_line TYPE STANDARD TABLE OF tline.
    CLEAR : lv_tdname , li_line[],
    cocatenate w_vbak-vbeln w_vbap-posnr into lv_tdname.
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
        id                      = 'ZAT2'
        language                = 'E'
        name                    = lv_tdname
        object                  = 'VBBP'
      TABLES
        lines                   = li_line
      EXCEPTIONS
        id                      = 1
        language                = 2
        name                    = 3
        not_found               = 4
        object                  = 5
        reference_check         = 6
        wrong_access_to_archive = 7
        OTHERS                  = 8.
    IF sy-subrc = 0.
      CLEAR lw_line.
      loop at li_line INTO lw_line .
    * Put your logic
      endloop.
    ENDIF.

  • Report from SAP Query due by universe

    Guys,
    I create universe based on SAP Query.
    Now I want to build BO report.
    So I connect a Universe drag to window my objects, but when I push Run Query I receive error:
    A database error ocured.
    The database error text is:
    The MDX query SELECT  { [Measures].[D4M5A7PITT7CVVVC8GMZS6QIH] }  ON COLUMNS , NON EMPTY [WLENTITY].[LEVEL01].MEMBERS ON ROWS FROM [Z_ROSDOB/REP_20081202071548]  failed to execute with the error See RFC trace file or SAP system log for more details. (WIS 10901)
    I can easily build reports based on other queries or cubes.

    Hi Roman,
    This is normally a connection issue when connecting to RDBMS rather than infocubes. a couple of questions
    Is you universe set up to pass through the authentication or is it using a specific logon?
    Does the user running the report have the appropriate responsiblities to run the query?
    Regards
    Alan

  • How to display long text in SAP Query ALV layout? It only show 129 char now

    I have a SAP Query which show a remark field(Max length more than 500 char), but it only show max length 129 char now. In fact, the lenght of remark field text is more than 300, and i had debug the source code, the field text value do is correct, its length do is 376.
    Do anybody can help me solve the issue, let the query ALV layout can show the long text field value?
    thanks very much in addvance.

    Hi,
    ALV can show only a restrict value length around 128 characters, many experts said that we can not extend. many suggestions is split text into some column.
    Regards,

Maybe you are looking for

  • Mail app does not sync "Sent" or "Read" messages with my iPhone mail app.

    I just started using a new Mac Mini (running 10.9.1). I have the Mail app connected to a handfull of different email addresses, and my iPhone mail app is connected to the same addresses. If I send a message on one device, the other device will not sh

  • How to go about changing settings based upon logged in user

    Hi all, I'm wondering if anyone has any thoughts on how one would go about changing a property on a node based upon the logged in user. For example, say you have a path property at /apps/myComponent/settings.path=/content/dam/genericfolder that for a

  • SD document clarification

    Please tell me if my understanding is correct. Please correct me. Thank you. 1. Open SO (Sales Order) are those which has no delivery order yet. to do this: use VA01 2. Open DO (Delivery Order) are those which goods are not actually delivered yet or

  • Can't get apache + php5 working right

    I was following the LAMP tutorial, but PHP doesn't seem to work. This is off of a fresh arch install. Did the following: pacman -S apache php php-apache I then add 'LoadModule php5_module modules/libphp5.so' to httpd.conf and restart the server If I

  • [Solved] I've been really clever (Locked myself out of the system)

    Hi, I've done something extremely clever: I wanted to try out suspend to disk on my MacBook. I generated an new initramfs with an uresume hook. The whole resuming thing didn't work though. Upon rebooting I get a prompt telling me that the system can'