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.

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.

  • 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

  • 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 - default value in selection parameter

    In ABAP Query, how to get a default value into the field which is in selection screen?

    hi priya,
    You can specify a default value to both a Parameter and a Select-Option with the following addition
    Default <value>
    E.g.  Parameters : p_date  TYPE sy-datum  DEFAULT sy-datum.
            Select-options s_date for sy-datum default sy-datum.
    thanks
    Sachin

  • 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

  • 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

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

  • 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

  • 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

  • Need query to compare quantites,add fields of 1 table until it = the other

    I am trying to query the Curr_sched and Ship_dd250 tables
    to get the date a shipment was completed
    fulfilling the quantity shipped for the original order.
    The Curr_Sched table gives the original ship date (SCHED_DT)along with the requested quantity (SCHED_QTY).
    C.PIIN C.CLIN C.SCHED_DT C.SCHED_QTY
    D2003 001 19-SEP-2003 20
    D2003 001 30-SEP-2003 10
    D2003 001 28-Oct-2003 205
    D2003 001 29-OCT-2003 6
    D2003 001 31-OCT-2003 6
    D2003 001 31-OCT-2003 6
    D2003 001 28-NOV-2003 300
    D2003 001 29-DEC-2003 48
    (RECORDS CONTINUE FOR NEXT CLIN)
    D2--3 --2 30--------- 3-
    This number is compared to the quantity (QTY_SHIP) of the actual shipment and date the shipment went out (DT_SHP_COMP) in the Ship_dd250
    C.PIIN C.CLIN S.DT_SHP_COMP QTY_SHIP
    D2003 001 17-SEP-2003 20
    D2003 001 10-OCT-2003 10
    D2003 001 28-OCT-2003 6
    D2003 001 28-OCT-2003 6
    D2003 001 28-OCT-2003 6
    D2003 001 28-OCT-2003 155
    D2003 001 14-NOV-2003 100
    D2003 001 21-NOV-2003 100
    D2003 001 25-NOV-2003 100
    D2003 001 15-DEC-2003 98
    (RECORDS CONTINUE FOR NEXT CLIN)
    D2--3 --2 30--------- 3-
    If the C.QTY_SHIP is the same as the S.SCHED_QTY then
    the information is printed to a report as
    *on 19-SEP-2003  an order was placed for 20 items and on 17-SEP-2003 the 20 items were sent
    *same as for 30-SEP-2003 order placed for 10 and on  10-OCT-2003 the 10 items were sent
    C.SCHED_DT DT_SHP_COMP
    19-SEP-2003 17-SEP-2003 --20
    30-SEP-2003 10-OCT-2003 --10
    BUT for an order placed on 28-OCT-2003 for 205 items the first shipment on 28-OCT-2003 only contained 6 items
    so this must be added to a variable and the next record read to see if that amount added to the 6 meets
    the total amount of 205 if not then go on to the next record in the Ship_dd250 until the total is reached.
    *28-OCT-2003 = 6 + 28-OCT-2003 = 6 + 28-OCT-2003 = 6 + 28-OCT-2003 = 155 + 14-NOV-2003 = 100
    *So the total of 205 was reached on 14-NOV-2003 when the quantity shipped total = 273
    *The difference must be retained for comparison to the next quantity request in the Curr_sched for 6 items on 29-OCT-2003
    * So 273 - 205 = 68 minus the 6 = 62 and that number is kept to compare to the next quantity in the Curr_sched
    C.SCHED_DT DT_SHP_COMP
    28-OCT-2003 14-NOV-2003 --205
    30-SEP-2003 14-NOV-2003 --6
    any help, suggestions greatly appreciated Thanks

    I think you didn't tested it, because it's working for this scenario also.
    SQL> select * from tableA;
    PIN   CLIN  SCHDT            QTY
    DAE2  002A  19-SEP-03         20
    DAE2  002A  30-SEP-03         10
    DAE2  002A  28-OCT-03        205
    DAE2  002B  29-OCT-03          6
    DAE2  002B  31-OCT-03          2
    DAE2  002B  21-NOV-03         10
    DAE2  002C  31-OCT-03          6
    DAE2  002C  28-NOV-03         94
    DAE2  002C  29-DEC-03          8
    9 rows selected.
    SQL> select * from tableB;
    PIN   CLIN  SHIPDT           QTY
    DAE2  002A  17-SEP-03         20
    DAE2  002A  10-OCT-03         10
    DAE2  002A  28-OCT-03          5
    DAE2  002A  28-OCT-03        100
    DAE2  002A  28-OCT-03        100
    DAE2  002B  28-OCT-03          7
    DAE2  002B  14-NOV-03          1
    DAE2  002C  25-NOV-03        100
    DAE2  002C  15-DEC-03          8
    9 rows selected.
    SQL> select a.pin,a.clin,schdt,shipdt,qty from
      2  (
      3  select pin,clin,schdt,qty,sum(qty) over
      4  (partition by pin,clin order by schdt rows between unbounded preceding and current row) tqty
      5  from tableA
      6  ) a,
      7  (
      8  select pin,clin,shipdt, lag(tqty) over (partition by clin,pin order by shipdt) pre_qty ,tqty
      9  from
    10  (
    11  select pin,clin,shipdt,sum(qty) over
    12  (partition by pin,clin order by shipdt rows between unbounded preceding and current row) tqty
    13  from tableB
    14  )
    15  ) b
    16  where
    17  a.tqty > nvl(b.pre_qty,0) and a.tqty <= b.tqty and
    18  a.pin = b.pin and
    19  a.clin = b.clin;
    PIN   CLIN  SCHDT     SHIPDT           QTY
    DAE2  002A  19-SEP-03 17-SEP-03         20
    DAE2  002A  30-SEP-03 10-OCT-03         10
    DAE2  002A  28-OCT-03 28-OCT-03        205
    DAE2  002B  29-OCT-03 28-OCT-03          6
    DAE2  002B  31-OCT-03 14-NOV-03          2
    DAE2  002C  31-OCT-03 25-NOV-03          6
    DAE2  002C  28-NOV-03 25-NOV-03         94
    DAE2  002C  29-DEC-03 15-DEC-03          8
    8 rows selected.
    SQL>

  • 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

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

  • Including MANDT field in ABAP Query Report as output field

    Hi All,
    I need to display the client(MANDT) field in the ABAP Query Report as an output field.
    But in SQ01 where we select the fields to be displayed as output in query , this field is not visible.
    I later checked in the Infoset. Even in the infoset the field MANDT is greyed out and all other fields are active.
    Can someone tell me how to include the field MANDT in the output of the ABAP Query Report.

    self resolved

