ABAP Query (SQ01) Challenge

I asked this question last time as well but with no positive/helpful answer. I need to develop a query ( SQ01) in which the user just wants to see when was the most recent posting done in the given G/L account. If i pull posting date it will give me all the dates in  chronical order or so which i dont really want.
Lets get your gray/sap matter working
THanks

sameer
if you know how to create query.
code is
Select requred data from BSIS into internal table (I_BSIS).
Sort I_BSIS by key field date desending.
when you sort this you will get the latest record in first by date.
take that date in one temp field.
LOOP AT I_BSIS.
   AT END OF key field
  SUM amount .
move both date and sum amount to final internal table.
ENDLOOP.
At last take final internal table and use  in below FM
WS_EXCEL.
you will get output.
Pls. reward if helpful

Similar Messages

  • ABAp query SQ01

    Hi guys,
    I want to make a ABAP Query via SQ01on SAP ECC.
    First i had created an infoset, that only based on one table.
    My requirement is to fetch alle data from this table grouped by customer number.
    Using an sql statement is this very easy to do, but in i had trouble making this in SAP (SQ01):
    SELECT CUST_ID, COUNT(ORDERID)
    FROM
    TABLE
    WHRE CONDITIONS
    GROUP by CUST_ID
    HAVING COUNT(ORDERID) > 1
    My question is where to put my requirement in order to get result using standard ABAP query SQ01.
    I will really appreciate your help.
    nabil

    Hi,
    Welcome to SDN.
    This is not possible exactly with ABAP Query but can be easily done by ADHOC query. Using Set operation A-B.
    Check the links for ADHOC Query -
    <a href="http://www.sap.cmich.edu/fihr/hr/adhoc-query.doc">http://www.sap.cmich.edu/fihr/hr/adhoc-query.doc</a>
    Regards,
    Amit
    Reward all helpful replies.

  • User restrictions in a ABAP Query (sq01)

    Hello,
    I'm new into queries so I have a question for you gurus...
    I have a working abap query, created via SQ01 but this is showing all the data to all the users who have rights to call this transaction.
    BUT
    for example
    user A works for plant X
    user B works for plant Y
    if user A calls the query, he should only see the data from plant X
    if user B calls the query, he should only see the data from plant Y
    Can you guys please help me out to get this thing working...
    Since i'm new in SAP I don't know alot about restrictions etc
    so please help me out with a newbie-answer
    (please describe évery step that i should do so the users only get their local data)
    thank you very much for your help!

    We're looking into restrictions on SQ01 too.  We thought that creating protected variants would solve our issue; but, we can't prevent a user from copying or creating their own variant.  When the user can create his or her own variant, then all the protection we built into our admin team's variants are gone.

  • Interactivity in ABAP Query [SQ01]. Working on ABAP 4.6C version.

    Hi,
    I have created a Infoset[SQ02]( basically selecting data from VBAK and VBAP for Sales Order) and assigned this infoset to user group[SQ03]. Using this i have created a Query [SQ01].
    In the output i have the "<b>SALES ORDER NUMBER</b>".
    Once the sales order number is double-clicked on i have to display the VA03 transaction with the sales order number in it.
    My doubt is, how is this interactivity acheived. I am working on ABAP 4.6C.
    Thanks in Advance for your esteemed replies.
    Regards,
    Raghavendra Goutham P.

    AT LINE-SELECTION.
    case sy-cucol.
    when 16 OR 17 . "Col No
    DATA: BDCDATA TYPE TABLE OF BDCDATA.
    DATA: ITAB TYPE TABLE OF BDCMSGCOLL.
    DATA: PROGRAM LIKE SY-REPID,
          WA_BDCDATA TYPE BDCDATA.
    WA_BDCDATA-PROGRAM  = 'SAPMV45A'.
    WA_BDCDATA-DYNPRO   = '0102'.
    WA_BDCDATA-DYNBEGIN = 'X'.
    WA_BDCDATA-FNAM     = 'VBAK-VBELN'.
    WA_BDCDATA-FVAL     = IT_ITAB-VBELN.
    APPEND WA_BDCDATA TO BDCDATA.
    CLEAR WA_BDCDATA.
    CALL TRANSACTION 'VA03'  USING BDCDATA  MODE 'A'
                             MESSAGES INTO ITAB.
    Regards
    Ravi

  • PNPCE in ABAP Query(SQ01) Selection is not working completely

    Hi All,
    I have developed an ABAP query using LDB PNPCE. I am reading data from IT000,IT0001 etc . I test the query in QA and I noticed that the PNCPCE screen doesn’t care about the selection in query. Like I have given the date range in PNCPE default screen. But it’s not filtering that data at all. It pulling up the employee’s regardless of date, it behaves the same for field action type (P0000-MASSn). The surprising thing is that for company code its working fine. My question is that Why PNPCE standard screen-selection not filtering data in ABAP query.
    Did any one of you also experience that?
    FYI
    I also find an OSS note # 730005 but we are already on 52 Patch !!
    OSS note :PNPCE: Incorrect data of infotype 0000 and 0001
    Symptom
    When you carry out a reprot which is based on logical database PNPCE, errors occur during the processing of infotypes 0000 and 0001.
    Other terms
    PNPCE, AS PERSON, P0000, P0001, data selection period, person selection period, CHECK_IT_0000_DATA_RESTRICTED, CHECK_IT_0001_DATA_RESTRICTED
    Reason and Prerequisites
    You start a report which is based on logical database PNPCE. In the report, infotype 0000 or 0001 is processed (that is, it was declared via the INFOTYPES statement). At event 'GET GROUP' or 'GET PERAS', the system either returns too few data records in the infotype tables or it returns data records twice.
    The error (missing data records) has only occured since the implementation of Note 687004 or the import of Support Package SAPKE47028.
    Solution
    Implement the attached corrections. or import the corresponding Support Package.
    Thanks,
    Saquib Khan

    Hi Saquib,
       Recently i am facing the same issue can u pls do reply how you have overcome this issue..The data is not getting picked up at the right time it is lately picked up by the program . Earlier it was PNP and it has been changed to PNPCE also we had implemented OSS Note 687004 and the later's Notes  were also implemented but still now we are unable to track down why there is delay in picking up the records this has been happening for the past 8-10 Months(i m not sure far more before). I am finding 2 main issues,
    1. we are using GET peras in PNPCE and no other event after that may be this is not fetching all the data because my selection screen does contain PERSONID where i suppose there should be GET PERSON event to define it
    2. RP_READ_INFOTYPE macro while using for P0000 ,, the code in the macro is such that it fetches using P0001 also ...I suppose if there are any inconsistency between IT0 and IT1 then this might one to take care ...
    kindly let me know how you have approached to resolve this issue.

  • ABAP Query (SQ01) Compare bewteen 2 selected fields

    Hello, In ABAP Query has selected fields (say) Fld1 Fld2 Fld3...  I need to output / show only those records where Fld1 not equal to Fld3. Any ideas ?? Both the fields are from the same table in a functional area.
    Thank You,
    Deb

    Hi,
    Welcome to SDN.
    This is not possible exactly with ABAP Query but can be easily done by ADHOC query. Using Set operation A-B.
    Check the links for ADHOC Query -
    <a href="http://www.sap.cmich.edu/fihr/hr/adhoc-query.doc">http://www.sap.cmich.edu/fihr/hr/adhoc-query.doc</a>
    Regards,
    Amit
    Reward all helpful replies.

  • ABAP Query (Sq01)Modification

    Hi Experts,
    I am new to ABAP queries. I need to add an additonal field (optional field) into the output of an existing ABAP query. On the selection screen i am planning to include this field along with a check box such that if i click on the check box then this field wil be displayed in the output.
    Please tell me the steps as to how do i do this.
    Thanks
    Dany

    Hi Dany,
    This document will help you.
    http://www.sappoint.com/abap/ab4query.pdf
    Reward points if it helps,
    Satish

  • Creation of Program using ABAP Query (SQ01)

    Hi All,
    I have a program called "AQL4FI==========INVOICE_CHECK=" in my 4.6 server but a similar program doesnot exist in ECC.
    From the name, it looks like a program created using SQ01.
    Can anyone please help as to how to create the same program in ECC using SQ01 by looking at the program in 4.6?
    Please help.
    Helpful answers will be fully rewarded.
    Thanks a ton.
    Naba

    First thing is this is not the way to convert the SAP Query to Report.
    First check that how many table in your query they have used.To check this if you go in SQ02 press display button left side you can see the tables.To check the fields selecting from tables check in field groups.
    In record processing check are there any conditions are there.
    Now wrire a select statement by joing all tables which you found above and in this select statement extract all fields which you found in field group into one internal table .Here you give the selection screen fields as condition fields in select statement.If you found any conditions in record processing event ,Loop that internal table and check the conditions or modifications.
    If you need more help let me know.
    Pls. reward points for helpful answers
    Thanks
    Murali Poli

  • How to modify standerd abap query  (SQ01) ...

    hi all,
    i am having one abap standard query, i have to modify that one and i have to include another colum which needs the requirment.
    07 Depreciation /SAPQUERY/AM07 ADA FIAA - DEPRECIATION
    the above i mentioned is the query, how ever i tryed this standared to copy but i am not able to connect infoset and all stuff.
    pls guide me how to insert additional colum in that standard report or query.
    pls guide me
    thanks and regards,
    sai

    s shiva,
    my query is that one only.
    i am having one formula depreciation = ( previous year / aquesition value ) * 100
    this formula i have to insert.
    how can i proced.
    pls guid me.
    thankx and regards,
    sai

  • Modifying an existing ABAP Query - sq01 (tcode)

    Hi All,
      We have a query develped (Z) long before .Now we have a requirment where in which we need to add one   more table to the existing query.Kindly let me know how can we proceed.
      When am giving the query name and clicked on change , am not able to find any option which allows the  user to add one more table.
      looking for valuble inputs on the same.
    Regards,
    Zareena.

    Hi ,
    u need to follow these steps when u are working on queries.
    Step1-->SQ03->Give ur user group here ->then /nSQ02->here it will display all ur Infosets those belongs to ur user Group--->then go in Change Mode, after u know wat u have to do.
    Regards
    Prabhu

  • Inserting addition field in ABAP query (SQ01) while generating reports.

    Please let me know the procedure of adding field and applying mathematical  formula in the query.

    Hi,
    have a look at the help <a href="http://help.sap.com/saphelp_erp2005/helpdata/EN/d2/cb4138455611d189710000e8322d00/frameset.htm">Creating and Changing Queries</a>. I doubt that you can add real formulas besides the predefined statistics.
    Regards,
    Christian

  • ABAP Query Extracts

    hello experts ,
                              i am using ABAP query (sq01) infoset ( logical database ).Is it possible to add extract feature in the abap query selection screen . if possible then how?
    thanks
    vivek

    Hi Vivek,
    Its not possible. Whenever you activate your query it generates a standard program & its not modifiable.
    Regards
    Abhii

  • Hyperlink on field in Basic list of ABAP Query

    Dear All,
    Could somebody tell me, if its possible to have a hyperlink on a field in the Basic list of ABAP Query (SQ01,SQ02).
    Example :- There is a basic list which has the field MARA-MATNR displayed.There should be a hyperlink on this field, such that when the user clicks on it , the transaction MM03 is called.
    Thanking You.
    Ranu

    Hi,
    Loop at itab.
    write:/ itab-matnr hotspot,
              itab-maktx.
    hide: itab-matnr.
    endloop.
    data: c_field(16).
    at line-selection.
      get cursor field c_field.
      if c_field  = 'ITAB-MATNR'.
        check not itab-matnr is initial.
        set parameter id 'MAT' field itab-matnr.
        call transaction 'MM03' and skip first screen.
      endif.
    This is one example to call the transaction.
    If this helps you award points.
    Thanks,
    Deepak.

  • Abap query, join between same tables

    Hi,
    I have an Abap Query (SQ01), I need to create a join between the same table (ESLL-ESLL) to obtain the services from a PO. The join is with the packno from ESLL to subpackno from ESLL (the same table). But I don't know how I can do that with Abap Query. Because the Infoset doesn't allow inserting the table two times.
    Somebody can help me.
    Thanks.
    Victoria

    Hi:
    I was able to create a query to retrieve the service lines entries using tables ESSR (Header) (service entry sheet number as input parameter), linked to package number to view ML_ESLL and then from the view the sup-package number linked to ESLL. That way I was able to retrieve all the service lines information from table ESLL only using SQ02 and SQ01, no ABAP.
    I Hope this help.
    Juan
    PS: I know the post is old but may be there are people out there with no ABAP access who needs to create reports for Service Entry Sheets lines. All the join conditions are.
    Table             Table
    ESSR            EKKO
    ESSR            ML_ESLL
    ML_ESLL      ESLL
    ESLL             ESLH
    Edited by: Juan Marino on Jan 23, 2012 10:53 PM

  • Copy ABAP query from one servert to another

    Hi,
       How to copy ABAP query(SQ01) to other servers.Here we have sandbox-dev-quality-and prod.Now a query is created in sandbox, so i need it to move to Dev and then to quality.So do we have any upload and download option for this or we need to copy the code from system-status.

    Similar issue solved here.
    Download Query SQ01/SQ02

Maybe you are looking for

  • MTO...OH on sales order

    Hi Experts, Client is follwing MTO with non valuted sales order stock, after completion of production the production order is setteled to respective sales order. EX: Production cost: 100 rs. has been setteled to sales order, on this 100 and other rs

  • Images appear as a question mark in mail and safari

    I have just noticed a new problem in Mail and Safari.  "Some" emails that contain pictures that are links are suddenly only showing the images as a small blue square with a question mark.   If I click the "view this email in your browser" link in Mai

  • How to integrate x-fi updates on a installation c

    Can I do it ?

  • Importing m4v to iTunes

    I recently downloaded a movie and converted it to a m4v in Quictime Pro. When I try to drag/drop it into iTunes nothing happens and the movie does not import. I also tried File--Add File to Library and nothing happened. Any help for this problem? Tha

  • 4 to 4.1 - too slow to use.

    Since upgrading to 4.1 LR has become too slow to use. The problem lies primarily, but not restricted to, the noise reduction sliders.  The luminance slider specifically. Unless I can fix something I will have to return to an older version, Im actuall