Query to search for independent DO

Hi experts,
I need a query to search for independent DO (DO without SO). I have been trying for quite sometime but the results appear to be duplicative and irrelevant. This is the syntax that I am using now,
SELECT DISTINCT T0.[DocNum] as 'SO#', T0.[DocStatus], T0.[DocDate], T0.[CardName], T1.[ItemCode], T1.[Quantity], T3.[DocNum] as 'DO#'
FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry
RIGHT JOIN DLN1 T2 ON T2.TrgetEntry = T1.DocEntry
INNER JOIN ODLN T3 ON T2.DocEntry = T3.DocEntry
I think there are something wrong with the syntax but I just can't figure out where is wrong. Please help.
Thank you.
Best Regards,
Alex

Hi Alex,
Try this,
SELECT DISTINCT T0.DocNum as 'SO#', T0.DocStatus, T0.DocDate, T0.CardName,
T1.ItemCode, T1.Quantity, T3.DocNum as 'DO#'
FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry
RIGHT JOIN DLN1 T2 ON T2.TrgetEntry = T1.DocEntry
INNER JOIN ODLN T3 ON T2.DocEntry = T3.DocEntry
WHERE T2.[BaseRef] = ' '
OR
SELECT T0.[DocNum], T0.[DocStatus], T0.[DocDate], T0.[CardCode], T0.[CardName],
T1.[ItemCode], T1.[Dscription], T1.[Quantity]
FROM ODLN T0 INNER JOIN DLN1 T1 ON T0.DocEntry = T1.DocEntry
WHERE T1.[BaseRef] = ' '
Regards,
Madhan.

