Duplicates in SAP Query (crmd_order_index)

Hello, SAP-friends!
I'm trying to get all Bus.Transaction of a particular partner using table CRMD_ORDER_INDEX in sap query.
I insert the part number and in the result screen I get more items than it has to be (here are some duplicates items). My result differences compared with B.Tr CRMD_ORDER using search criteria as business partner number or b.tr se16-CRMD_ORDER_INDEX, here I get another result without duplicates! What is problem in SAP Query?
Did anyone face this problem?
Thanks in advance!

Hi Andrey,
CRMD_ORDER_INDEX table will provide all entries for a particular PARTNER_NO at both header and line item levels . So if a transaction has 2 line items and a PARTNER 'XYZ' maintained at header and also in those 2 line items , so number of entries in the result list after querying CRMD_ORDER_INDEX will be 3 .with same header and different line item guids.
                           Whereas in Tcode CRMD_ORDER it will provide all the different transactions if any PARTNER_NO is maintained in entire transaction( can be at any level header or item).
Regards,
Nithish

Similar Messages

  • How to remove duplicates in SAP Query

    Dear Frns,
    I created a simple SAP query with quickviewer by table join option.
    tables are MAST & STPO.
    Link is only STLNR.
    I am getting a duplicate extra line with same data.
    Can anyone suggest me how it happened.
    Is there anyway to remove these duplicate lines.
    pl suggest

    Hi,
    You can sort the internal table and then delete the duplicate entries.
    sort itab ascending by STLNR.
    delete adjacent duplicates from itab comparing STLNR.
    Reward points for useful answers.

  • Duplicate rows in SAP Query

    Now here is the issue.
    FIrst of all I am using sap query for generating a report.There are such reports where we require to know deliveries corresponding to sales orders.So in the infoset we have to join the tables *vbak-vbap-lips-likp". Now in the report output we will find duplicate records for a single order(400000001)  delivery relation(9000000002) such as:
    Sale Order      Delivery
    400000001     9000000002
    400000001     9000000002
    400000001     9000000002
    This is due to three items in between them.Now how can we handle this situation as we know there is not duplicate records in the infoset but there duplicate records in the output.I hope you get my point.Please reply urgently

    Hello,
    in the join of the tables VBAK VBAP LIKP LIPS and you look for item detailes, are you considering the item number POSNR as key also?
    Try to consider also the folliwing tables:
    1. VBAK (get the order list)
    2. VBAP (get the item details of the order) and keep truck of the POSNR
    3. check the subsequent documents in VBFA (you enter with result of VBAP [VBELV & POSNV] and you end/take the follow-on document and item number = VBELN & POSNN)
    4. LIKP (get the information of the delivery header = you enter with the result at point 3 VBELN)
    5. LIPS (get the information of the item of the delivery = you enter with VBELN & POSNN got at point 3)
    Do not forget to query and have POSNR as key since the beginning.
    Regards,

  • How to change code in SAP Query

    Hi Experts !!
    In SAP QUERY I am getting the  PO  with  all delivey dates & deliveried Qty  but I have to select only  single PO with latest delivery date  & qty. If there r more than one record for latest delivery date than deliveried QTY must be sum of  all QTY (for the  latest delivery date). for example :
    this is coming
    Po                delivery date                 qty
    10001         30.06.2009                   4
    10001         30.06.2009                   5
    10001         01.05.2009                   4
    we want
    Po                delivery date                 qty
    10001          30.06.2009                   9
    Thanks in advance.
    Thanks & Regards
    Navneet Singhal

    >
    navneet singhal wrote:
    > There is an internal table  %G00 in  query generated program (AQCSZPCWMM======Z_PCW_ORDER_V2) when I use this table in Code section (END-OF-SELECTION ) system thro msg %G00 is not defined . if I define this table in DATA  section than  run the query , It gives the  DUMP  with error %G00 is already decleared.
    >
    > How can I use %G00 internal table  in my code section.
    I have the same problem as the OP. I need to get rid of the duplicates and have all sumarized in just one row. I was thinking about this same solution, but when I add code to the END-OF-SELECTION event, this doesn't appears anywhere (but if I add code to any calculated field, yes).
    And the problem of the quoted message. I tried using field-symbols but I have errors saying that it's nos a valid table, etc...
    Any ideas???
    Thanks!!!

  • SAP Query to join action infotype with additional action infotype

    We have created SAP Query on PA0000 which shows all actions that are executed for an employee.
    The problem is that if two actions are exceuted on the same day then it shows only one action instead of showing both the actions.
    As two actions are executed on the same day it will be stored in additional action infotype(0302).We tried to join PA0000(Action infotype) with PA0302(additional action infotype) in SAP Query by using joins(inner join/outer join) but it shows duplicate records.
    Is there any way to get additional action along with records of action infotype without any duplication in SAP Query.

    All entries that are in PA0000 will be in PA0302, but not vice-versa so you just have to reverse what you are currently doing, i.e.: create a Query on PA0302 and join to PA0000, and then make sure your selection criteria is from PA0302 and not PA0000.

  • SAP Query in Excel

    I actually found what I needed to do this on the forum last week and now I can't duplicate it nor can I find the original forms thread.  I need to get the SAP Query results to a file or to Excel.  The first time I tried this, I executed the query in background, got the spool number then went to SP01.  There I believe it did the following:
    [Execute]
    Selected:  Spool Request / Forward / Export as Text
    At this point, I was presented a popup similiar to when downloading with options: unconverted, spreadsheet, etc.  I selected spreadsheet and everyting went fine.  
    Now when I repeat the process, after I do Spool Request / Forward / Export as Text, the file is automatically written to a text file; I do not get the option to put it in a spread sheet. 
    Please, can someone tell me what I'm doing wrong?  If I hadn't saved the spreadsheet last week, I would have myself convinced I only dreamed that I got it to work.

    You can try this way
    sp01> display spool>spool request> forward> save to local file--> spread sheet
    otherwise try with
    Once you logged in, press Alt+F12 -> Options -> Local Data. Then just press "Clear History" button
    and try spool> forward> write to text

  • SAP Query - Ad Spec

    I want to get the Ad Spec and Sub Ad spec what are the essential Tables to use/link up?
    Currently the tables I using in SAP Query are:
    JHAK - Header Data
    JHAP - Media Item
    JHAGA - Billing Dataset
    JHAMOT - Ad Spec
    The linkage as follow:
    JHAK >> JHAP >> JHAGA >> JHAMOT
    The record as follow:
    Order 700002588 contain 2 Ad items, the 1st Ad item have 1 Sub Ad Spec & the 2nd Ad item without any sub Ad Spec.
    Order 700002615 contain 1 Ad item with 2 sub Ad Spec.
    By tweaking the link , it either I get duplicate records of  items to many ad specs/sub ad specs (700002588) and 1 Ad item with Sub Ad Spec (700002615) as shown:
    Order               Item        Ad Spec
    ========            ====        ========
    70002588            001          000001
    70002588            001          000002
    70002588            001          000003
    70002588            001          000001
    70002588            001          000002
    70002588            001          000003
    70002588            002          000002
    70002588            002          000002
    70002588            002          000002
    70002615            001          000001
    70002615            001          000002
    70002615            001          000003
    Or no duplicate records but an ad item suppose to have many sub ad spec was not shown:
    Order               Item        Ad Spec
    ========            ====        ========
    70002588            001          000001
    70002588            001          000003
    70002588            002          000002
    70002615            001          000001
    Is there any missing tables that i need to link up so as to have the correct number of item with ad spec and sub ad spec without any duplication?

    https://www.sdn.sap.com/irj/sdn/wiki?path=/pages/viewpage.action?pageId=30083
    Please give me reward points...

  • FICA SAP Query

    Has anyone tried building an SAP Query (SQ01) against the FICA transaction tables: DFKKKO (header) + DFKKOPK (GL line items) + DFKKOP (BP line items)?
    I'm getting duplicate line items (OPUPK) on my SAP Query. 
    My INFOSET was created by creating an inner join between DFKKKO to DFKKOPK and DFKKO to DFKKOP.  The join is based on document number (OPBEL). 
    I also tried an INFOSET by joining DFKKKO to DFKKOPK to DFKKOP by doc number.  This is also diplaying duplicate line items.

    Hi Ken
    It's clear now.
    The problem will appear when DFKKOP will have less lines than DFKKOPK. How do you want those lines to be displayed?
    The issue is that, although SAP Query is a nice and quite easy tool, it has its limitations. One of them: you are not able to add lines, meaning if you have one line of information and would like to generate 2 lines in the report, you can't.
    Of course, you can "trick" the system.
    One of the solutions is to have internal tables in which you remember the lines you posted and check each line against that table.
    You may have problems when you don't have lines in DFKKOP, but you have lines in DFKKOPK, if the join is not done correctly.
    Another problem: DFKKOP lines are split when you make a partial payment, so you may have 3 lines of partial payment for field OPUPK equal to 1.
    So, my suggestion:
    - do not join like this DFKKKO - DFKKOP - DFKKOPK, but like this:
    DFKKKO - DFKKOP
           - DFKKOPK
    Both left joins.
    - take into account what I wrote above and be very clear in your requirements and specifications, i.e. establish what you will do when you encounter the situations I described earlier.
    Please ask me whatever is not clear and give some more information about your goal.
    Bogdan

  • SAP query unique records only

    Folks,
    I have created a query which gives me a list with all open deliveries based on a certain route and postal code. We have multiple deliveries for the same ship-to so the list may show duplicate postal codes. I would like to have a list with only unique postal codes. How can this be achieved in SAP query?
    Thanks,
    MdZ

    hi,
    you can include the logic for unique postal code in Sq02 transaction.
    goto sq02 transaction ,give your infoset name ,change,click on extras button in app tool bar .
    there you have a button called code where you can incorporate your logic.

  • 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

Maybe you are looking for