Maybe you are looking for

  • 4th Gen iPod Shuffle, not recognized by my Macbook Pro

    background: bought an ipod shuffle 4th Generation 2 days ago, syned it with my macbook pro/itunes everything was fine. got my music on there, i did noticed once or twice a window popped up saying i disconnected my ipod shuffle without ejected (i did

  • Function Module for CO-PA document creation

    Hi, we need to crate the CO-PA document through program. Is there any funcion module/BAPI available for the same? Scenario here is... We are restricting CO-PA document not to be created at the time of invoice creation. Later some point of time in the

  • Adobe AIR for Android - GPU Mode - Bitmap Auto-Smoothing Issue

    Hi everyone I'm having a bit of an issue with the AS3 bitmap object. I'm currently developing an 8-bit style pixel game for AIR for Android. This game is being developed at a very low resolution and is being scaled up to maintain the charm of an old

  • InfoPackage to load multiple flat file for different plant

    Hi There is a requirements to load the data from multiple flat files by different plant into BI which source data is coming from other system. Each flat file has it own naming convention. As data has to load via infopackage into the targeted cube. Th

  • Deprecated API compilation error

    Please help. Attached is my source code. I'm receiving a compilation error that reads 'RnrBooksApp.java uses or overrides a deprecated API. Recompile with -deprecation for details.' I'm very new to Java, so I appreciate any assistance. Thank you! //C