Similar Messages

  • Clues about query's - Search for date type at INBOX

    Hello Everyone,
    At IC Webclient, does anyone experiment to add a new search date type at INBOX, at "search for date" search parameter?
    I added a new date type at Date Management, ZDATA_PR.
    When I try to assemble the query parts, I use something like this:
    CL CL_CRM_QUERYAUI_RUN_BTIL
    METH READ_BUSINESS_TRANSACTIONS
    CALL METHOD cl_crm_report_qupart=>get_qupart_by_token
        EXPORTING
          iv_token     = 'DAT'
          iv_date_type = 'ZDATA_PAR'
          iv_from      = ls_query_aui-from
          iv_to        = ls_query_aui-to
        IMPORTING
          ev_qupart    = ls_qupart_range-querypart.
      APPEND ls_qupart_and   TO lt_query.
      APPEND ls_qupart_range TO lt_query.
    However, I'm rewarded with an error message telling me that I have problems with the query.
    Does anyone can give me clues how to perform this action? I'm clueless and there's not almost no information about this...
    Thanks and Kind Regards
    Bruno Garcia

    Just to solve a mistake at example code:
    CALL METHOD cl_crm_report_qupart=>get_qupart_by_token
    EXPORTING
    iv_token = 'DAT'
    iv_date_type = 'ZDATA_PR'
    iv_from = ls_query_aui-from
    iv_to = ls_query_aui-to
    IMPORTING
    ev_qupart = ls_qupart_range-querypart.
    APPEND ls_qupart_and TO lt_query.
    APPEND ls_qupart_range TO lt_query.
    does anyone has a suggestion or a clue to give?
    Thanks
    Bruno

  • UCxn - Query to search for a specific email address

    I've got an odd issue...I've got a user in our London office on a completely separate voicemail system (Unity 5) that is receiving SMTP notifications from the voicemail system (UCxn 9.1.2) here in the US.  I'm wondering if there's a query I can run against the database to search for her email address and see if it is in the US cluster someplace?  I'm not a DB guy at all, so when it comes to SQL, I'm lost.
    Appreciate any help someone can provide
    SJ           

    You can try the user data dump from the ciscounitytools online and then just search the output and see if it's in there.
    HTH
    java
    if this helps, please rate
    www.cisco.com/go/pdihelpdesk

  • SAP Query: Caseless search for case-senstive dictionary field

    Hi
    I have a question regarding the select options in a sap query. here is the scenario:
    I have a SAP query + infoset. in the selection sreen I have a field from the type MAKTX. this field is a character field that allows upper and lower case. I have the problem that my users provide an input only in lower case e.g. "bottle" and only find the results where bottle is only in lower case. Results with the word "Bottle" they cannot find.
    I am pretty familiar with abap and programing the code to achiev this is not the problem. I just don't know how I can bring my coding and the sap query together. I had 2 ideas:
    a) I make a z-search help and attach it to my select-option in the selection screen. but I don't know if this is possible and where I do that
    b) I put my code into the code-enhancement section in the infoset. but again I am not sure where I have to put it and if there are any restrictions that I have to know....
    c) any other solution will be good as well... maybe somebody has an idea.
    I hope I could make my problem clear. please let me know if you have any idea how I can do that. I don't want to modify the data dictionary object!!.
    thanks in advance - <offer removed by moderator>.
    thanks a lot
    Alex
    Edited by: Thomas Zloch on Oct 6, 2011 8:57 PM

    Use MAKTG instead, in the selection screen. It's has the same value as MAKTX but it's not case sensitive.

  • SQL Query to search for most and least popular brands bought by spesific client and total

    Hi to SQL query masters!
    I need to create a report on most and least popular brand names within one specific client orders.
    For example, during last month or a year among 100% of specific client's orders were 70% IBM products, 20% of HP and 10% Lenovo products.
    How do I do that?
    And I also think that it might be useful to have a query that shows top popular brands among all sales in given period of time – this statistic might improve warehouse turnover and marketing activities on least popular brand names.
    I tried to use info from this link, but it didn’t help https://websmp106.sap-ag.de/~form/sapnet?_SCENARIO=01100035870000000183&_FRAME=OBJECT&_HIER_KEY=701100035871000439554&
    Kind regards,
    Ilya.

    Hi
    Please Check this
    SELECT COUNT (T2.[CardCode]) as 'no of sales', T3.ItmsGrpNam,T2.Cardname
    FROM rdr1 T0  INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode INNER JOIN ORDR T2 ON T0.DocEntry = T2.DocEntry
    INNER JOIN OITB T3 ON T1.ItmsGrpCod = T3.ItmsGrpCod
    WHERE T2.[DocDate] >= [%0] and  T2.[DocDate] <= [%1]
    GROUP BY T3.ItmsGrpNam,T2.Cardname
    ORDER BY COUNT (T2.[cardcode]) desc

  • Query Builder: Search for column

    The feature to dynamically expand/shrink the table list as I type stuff in the search box is great.
    But some of my tables have over 100 columns, I want to display all the tables/views having "ACCNT" in the columnname.
    How can I do that?
    Thanks

    Hello,
    In the Query Builder you can't but that sounds like a very good enhancment. Please idrop it in the 2.0 bug/wishlist app and we'll see if we can get it into a future version.
    Carl

  • Query to search in all schema tables for a 'filed value'

    Hi,
    Can u help me out on this ?.
    I want a sql query to search for one field value in all the schema table.
    or do we have something in toad to check for this

    Please follow this thread.
    How to select all records from all tables where SCORE = 99
    -aijaz

  • Search for Special Character in  Oracle Text CONTAINS Query

    Hi,
    We have to write few query which will search for email id in the Oracle Text.
    The Search text will be like <[email protected]> .
    So email id should be searched correctly with the @ symbol.
    Similarly we want the following special character to be searched in the Text like ",',*

    You will need to escape the special characters by either using \ in front of each special character or putting {} around the whole phrase that contains the special characters, as per the online documentation:
    http://download.oracle.com/docs/cd/B28359_01/text.111/b28304/cqspcl.htm#CCREF2091

  • FQL query text to search for exact string

    Hi
    we are using SharePoint 2010 with FAST search...
    I'd like to be able to search for this exact string that contains parentheses...  "(ABC)"
    I thought it would be:
    ManagedProperyName:"(ABC)"
    this returns results with just ABC ... it ignores the parentheses... i need to only show documents with "(ABC)"

    For exact query you can use  equals. For example MPName:equals("<term or phrase>")
    However, in your case the parenthesis is considered a special characters which are stripped off during document processing and at query time.

  • Search for elements of the Query Builder

    Hi,
    can somebody please give me an idea of where to search for Query elements by the UID.
    My colleague created a standard BEx transport order and did nothing else than release it. Now the order contains different Query elements that should be deleted. We want to check those elements before transporting, but can't find a way...
    Thanks!!!!

    Goto SE16 and check in RSZCOMPDIR Table

  • SQL Query to search all the tables for a given string

    Hi all,
    This is concerning a query to search each and every table/column for a given string.
    I came across a similar post (Re: question about searching 600 tables and this query seems to be inline with my requirements:
    select table_name,
    column_name,
    :search_string search_string,
    result
    from cols,
    xmltable(('ora:view("'||table_name||'")/ROW/'||column_name||'[ora:contains(text(),"%'|| :search_string || '%") > 0]')
    columns result varchar2(10) path '.'
    where table_name in ('MY_TABLE')
    However, I am getting the following error:
    ORA-24451: OCIKCallPushTrusted, Maximum call depth exceeded
    I am using Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit and could you please let me know the best possible way to accomplish this task?
    Thanks.
    Edited by: itech.quest on Sep 19, 2010 8:30 AM

    Hi Tamir,
    Thanks so far. I am yet to make the crucial breakthrough as far my application goes. Are you talking about the EUL5_QPP_STATS table? I tried retrieving worksheets even from that table also with the following query
    SELECT DISTINCT Eul5QppStats.QS_DOC_NAME,Eul5QppStats.QS_DOC_DETAILS
    FROM EUL5_QPP_STATS Eul5QppStats,EUL5_DOCUMENTS Eul5Documents
    WHERE Eul5QppStats.QS_DOC_NAME = Eul5Documents.DOC_NAME
    However, the worksheet data retrieved by Discoverer Oracle's product is not matching my dataset for every workbook. Please suggest.
    Reg
    Thomas

  • Using AppleScript for launch a raw-query Spotlight search?

    As per usual with my limited scripting skills, I am finding the apparently simple stuff rather difficult to achieve.
    My problem with Spotlight is that I want to use the same type of raw query repeatedly, but I want to avoid the tedium of having to:
    1) open my saved search
    2) choose "Show Criteria" to make the saved raw query visible
    3) edit the text field containing the raw query, where the visible stuff is not what I want to edit, so I have to scroll to the right within that tiny field
    So my idea would be to design a simple UI with AppleScript that
    1) pops up a dialog asking for a phrase to search
    2) launches a Spotlight search using the raw query:
    kMDItemTextContent=="xxx*"
    where "xxx" is the phrase that I am searching for, and opens a Finder window with the results of that search.
    My reason for wanting to do this is that, by default, a search for an exact phrase with Spotlight fails to return matches that contain the plural form when the searched phrase is a singular.
    See:
    http://www.betalogue.com/2010/05/07/spotlight-plural/
    http://www.betalogue.com/2010/05/11/spotlight-phrase/
    for more information about the background for this.
    Would this be relatively easy to do with AppleScript?
    Thanks in advance.
    Pierre

    Hi
    Pierre Igot wrote:
    Am I correct in assuming that this means that what I wanted could not just be achieved with AppleScript and required a Perl script?
    Message was edited by: Pierre Igot
    A smart folder is an XML file (PLIST), you can edit it in many ways.
    It's possible with other shell commands (sed or awk).
    But perl works seamlessly with extended characters (ASCII > 127)
    Also it's possible with AppleScript commands (open for access, read, write, close access), or with *property list file* in System events
    But it requires more lines of code.
    Here's the script :
    global a_text
    set smartFolder to "/Users/jack/Library/Saved Searches/Recherche dans “Bureau”.savedSearch"
    set a_text to text returned of (display dialog "Enter a phrase to search" default answer "")
    if a_text contains """ then
    set a_text to findAndReplace(""", "\"", a_text)
    end if
    tell application "System Events"
    set TheXML to property list file smartFolder
    repeat with i in (get property list items of contents of TheXML)
    set t_name to name of i
    if t_name is "RawQuery" then
    tell i to set value to my replace_text(get value)
    else if t_name is "SearchCriteria" then
    tell property list item 2 of property list item "displayValues" of property list item 1 of property list item "FXCriteriaSlices" of i to set value to my replace_text(get value)
    else if t_name is "RawQueryDict" then
    tell property list item "RawQuery" of i to set value to my replace_text(get value)
    end if
    end repeat
    end tell
    set smartFolder to ((POSIX file smartFolder) as alias)
    tell application "Finder"
    activate
    open smartFolder
    end tell
    on replace_text(t)
    set x to the offset of "kMDItemTextContent==" in t
    set L to length of t
    repeat with i from L to 1 by -1
    if character i of t = """ then
    set y to i
    exit repeat
    end if
    end repeat
    return (text 1 thru (x + 20) of t) & a_text & (text y thru -1 of t)
    end replace_text
    on findAndReplace(tofind, toreplace, t)
    set ditd to text item delimiters
    set text item delimiters to tofind
    set t to text items of t
    set text item delimiters to toreplace
    set t to t as string
    set text item delimiters to ditd
    return t
    end findAndReplace

  • Search for tablenames in the database using native sql query script

    How do i search for the names of the tables in the database using select statement? I do not know the names of the tables but I know the name of the database and i do not have the sys priviliges.
    thanks
    SS

    SELECT owner, table_name
    FROM all_tables;

  • Problem with searching for 'empty' emails with BAPI_BUPA_SEARCH

    Dear ABAP'ers.
    I have got a small problem with BAPI_BUPA_SEARCH.
    I Use this BAPI to search for Business Partners with the Email condition.
    I put rhe Email to lv_email variable, it works ok.
        lv_email = ' '
        CALL FUNCTION 'BAPI_BUPA_SEARCH'
          EXPORTING
            email = lv_email
          TABLES
            searchresult = lt_searchresult   <= returns no BuPas
            return       = ls_bapiret2  .
    But I need to have a possibility to search for such Business Partners who have got no email address. Unfortunatellu when I pass an empty lv_email to BAPI, it returns no Business Partners whilst such BuPas exist in database.
    Is there some possibility to search for those BuPas who have got no email address assigned?
    I will be thankful for help.
    Regards,
    P.

    Can you query ADR6 table where SMTP_ADDR = space.
    and pick the PERSNUMBER or ADDRNUMBER and pick the Patners related to that ..

  • Short dump "Time limit exceeded" when searching for Business Transactions

    Hello Experts,
    We migrated from SAP CRM 5.2 to SAP CRM 7.0. After migration, our business transaction search (quotation, sales order, service order, contract etc) ends with the short dump "Time limit exceeded" in class CL_CRM_REPORT_ACC_DYNAMIC, method DATABASE_ACCESS. The select query is triggered from line 5 of this method.
    Number of Records:
    CRMD_ORDERADM_H: 5,115,675
    CRMD_ORDER_INDEX: 74,615,914
    We have done these so far, but the performance is still either poor or times out.
    1. DB team checked the ORACLE parameters and confirmed they are fine. They also checked the health of indices in table CRMD_ORDER_INDEX and indices are healthy
    2. Created additional indices on CRMD_ORDERADM_H and CRMD_ORDER_INDEX. After the creation of indices, some of the searches(without any criteria) work. But it takes more than a minute to fetch 1 or 2 records
    3. An ST05 trace confirmed that the selection on CRMD_ORDER_INDEX takes the most time. It takes about 103 seconds to fetch 2 records (max hits + 1)
    4. If we specify search parameters, say for example a date or status, then again we get a short dump with the message "Time limit exceeded".
    5. Observed that only if a matching index is available for the WHERE clause, the results are returned (albeit slowly). In the absence of an index, we get the dump.
    6. Searched for notes and there are no notes that could help us.
    Any idea what is causing this issue and what we can do to resolve this?
    Regards,
    Bala

    Hi Michael,
    Thanks. Yes we considered the note 1527039. None of the three scenarios mentioned in the note helped us. But we ran CRM_INDEX_REBUILD to check if the table CRMD_ORDER_INDEX had a problem. That did not help us either.
    The business users told us that they mostly search using the date fields or Object ID. We did not have any problem with search by Object ID. So we created additional indices to support search using the date fields.
    Regards,
    Bala

Maybe you are looking for