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.

Similar Messages

  • Query Unique Records WITH ROWID

    Hi All,
    I have 2 columns which returns records like this Say Column A and Column B.
    A B
    1 1
    1 1
    2 2
    2 2
    3, 3
    I need only distinct records from these columns. So i executed DISTINCT Clause in my query and it returned unique records. Issue is I need to execute a query like this i.e compulsorily use ROWID in my select list.
    i.e SELECT DISTINCT ROWID A, B from TEST;
    But this query we will give duplicated records only when we give rowid, how to achieve a output like this using rowid in the column select list of my query.
    A B
    1 1
    2 2
    3, 3
    Please Help.
    Thanks in advance.

    If you want just one rowid for each (a, b) couple:
    SQL> select a, b, min(rowid)
      2  from y
      3  group by a, b;
             A          B MIN(ROWID)
             1          1 AAAfoUAAEAAA7T0AAA
             2          2 AAAfoUAAEAAA7T0AAC
             3          3 AAAfoUAAEAAA7T0AAEIf you want all rowid's for each couple:
    SQL>select a, b, rtrim(extract(xmlagg(xmlelement("a",rowid||',')),'//text()'),',') rowids
      2  from y
      3* group by a, b
             A          B ROWIDS
             1          1 AAAfoUAAEAAA7T0AAA,AAAfoUAAEAAA7T0AAB
             2          2 AAAfoUAAEAAA7T0AAC,AAAfoUAAEAAA7T0AAD
             3          3 AAAfoUAAEAAA7T0AAEThanks Buga for posting sample data ;)
    Max
    [My Italian Oracle blog| http://oracleitalia.wordpress.com/2010/02/07/aggiornare-una-tabella-con-listruzione-merge/]

  • Debatch unique records only, BizTalk 2010

    Hi all,
    I have a flat file coming onto BizTalk that contains multiple duplicate rows.  I want to debatch to XML, however only keep the unique records.  Is there a way of doing this without using a custom pipeline component?
    Thanks in advance.
    GilesB

    Use a map and with custom XSLT in your map you can filter the records eliminating the duplicate records (Muenchian), then in orchestration by calling the Receive pipeline you can debatch the message. Check the following references for eliminating the duplicate
    records in maps:
    http://social.msdn.microsoft.com/Forums/en-US/760d5bd6-aa97-4fff-a4c8-706f86bda7b5/eliminate-duplicate-records-in-map-instance?forum=biztalkgeneral
    http://alamnaushad.wordpress.com/2012/02/24/filter-unique-records-using-biztalk-xsl/
    And following is the reference for debatching the message in orchestration by calling the Receive pipeline
    http://geekswithblogs.net/sthomas/archive/2005/06/16/44023.aspx
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • SAP Query: ABAP List Only

    hello friends,
    how do i hide the "Output format" box from the UI of my SAP query?
    i would just want a query that would automatically have an ABAP List output without users having to choose other layouts (meaning the "Output format" is not seen on their end)?
    thank you in advance.
    best regards,
    albert

    hello Shiva,
    thanks for the input. i tried doing that and it brings me directly to the query results.
    however, i would want my users to see the selection screen, but not the Output Format window (where you can select a variety of layouts).
    any idea on this requirement?
    best regards,
    albert

  • SAP Query: Duplicte records after joining table CSKT

    Guru's,
    We have created a query in SQ02 for Z table which has fields with KOKRS and KOSTL as well.
    Ztable fields:
    PLAN_TYPE
    PLAN_PROCESS
    KOKRS
    KOSTL
    We want to display cost center description. SO joining this Z table with CSKT(KOKRS,KOSTL). We are getting duplicate records in output because CSKT has duplicate KOSTL.To solve this, we want fetch Latest KOSTL comparing DATBI  GE SY-DATUM.
    Can anybody help us how to code this logic in Query. I have gone thru most of the SDN threads but could not find the answer.
    Please help us.
    Thanks in Advace.
    Shreyansh

    Moderator message - Duplicate post locked

  • How to show all records (instead of unique records) in OBIEE Answers

    I am a newbie of OBIEE and have below question.
    The fact table has 3 fields:
    ID (Primary Key)
    Status (either 'open' or 'close')
    Amount
    There are 100 records in the fact table. When I drag the column Status into the Answers, the result returned is 2 records, 'open' and 'close'. Thus, seems Answers always returns unique records only.
    Can I achieve disabling such Answers feature such that all records will be shown? For above example, can the result returned all 100 records of either 'open' or 'close' ??
    Thank you very much.

    Hi,
    OBIEE is an analytical tool, it is there to help people see the value of numeric facts against one or more textual attributes. With that in mind OBIEE will always aggregate to the highest possible level when returning the results to you. In your case the highest level is status. If you include another column wich breaks the data down further then you will see it aggregated at that level. If you want to see individual records then you need to add a column which is unique for each record, usually you can use the column holding the identifier of the row from the source system, generally this is called Integration Id.
    Edit: After reading your post again, just add the ID column in your request and voila.
    Regards,
    Matt
    Edited by: mod100 on 13-Oct-2009 23:39

  • Display only the last record per material in SAP query

    Hi,
    I have created a SAP Query using the quickviewer that is a join between 2 tables (MSEG and MKPF) that consist of material document information and date of posting.
    The results are fine however I would like only the last record per material to be displayed.
    Can anyone tell what do I need to add so for only the last record per material be displayed in the output.
    Thanks,
    Mark

    Hi Mark,
    May be if you use Control Level processing .........I think you will be able to get the result you want. Try displaying as Below,
    LOOP AT XXXXX.
    AT FIRST material.
    ENDAT.
    AT LAST material.
    *...Display what ever you want here. It will display at end of every material.
    ENDAT.
    ENDLOOP.
    Before using sort the table with key material in ascending.
    Hope what I had to say is helpful to you.
    Cheers,
    Raga Suman.

  • SAP Query: How to filter records from SAP Query output before display

    Hi Friends,
      Can I delete records from an SAP query basic list before it is displayed?
    For example I want to delte all the orders whose system status is "RELEASED" before the basic list of that SAP query is displayed.
    I have gone through SAP help and found out that we can write some code in <b>END code</b> section which will execute before the basic list of the query is displayed. But I could not figure out how the code this...following is an excerpt form SAP help.
    <b>"The END-OF-SELECTION code consists of two parts (Before list output and After list output). The first part is processed before the list is output and the second part afterwards."</b>
    Can anybody help me?
    Regards,
    Bharat.
    Message was edited by:
            Bharat Reddy V

    Try this simple procedure. <b>Hope</b> this should work for you.
    You do the slection of the status in the List-Processing. say your final field of status flag is GF_STATUS.
    Immediatly after that use this within the List-Processing.
    CHECK GF_STATUS EQ '<RELEASED STATUS>'
    How it works:
    SELECT  <>       "<-------Query processing(system code).
    *< Your code put in the List processing
    CHECK GF_STATUS EQ '<RELEASED STATUS>'   "< --only released records passed.
    *>
    ENDSELECT      "<-----Query endselect(system code).
    Please let me know the result.
    Regards,
    A.Singh
    Message was edited by:
            Amarjit Singh

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

  • Need help in SQL query to get only distinct records

    Hi all.
    I am new to oracle SQL and i want to write a query to get only distinct values from 2 tables.
    for example i hade 2 tables table1(employee_id,employee_no,grade) and another table2 with same structure.
    for example data in table1 is
    Employeeid employeeno Grade
    1 101 A
    1 101 B
    1 101 E
    1 101 D
    and data in table 2 is
    Employeeid employeeno Grade
    1 101 A
    1 101 B
    1 101 E
    i want to display only the fourth row like the data that doesnt exist in table2 i,e (1 101 D)
    I had too much records in both tables and i jst want to see the records that is in table 1 not in table 2 only.
    employeeid and employeeno are the same in both tables
    I hope u understand my query. I user left outer join and right outer join bt it displays all the results that and matching and unmatching. I want jst unmatched records.
    Any help is highly Appreciated.
    Thanx in Advance.
    I am using oracle 10G on windows

    Try MINUS:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries004.htm#i2054381
    SQL> -- generating sample data:
    SQL> with t1 as (
      2  select 1 employeeid, 101 employeeno, 'A' grade from dual union
      3  select 1, 101, 'B' from dual union
      4  select 1, 101, 'E' from dual union
      5  select 1, 101, 'D' from dual
      6  )
      7  ,  t2 as (
      8  select 1 employeeid, 101 employeeno, 'A' grade from dual union
      9  select 1, 101, 'B' from dual union
    10  select 1, 101, 'E' from dual
    11  )
    12  --
    13  -- actual query:
    14  --
    15  select employeeid
    16  ,      employeeno
    17  ,      grade
    18  from   t1
    19  minus
    20  select employeeid
    21  ,      employeeno
    22  ,      grade
    23  from   t2;
    EMPLOYEEID EMPLOYEENO G
             1        101 D
    1 row selected.

  • How to write ABAP Logic in SAP Query to fetch records from many Tables

    Hi Expert,
    I have one requirement, want to display all BOM (Equipment BOM, Function Location BOM and Meterial BOM) from a particular plant.
    List of tables as below:
    EQST: Equipment to BOM Link
    TPST: Link Between Functional Location and BOM
    MAST: Material to BOM Link
    STPO:BOM item
    Requirement: When user enters Plant then SAP Query should execute and fetch all BOMs (as mentioned above) from STPO Table.
    I have done so far is as follows:
    I create User Group, Infoset and SAP Query.
    While creating INFOSET, i used 4 tables (EQST,TPST,MAST & STPO) and link between then is as follows:
    STPO-STLNR ---> EQST-STLNR : Left Outer Join
    STPO-STLNR ---> TPST-STLNR : Left Outer Join
    STPO-STLNR ---> MAST-STLNR : Left Outer Join
    Now its showing all BOM from all plants though I enter one Plant value.
    Please advise me to write SAP Query and Logic to fetch all BOM from selected Plant Value.
    Thanks,
    Jay.
    Edited by: jaykrishna007 on Jul 29, 2011 11:41 AM

    Hi FCannavo,
    Thanks for your quick reply.
    See, now I changed my Infoset design.
    I added one Plant Table (T001W) and then
    T001W-WERKS--->EQST-WERKS
    T001W-WERKS--->MAST-WERKS
    T001W-WERKS--->TPST-WERKS
    and then
    EQST-STLNR--->STPO-STLNR
    MAST-STLNR--->STPO-STLNR
    TPST-STLNR--->STPO-STLNR
    on selection screen, user will enter Plant Value.
    Now its showing some records, but i dont think so i would be correct output or not, please guide me whether it is correct or not?
    Thanks,
    Jay.

  • SAP BW Query in CR2008: only tech names displayed when query is changed

    Hello Experts,
    we have the following constellation / problem:
    SAP Query BW 7.0
    a report built upon this query with Crystal Reports 2008
    the report is currently not using any of the Database fields, is just consists of the layout
    Now we want to change / add the underlying query. But either if we add the new query or replace the old query by the new query, the result is the same:
    only the technical names of the query structures (UIDs) are shown, neither the descriptions nor the technical names (concerning SAP BW) are shown.
    The 'new' query is a slightly changed copy of the old query, I don´t think that is has to do anything with the query.
    As mentioned, everything seems to be perfect as long as we just do 'Create Report upon query', then the descriptions and technical names (not the UIDs) are shown, but not if we add / replace the existing query through another.
    Many thanks for your help in advance !
    Frank

    So the solution seems to be:
    Open the Query Designer and tick 'Allow External Access to this Query' on the Advanced Tab to allow access with OLE DB for OLAP to the query.
    Then the query appears in Crystal Reports under the source system and 'Queries' whereas before it is only accessible directly under the source system.
    If a query is accessible under the source system, the BW Query Driver is used, which seems not to be able to cope correctly with the technical names.
    If accessed via 'Queries', the BW MDX Driver comes into action and not only the tech names but also the description etc. is displayed.

  • SQL- Query that return only one record

    Hello,
    is it possible to execute a pure SQL-Query which returns only one row although multiple rows are found.
    It is no problem in PL/SQL, but I have no idea if the same is also possible in SQL.
    thanks in advance
    Michael

    Why not? There are 4 records in this table, but only selected one.
    SQL> with t
      2  as
      3  (
      4     select '#%$@#$@$@##$' Addr from dual
      5     union all
      6     select '18 Jalan Scott' from dual
      7     union all
      8     select '18 Lemana St' from dual
      9     union all
    10     select '32-penstation' from dual
    11     union all
    12     select '99999999999' from dual
    13  )
    14  select addr
    15    from t
    16   where rownum =1
    17  /
    ADDR
    #%$@#$@$@##$
    SQL>Cheers
    Sarma.

  • Number of records in SAP Query

    Hi There,
    I have created a SAP Query. Instead of rows in the output I would like to display number of rows fetched in my list output. How can I do this? Please advice.
    Thanks in advance,
    Rams.

    Hi rams,
    1. simple
    2. we have to use Count(*) in select query.
    3. just copy paste
    4.
    report abc.
    data : mycount type i.
    select count(*) from t001
    into mycount.
    write :/ mycount.
    regards,
    amit m.

  • Infoset data grouping for SAP Query

    Hi,
    I'm pretty new to SAP R/3 (4.7) and have a query that I think relates to Infoset rather that SAP Query.
    I have two tables to join but the right hand table (it's a left outer join), needs to be summarised to reduce to unique records on each side of the join. In SQL Plus I would use a 'Group by' to perform this function .. is there a simple way to do this when building the Infoset ?
    I am not an ABAP programmer, nor do I have access to ABAP so would prefer not to go down this route unless it's the only way.
    Any assistance would be appreciated.

    Hi Guys,
    Any ideas?

Maybe you are looking for

  • How do I deleat an update for Garage Band that I don't want?

    I have received notification of an update for Garage Band, a program that I will never use. How do I deleat this notification of the update?

  • About BSEG table-Priority High

    Dear, I want to fetch material(MATNR) wise amount(DMBTR) from BSEG on respect of given company code but bseg query is taking more time.Is there any other solution other than BSEG. Thanx. Anuj Modi

  • Can I measure full bridge gage configurations with SCXI1121 and 1321 terminal

    Hello I designed a load cell that uses a full bridge gage configuration. I have at my lab a SCXI 1121 module with a SCXI 1321 terminal block. I need to know if it is possible to use that hardware configuration in order to make de load cell and the da

  • UI Distortions - CS6 Win7x64

    We have a user seeing frequent distortions of the UI in Ps CS6. Toolbars will get cut off halfway or will be ghosted across the application window. Best way to describe it is with screenshots (attached). Platform info: Win7 SP1 x64 Sw: Ps 6 (no updat

  • Linking SAP Notes on SCN

    Hi, At the moment navigating between SAP Notes on SCN is quite time consuming. Usually a note has a series of related notes which contain other relevant information. However these are not linked so you have to search for each individual note number i